Localmail missing for root

banderas20

New Member
Credits
97
Hi,

I have a running installation of Postfix and it's working locally. However, I find some strange issues.

If I run this as root:

Code:
echo "mail body" | mail -s "test mail" root
I expect to have mail as root user. However, If I run "mail", the system says:

Code:
No mail for root
I haven't any directory named Maildir under root folder.

/var/mail/root file is also empty.

If I do the same with another user as recipient, I find the mail under its Maildir/new directory.

¿What's going on?

Thanks!
 


f33dm3bits

Gold Member
Gold Supporter
Credits
7,310
Can you share all the maillogs of that specific mail which you sent to user root.
 

banderas20

New Member
Credits
97
Can you share all the maillogs of that specific mail which you sent to user root.
Sure!

Code:
Oct 22 20:25:43 debian postfix/pickup[5749]: 739AA1403C4: uid=0 from=<[email protected]>
Oct 22 20:25:43 debian postfix/cleanup[5782]: 739AA1403C4: message-id=<[email protected]>
Oct 22 20:25:43 debian postfix/qmgr[5748]: 739AA1403C4: from=<[email protected]>, size=314, nrcpt=1 (queue active)
Oct 22 20:25:43 debian postfix/local[5784]: 739AA1403C4: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.02, delays=0.01/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Oct 22 20:25:43 debian postfix/qmgr[5748]: 739AA1403C4: removed
"alberto" is the user I am logged in as. But I am in an elevated prompt ("sudo su"), so I expect to be from root to root...
 

f33dm3bits

Gold Member
Gold Supporter
Credits
7,310
Isn't that from root to your alberto user that was being delivered to Maildir of that user and from root to alberto or root to root the mail not arriving in the Maildir of the root user? Also what distro are you running, Debian? Can you share your full configuration, so main.cf?
 
Last edited:

banderas20

New Member
Credits
97
Hi.

I'm running Debian9.

Additional info: I am running the mail command as "alberto", but with elevated privileges (sudo su - so I am root). ¿Can this have something to do?

Thanks!
 

f33dm3bits

Gold Member
Gold Supporter
Credits
7,310
No that shouldn't be a problem. Can you share your postfix configuration, so main.cf?
 
Last edited:

banderas20

New Member
Credits
97
Sure, here you go:

Code:
# 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 (Debian/GNU)
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

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2

home_mailbox = Maildir/

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

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = debian
mydomain = local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, debian, localhost.localdomain, , localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128, 192.168.65.128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
mailbox_command =
 

f33dm3bits

Gold Member
Gold Supporter
Credits
7,310
You configuration is correct, and worked because when I copy it to my test system I receive mails in Maildir format for both normal users and the root user. I would enable debug logging for postfix and then try again this way you will see more information in the syslog of what exactly postfix is doing.
 


Members online


Top