Loading

[2.1] Configure Email for Amazon SES - RESOLVED

Get help with problems, or report & discuss bugs in Collabtive

[2.1] Configure Email for Amazon SES - RESOLVED

Postby abarker » 30.04.2015, 18:44

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 19935 times
Last edited by abarker on 07.05.2015, 17:06, edited 2 times in total.
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Re: Configure Email for Amazon SES

Postby Eva » 01.05.2015, 16:19

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?
Project Management the way you like it: Collaborative - Open Source - Free

facebook.com/Collabtive
twitter.com/Collabtive
xing.com/companies/collabtive
linkedin.com/company/collabtive
User avatar
Eva
 
Posts: 1471
Joined: 01.01.2008, 23:31
Location: Saarbrücken, Germany

Re: Configure Email for Amazon SES

Postby abarker » 01.05.2015, 16:55

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.
Running Collabtive 2.1 on Amazon Linux AMI 2015.03, PHP 5.6.8, MySQL 5.5.42
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Re: Configure Email for Amazon SES

Postby some person » 03.05.2015, 14:04

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;
some person
 
Posts: 439
Joined: 16.04.2011, 12:46

Re: Configure Email for Amazon SES

Postby abarker » 04.05.2015, 23:15

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.
Running Collabtive 2.1 on Amazon Linux AMI 2015.03, PHP 5.6.8, MySQL 5.5.42
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Re: [2.1] Configure Email for Amazon SES

Postby some person » 05.05.2015, 15:03

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.
some person
 
Posts: 439
Joined: 16.04.2011, 12:46

Re: [2.1] Configure Email for Amazon SES

Postby abarker » 05.05.2015, 20:08

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.
Running Collabtive 2.1 on Amazon Linux AMI 2015.03, PHP 5.6.8, MySQL 5.5.42
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Re: [2.1] Configure Email for Amazon SES

Postby abarker » 05.05.2015, 20:49

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
Running Collabtive 2.1 on Amazon Linux AMI 2015.03, PHP 5.6.8, MySQL 5.5.42
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Re: [2.1] Configure Email for Amazon SES

Postby some person » 06.05.2015, 08:02

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.
some person
 
Posts: 439
Joined: 16.04.2011, 12:46

Re: [2.1] Configure Email for Amazon SES

Postby abarker » 06.05.2015, 16:22

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 19845 times
Running Collabtive 2.1 on Amazon Linux AMI 2015.03, PHP 5.6.8, MySQL 5.5.42
abarker
 
Posts: 10
Joined: 30.04.2015, 17:04
Location: Arizona, United States

Next

Return to Problems and Bugs

Who is online

Users browsing this forum: No registered users