Relay Mail with Exim4#
Example: Google Mail SMTP. Local hostname is think
.
Assumes TLS.
https://wiki.debian.org/GmailAndExim4
apt-get install exim4-daemon-light
cat<<'EOF' > /etc/exim4/update-exim4.conf.conf
dc_eximconfig_configtype='satellite'
dc_other_hostnames='think'
dc_local_interfaces='127.0.0.1 ; ::1'
dc_readhost='think'
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com::587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='true'
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'
EOF
cat<<'EOF' > /etc/exim4/passwd.client
*.google.com:USERNAME@gmail.com:PASSWORD
EOF
chown root:Debian-exim /etc/exim4/passwd.client
chmod 640 /etc/exim4/passwd.client
update-exim4.conf
service exim4 reload
Test (from bob@example.org):
echo 'Test body' | mail -r 'Bob <bob@example.org>' -s 'test subject' alice@example.org
tail /var/log/exim4/mainlog
Flush queue:
exim4 -qff # flush all mails in queue
List and remove messages from queue:
exim -bp
exim -Mrm $message_id
# e.g. exim -Mrm 1WGRuQ-0007ZD-5D