postfix - send only setup so I can receive system emails

Complete noob with this stuff so please bare with me.

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

Some additional info here. Just checked email from within Webmin and there are some settings obviously missing/wrong. I did not do the initial setup of this server either.

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 me@example.com

Reason for failure 550 Access denied - Invalid HELO name (See RFC2821

Remote mail server example.com

Reporting mail server localhost

In /etc/postfix/main.cf I needed myhostname = li.members.linode.com. Restarted postfix afterwards.

echo "This is the body of the email" | mail -s "This is the subject line" user@example.com

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.

Try

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).

That is what was chosen.

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.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct