postfix - send only setup so I can receive system emails
At the moment I am using this strictly for hosting MySQL db's. I would like to be able to receive system emails though whether those be alerts or notifications that upgrades are available. I did some research today, but can't seem to get this working (the emails are never received).
/etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.
myhostname = localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all
/etc/aliases
# See man 5 aliases for format
postmaster: root
# added 03/17/15 so root emails are forwarded
root: me@example.com
Obviously that is not my email. Any ideas here or possibly point me in the right direction? I have use the mail command in ssh to send some test emails to myself and they do not come through. Webmin is also installed and it allows test emails to be sent from within its interface as well which are not received either.
4 Replies
The email headers are showing :
From MAILER-DAEMON@localhost (Mail Delivery System)
To root@localhost
Date 17/03/2015 16:58
Subject Undelivered Mail Returned to Sender
failed delivery status :
Final recipient
Reason for failure 550 Access denied - Invalid HELO name (See RFC2821
Remote mail server example.com
Reporting mail server localhost
echo "This is the body of the email" | mail -s "This is the subject line"
is being received
echo "This is the body of the email" | mail -s "This is the subject line" root
is NOT being received
What else do I need to do here? The root/system emails is what I really need to work.
dpkg-reconfigure postfix
and choose "Internet Site". Use that as your starting point.
(You are apparently using "Local only" which means no email is forwarded outside).
What I ended up doing was changing the email that Webmin was sending from. The default was 'webmin@osprey.111.111.111.111' and I changed this to 'root@li****.members.linode.com' and that did the trick.
Why did that work? I have no idea to be honest.