Enable Outgoing Emails

From Amahi Wiki
Revision as of 17:13, 8 July 2010 by Gboudreau (talk | contribs)
Jump to: navigation, search

Here's how to enable outgoing emails on your Amahi server.

Note: Make sure to use copy-paste to execute those commands. In particular, they contain back-ticks as the starting string delimiter, which can be hard to find on a keyboard!

As root:

 SMTP_SERVER=your_isp_smtp_server
 yum -y install sendmail-cf m4
 cd /etc/mail
 sed -ie "s/.*SMART_HOST.*/define(\`SMART_HOST', \`$SMTP_SERVER')dnl/" sendmail.mc
 m4 sendmail.mc > sendmail.cf
 make
 service sendmail restart

Make sure to replace your_isp_smtp_server on the first line with the hostname or IP address of your ISP SMTP server.

If you need to provide a username and password to use the SMTP server, you'll need to do this too:

 SMTP_SERVER=your_isp_smtp_server
 USERNAME=your_smtp_username
 PASSWORD=your_smtp_password
 cd /etc/mail
 echo "AuthInfo:$SMTP_SERVER \"U:$USERNAME\" \"P:$PASSWORD\" \"M:PLAIN\"" >> access
 makemap hash access < access
 make
 service sendmail restart

If you need to connect to the SMTP server using port 465 (SSL), you'll need to do this too:

cd /etc/mail echo "define(\`RELAY_MAILER_ARGS', \`TCP \$h 465')dnl" >> sendmail.mc echo "define(\`ESMTP_MAILER_ARGS', \`TCP \$h 465')dnl" >> sendmail.mc m4 sendmail.mc > sendmail.cf make service sendmail restart