Use Gmail as an SMTP server

147 views
Skip to first unread message

Gipetto

unread,
Mar 15, 2010, 4:53:14 PM3/15/10
to EtherPad Open Source Discussion
I looked and didn't see this documented anywhere else. We wanted to
use GMail as our outgoing server instead of managing a local SMTP
server but Etherpad wasn't having it. I was able to track down why and
modify Etherpad to properly authenticate against GMail. Etherpad
wasn't set up to do TLS authentication. Below is a diff of my change.

After making the change update your properties file to add the proper
values for smtpServer, smtpUser and smtpPass.

--- a/trunk/infrastructure/net.appjet.ajstdlib/ajstdlib.scala Fri
Dec 25 22:53:09 2009 -0500
+++ b/trunk/infrastructure/net.appjet.ajstdlib/ajstdlib.scala Thu
Mar 11 14:38:29 2010 -0700
@@ -217,6 +217,7 @@
val debug = false;

val props = new Properties;
+ props.put("mail.smtp.starttls.enable","true");
props.put("mail.smtp.host", config.smtpServerHost);
props.put("mail.smtp.port",
config.smtpServerPort.toString());
if (config.smtpUser != "")

Message has been deleted

Andrei

unread,
May 10, 2010, 12:46:08 PM5/10/10
to EtherPad Open Source Discussion
Hello

Thanks for sharing this with us ! I've patched the file as you
indicate, and configured SMTP settings in config with smtp.gmail.com:
587 as the SMTP server, and a correct username and password.

However, Etherpad fails to send any emails and it seems something goes
wrong with Postfix : "Recipient address rejected: User unknown in
local recipient table".

Do you have any idea of what could be going wrong ?

Thanks again

Andrei

unread,
May 10, 2010, 12:54:38 PM5/10/10
to EtherPad Open Source Discussion
Ok, figured it out. Seems to be a problem with Postfix rejecting email
to unknown recipients in local domains, that is if Postfix resides on
the same IP as the destination domain. More info about this here :
http://www.postfix.org/LOCAL_RECIPIENT_README.html.

This can be fixed by editing Postfix's config in /etc/postfix/main.cf
and adding "local_recipient_maps =", that is, setting it to an empty
value.
Reply all
Reply to author
Forward
0 new messages