Changes

From Amahi Wiki
Jump to: navigation, search
1,720 bytes added ,  00:52, 5 December 2014
no edit summary
heading =WARNING|
message = This is recommended only for advanced users, proceed with caution.}}
Here's how to enable outgoing emails on your Amahi server (untested on Fedora 19).
Note'''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!
[[Open Terminal as root|As '''root''' user]]:
{{code|Code== Option 1 (untested on Fedora 19)==<pre>
SMTP_SERVER=your_isp_smtp_server
yum -y install sendmail-cf m4
make
chkconfig sendmail on
service sendmail restart}}</pre>
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 connect to the SMTP server using port 587 (TLS/STARTTLS), you'll need to do this too:
{{code|Code=<pre>
cd /etc/mail
sed -ie "s/\(.*SMART_HOST.*\)/\1\ndefine(\`RELAY_MAILER_ARGS', \`TCP \$h 587')dnl\ndefine(\`ESMTP_MAILER_ARGS', \`TCP \$h 587')dnl/" sendmail.mc
make
service sendmail restart
}}</pre>
If you want to use another port than 587, change that number in the above command (it's there twice), before executing it. If you already executed it, edit the sendmail.mc file, and search for 587 - it should appear there twice - change both.
service sendmail restart
</div>-->
{{code|Code=<pre>
SMTP_SERVER=your_isp_smtp_server
USERNAME=your_smtp_username
make
service sendmail restart
}}<pre> == Option 2 (tested on Fedora 19)==<pre>su -yum -y install sendmail-cf mailxcp /etc/mail/sendmail.mc /etc/mail/sendmail.mc.origvi /etc/mail/sendmail.mc</pre>Near the very bottom before MAILER insert the following lines. Sendmail is picky about the quotation marks: when I first pasted them, they were wrong and gave me a syntax error. This section is a combination of the two sources above which fixes the error in /var/log/maillog “no route to host” which apparently has nothing to do with DNS resolution.<pre>define(`SMART_HOST',`smtp.gmail.com')dnldefine(`RELAY_MAILER_ARGS', `TCP $h 587')dnldefine(`ESMTP_MAILER_ARGS', `TCP $h 587')dnldefine(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnlFEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnlTRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')</pre>Then save. Back in the terminal:<pre>mkdir /etc/mail/authvi /etc/mail/auth/client-infoAuthInfo:smtp.gmail.com "U:root" "I:<YOUR GMAIL USERNAME HERE>@gmail.com" "P:<YOU GMAIL PASSWORD HERE>"</pre>Of course, fill out your real login info, save, and exit. The next section skips the part about the openssl certificates: I ran it, but it didn’t seen to be necessary on Fedora.<pre>cd /etc/mail/authmakemap hash client-info.db < client-infochmod 700 /etc/mail/authchmod 600 /etc/mail/auth/*cd /etc/mailmakeservice sendmail restart</pre>Finally, send a test email.<pre>echo 'this is a test'| mail -s test_email user@example.com<pre>If it fails, read /var/log/maillog and /var/log/messages. Ref: [http://www.techvilleottawa.org/sendmail-smtp-gmail-relay-on-fedora-centos-redhat Sendmail SMTP Gmail Relay on Fedora-Centos-Redhat]
12,424

edits