Perforce Public Knowledge Base - Debugging Helix Swarm Email Problems
Downloads Blog Company Integrations Careers Contact Try Free
Menu Search
Reset Search



Debugging Helix Swarm Email Problems

« Go Back


When Swarm emails are not being received how do I troubleshoot?
(1) Are any emails being sent?

If emails are only being sent to some users check the following matrix for when you should expect emails to be sent:

From Swarm 2017.1 onwards you will also need to check the users personal email notofication settings:

and the global email notification settings:

If you still expect emails to be sent then go to step (3) to check if Swarm is generating the email.

(2) Is email explicitly configured?

See the following section of the Swarm documentation:

If email is not explicitly configured then Swarm uses the method specified in 'php.ini'. By default this uses 'sendmail'.

(3) Are you using restricted changelists by default?

As a super user run:
p4 configure show

and look for the text:
defaultChangeType: restricted
If you are using restricted changelists check that the intended users have at least 'list' permission to the files in the changelist. If they do not and you still want them to receive emails allow restructed changelists to unauthorized users using:

(4) Increase logging

Increase logging to level '7', restart Apache and test. Is the email logged in the Swarm logs:

A good test is to @ mention a user in a comment. Make sure this is not your own user. An example of a log entry is:
2017-03-09T11:24:03+00:00 DEBUG (7): Email sent. Subject: [Swarm] Review @43 - My changelist description {"recipients":"[\"\",\"\"]"}

(5) Test from the command line

Is 'sendmail' installed? Can you send an email from the command line:
echo Swarm Email Test | sendmail -f
echo Swarm Email Test2 | sendmail -f

Note: When testing Swarm emails it's often usesful to pretend that your email address is multiple email addresses. You can do this by adding '+text' to the email address. For example: ''.

If that fails is port 25 using sendmail?   
netstat -anp | grep 25

If not using sendmail then check your MX record and try a manual telnet test. For example:

(6) Additional logging

Try adding additional logging to ensure the email is being put together in Swarm:

Swarm - Adding email debugging to swarm logs

(7) Does php.ini contain a mistake?

Check for non standard SMTP configuration in 'php.ini':

(8) Prove that PHP email sending works

Try running the following code from the command line on the Swarm server (changing email addresses as neccessary):
 * Perforce Swarm - Email testing code.
 * @copyright   2016 Perforce Software. All rights reserved.
 * @license     Please see LICENSE.txt in top-level folder of this distribution.
use Zend\Loader\AutoloaderFactory;
use Zend\Mvc\Application;


include '/opt/perforce/swarm/library/Zend/Loader/AutoloaderFactory.php';
        'Zend\Loader\StandardAutoloader' => array(
            'namespaces' => array(
                'P4'     => BASE_PATH . '/library/P4',
                'Record' => BASE_PATH . '/library/Record',
                'Zend'   => BASE_PATH . '/library/Zend'
// ensure strict and notice is disabled; otherwise keep the existing levels
error_reporting(error_reporting() & ~(E_STRICT|E_NOTICE));
use Zend\Mail;
$email = "";
$emailName = "Test User";
$subject = "Test email using zend in swarm";
$message = "Swarm email sent from zend module in swarm";
$sender = "";
//Prepare email
$mail = new Mail\Message();
$mail->addTo($email, $emailName);
$mail->setFrom($sender, 'Swarm Zend');
$transport = new Mail\Transport\Sendmail();
<h1>Test email For <?php echo $emailName . " '" . $email. "' "; echo date("D M d, Y G:i a"); ?></h1>
Related Links



Was this article helpful?



Please tell us how we can make this article more useful.

Characters Remaining: 255