Zurmo SMTP test mail hanging

Zurmo SMTP test mail hanging

A couple of days ago, I was trying out a self hosted CRM solution called Zurmo. It’s looking great and I wanted to take the software for a test-drive. Soon enough, I stumbled upon a bug with the SMTP mail configuration. Whenever I tried to send a test mail to myself, an ajax window popped up but the process didn’t complete. The Zurmo SMTP test mail was hanging without obvious errors. I fixed the mail hanging problem by manual debugging and changing some code. I want to share this with you so you don’t have to potentially lose countless hours of frustration and fiddling around.

Debugging the Zurmo jobManager

The first problem I came across, was the jobManager. I went into a debugging mode. First, I ran the job manually from the commandline:

./zurmoc jobManager super TestOutboundEmail

This wasn’t going too well. This error appeared:

PHP Parse error:  syntax error, unexpected ‘instance’ (T_STRING) in /path/to/zurmo/app/protected/modules/jobsManager/utils/JobManagerFileLogRouteMessageStreamer.php(54) : assert code on line 1
PHP Error[4096]: assert(): Failure evaluating code:
$jobManagerFileLogger instance of JobManagerFileLogger

Basically there is something wrong with this line of code. I found on the zurmo.org forum somewhere that instead of “instance of”, it should be “instanceof”. So I opened the file


… looked for “instance of” and changed it to “instanceof”. I re-ran the command

./zurmoc jobManager super TestOutboundEmail

… and got the following output

Script will run at most for 300 seconds.
Sending output to runtime/jobLogs/TestOutboundEmail.log
4/3/14 4:51 PM My/Timezone Starting job type: TestOutboundEmail
PHP Error[8]: Undefined property: Swift_Transport_StreamBuffer::$_sequence
in file /path/to/zurmo/app/protected/extensions/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php

Holy cow, at least a part of the code is fixed. Apparantly there’s more going on.

Debugging the Zurmo StreamBuffer

According to the previous error message, there seems to be a declaration missing of a variable called “$_sequence”.

So I added the variable declaration to the file mentioned in the error:


… this is what I added:

private $_sequence;

UPDATE: actually in an updated zurmo version (I went from version 2.6.5 to 2.7.0), another error pops up: the access level “private” is too secure, you need to use protected or weaker (public). So I ended up with the more secure “protected” declaration and this seemed to do the trick:

protected $_sequence;

Be sure to put this declaration in the correct place. I placed it above the other declarations. See screenshot for a visualisation of the precise location.

Zurmo config edit

Image is clickable so you can see in more detail.

This got rid of the last error and the job suddenly started running and finishing. I ran the command one last time to test:

./zurmoc jobManager super TestOutboundEmail

… and bingo, everything seems fine.

Script will run at most for 300 seconds.
Sending output to runtime/jobLogs/TestOutboundEmail.log
4/3/14 4:55 PM My/Timezone Starting job type: TestOutboundEmail
4/3/14 4:55 PM My/Timezone Ending job type: TestOutboundEmail

Sure enough, seconds later I received a test mail in my inbox. The Zurmo SMTP test mail hanging problem is solved. I hope this helps! Be sure to leave a comment if this did the trick for you as well (or didn’t).

Avatar Laurens (7 Posts)

Laurens Vercaigne is an IT-consultant, web developer, programmer and copywriter with profound expertise of both Linux and Windows environments. He has experience in developing and optimizing trading scripts and robots for forex- and stockmarkets. There is also a lot of fun to be had with automating as much as possible, or making tasks and processes more efficient, practical of just smart. After all, computers are here to make our lives easier, aren't they?

One Response

  1. Avatar
    Jessica 24 January 2017 at 23:10 | | Reply

    Thank you for this great explanation.

Leave a Reply