Question

Can't root receive any email with postfix ?

  • Posted August 19, 2015
  • Email

There are two users : root and debian8 in my system. The domain name is pengsir.hfi
I fount that root can’t receive any email sent to it. ehco ‘test’ | mail -s ‘test’ root@localhost mail No mail for root cat /var/log/mail.log

Aug 19 15:47:49 pengsir postfix/pickup[3769]: 9F84FF829F: uid=1000 from=<debian8> Aug 19 15:47:49 pengsir postfix/cleanup[3808]: 9F84FF829F: message-id=20150819074749.9F84FF829F@pengsir.hfi Aug 19 15:47:49 pengsir postfix/qmgr[3770]: 9F84FF829F: from=debian8@pengsir.hfi, size=287, nrcpt=1 (queue active) Aug 19 15:47:49 pengsir postfix/local[3810]: 9F84FF829F: to=root@pengsir.hfi, orig_to=root@localhost, relay=local, delay=0.24, delays=0.14/0.01/0/0.1, dsn=2.0.0, status=sent (delivered to command: procmail -a “$EXTENSION”) Aug 19 15:47:49 pengsir postfix/qmgr[3770]: 9F84FF829F: removed

Why the email was removed?

Subscribe
Share

You’re missing the point… root isn’t supposed to receive emails! To have root receive emails would compromise your servers security in more ways than one. It’s a massive security breach waiting to happen. As I said in my response above, either forward FROM root to another email (debian8@pengsir.hfi for example) OR use the proper way of receiving mail for which I linked the guide. NEVER receive email as root itself!

That won’t work if postfix cannot login to the system… you need another user created to route mail to…

It is a so long article and full of technical knowledge,i will read it ,if there is something i don’t understand ,please help me.
I have make postfix as root aliases, all emails send to postfix instead of root.

vim /etc/aliases #to add the following as a new line in the file /etc/aliases postfix: root

Now anyone can send email to the user postfix as root , how can root open the email ? User postfix can’t login in the system. cat /var/spool/mail/postfix Root can open its email with the cat command as above. Any other smart way ?

What you’ve quoted is it saying that the email was removed from the active queue because postfix delivered the email successfully to the other party. Also, This is by design. Postfix is typically run in a chrooted environment so it can’t deliver to the root account… You could either set up an alias for root to forward to some other user on the system that you then pull mail from OR follow this guide: https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin <— I personally did that except for the spamassassin part and i’m starting to regret it now as my email is getting spammed to hell.


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This question was answered by @vedalken254:

What you’ve quoted is it saying that the email was removed from the active queue because postfix delivered the email successfully to the other party. Also, This is by design. Postfix is typically run in a chrooted environment so it can’t deliver to the root account… You could either set up an alias for root to forward to some other user on the system that you then pull mail from OR follow this guide: https://www.digitalocean.com/community/tutorials/how-to-configure-a-mail-server-using-postfix-dovecot-mysql-and-spamassassin <— I personally did that except for the spamassassin part and i’m starting to regret it now as my email is getting spammed to hell.

View the original comment