Page 1 of 2

[2.1] Configure Email for Amazon SES - RESOLVED

PostPosted: 30.04.2015, 18:44
by abarker
We've got our Collabtive setup on an Amazon EC2 instance. We wanted to use Amazon SES to send out the email notifications, but we've been having trouble getting it working. I was able to successfully send an email via CLI from the server that Collabtive is running on, but I haven't had any success configuring Collabtive to send notifications. Since the CLI method requires the SMTP credentials be Base64 encoded when submitted, I've tried configuring Collabtive with the credentials both unencoded and Base64 encoded, with no luck in either situation. A screen shot of my settings is attached.

emailSettings.png
emailSettings.png (23.93 KiB) Viewed 19899 times

Re: Configure Email for Amazon SES

PostPosted: 01.05.2015, 16:19
by Eva
I'm not sure if the port specification is taken care of by Collabtive... That may be the weak point here.
Can anyone confirm this?

Re: Configure Email for Amazon SES

PostPosted: 01.05.2015, 16:55
by abarker
Eva wrote:I'm not sure if the port specification is taken care of by Collabtive... That may be the weak point here.
Can anyone confirm this?


I just worked through trying the settings with the port removed, both with the bare credentials and the Base64 encoded credentials. No luck in either case.

Re: Configure Email for Amazon SES

PostPosted: 03.05.2015, 14:04
by some person
The port number gets taken care of by the email library that collabtive is using.

The default port number is 25, so there is no reason to provide the port in the server field if this is the port you are using.

Actually, I believe you should be using port 587 instead.

The server field should now look something like this:
Code: Select all
email-smtp.us-west-2.amazonaws.com:587


You also might need to add the following code, inside class.emailer.php file, found in include directory.
Code: Select all
$mailer->SMTPSecure = 'tls';

Add the above code after the line that reads:
Code: Select all
$mailer->SMTPAuth = true;

Re: Configure Email for Amazon SES

PostPosted: 04.05.2015, 23:15
by abarker
some person wrote:The port number gets taken care of by the email library that collabtive is using.

The default port number is 25, so there is no reason to provide the port in the server field if this is the port you are using.

Actually, I believe you should be using port 587 instead.

The server field should now look something like this:
Code: Select all
email-smtp.us-west-2.amazonaws.com:587



For the region my server is in, I'm supposed to use 25 or 587. I tried 587 from the CLI last week and it wasn't working, but 25 was. Testing today shows that 587 is working again, so I adjusted settings in collabtive to try that port. Current server setting is:
Code: Select all
email-smtp.us-west-2.amazonaws.com:587


Tried with raw and Base64 SES credentials. No luck.

some person wrote:You also might need to add the following code, inside class.emailer.php file, found in include directory.
Code: Select all
$mailer->SMTPSecure = 'tls';

Add the above code after the line that reads:
Code: Select all
$mailer->SMTPAuth = true;


Still no luck.

Re: [2.1] Configure Email for Amazon SES

PostPosted: 05.05.2015, 15:03
by some person
It is possible that the version of the email library that collabtive is using is outdated and thus not compatible with Amazon SES.

You can upgrade the PHPMailer library by going here https://github.com/PHPMailer/PHPMailer and downloading class.phpmailer.php and class.smtp.php files, and placing them in the include directory inside your collabtive.

Make sure that you are replacing the two current files found in collabtive, with these two new files.

I have tested this and I was able to send email, using a standard SMTP connection, using collabtive by just replacing those two files with the new versions, no other changes were necessary.

Re: [2.1] Configure Email for Amazon SES

PostPosted: 05.05.2015, 20:08
by abarker
some person wrote:It is possible that the version of the email library that collabtive is using is outdated and thus not compatible with Amazon SES.

You can upgrade the PHPMailer library by going here https://github.com/PHPMailer/PHPMailer and downloading class.phpmailer.php and class.smtp.php files, and placing them in the include directory inside your collabtive.


I just tried this, and now any action that should trigger a notification is landing the UI on a white screen. For example, if I add a message to a project and select to notify a specific user, the browser (both IE 11 and Chrome 42.0.2311.135 m) ends on a blank page with a URL like https://collabtive.mydomain.com/managem ... =add&id=10. Based on the behavior I see when I turn off the notifications, I would expect to end up on https://collabtive.mydomain.com/managem ... mode=added after adding a message.

Re: [2.1] Configure Email for Amazon SES

PostPosted: 05.05.2015, 20:49
by abarker
After some more testing, I found this in the server logs:

Code: Select all
[Tue May 05 17:58:24.644335 2015] [:error] [pid 12329] [client 12.164.155.8:37407] PHP Warning:  Invalid argument supplied for foreach() in /var/www/html/include/initfunctions.php on line 112, referer: https://collabtive.mydomain.com/managemessage.php?action=showproject&id=10
[Tue May 05 17:58:24.649164 2015] [:error] [pid 12329] [client 12.164.155.8:37407] PHP Fatal error:  Class 'SMTP' not found in /var/www/html/include/class.PHPmailer.php on line 1235, referer: https://collabtive.mydomain.com/managemessage.php?action=showproject&id=10

Re: [2.1] Configure Email for Amazon SES

PostPosted: 06.05.2015, 08:02
by some person
abarker wrote:After some more testing, I found this in the server logs:

That error is telling you that PHP can't find or load the SMTP class (class.smtp.php).

Make sure that class.smtp.php file is in the include directory.

Re: [2.1] Configure Email for Amazon SES

PostPosted: 06.05.2015, 16:22
by abarker
some person wrote:That error is telling you that PHP can't find or load the SMTP class (class.smtp.php).

Make sure that class.smtp.php file is in the include directory.


That's one of the files you suggested that I try updating yesterday. In any case, it's there:

includes.png
includes.png (88.81 KiB) Viewed 19809 times