Skip to content
Alexander Holbreich
Go back

How to send E-Mails with Exim installed on Linux

Today I’ll show, how to configure email sending with your Debian Linux. The ability to send mails is a very useful feature for every long-running server machine, it’s an easy and common way to notify the administrator in case of any problems.

Here are configuration steps for mail-sending with Exim and Google Mail account (Google Apps accounts work the same way too).

apt-get update
apt-get install exim4

Configuration should be presented automatically after the installation. However, you can start configuration wizard of Exim every-time with

dpkg-reconfigure exim4-config

Use 127.0.0.1 if you want only to send emails from the local machine and nothing for other IP’s.

gmail-smtp.l.google.com:yourYourMail@googlemail.com:yourPass
*.google.com:yourYourMail@googlemail.com:yourPass
smtp.gmail.com:yourYourMail@googlemail.com:yourPass
chown root:Debian-exim /etc/exim4/passwd.client
update-exim4.conf

So now everything should be in place and we are ready for a first test. Simplest console test should be working via:

echo "Server Mail Test Message " | mail -s "Just Test" SomeMail@someDomain.org

Watch logs with:

tail -1000f /var/log/exim4/mainlog

when you see something like this everything vent perfect:

2010-02-14 23:00:26 1NgmVu-0007v8-Kt < = root@mail-server1.mycompany.com U=root P=local S=424
2010-02-14 23:00:28 1NgmVu-0007v8-Kt => testMail@mycompany.org R=smarthost T=remote_smtp_smarthost H=gmail-smtp-msa.l.google.com [72.14.221.109] X=TLS1.0:RSA_ARCFOUR_MD5:16 DN="C=US,ST=California,L=Mountain View,O=Google Inc,CN=smtp.gmail.com"

Appreciate your feedback.


Share this post on:

Archived comments (2)

These comments were migrated from Disqus and are no longer accepting replies.


Previous Post
The Queen and 11 Presidents!
Next Post
How to do SSH tunnels