Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have a problem with sendmail (postfix is not installed) in my CentOS, the file /var/spool/mail/root is missing, I have tried to restart sendmail and send mail from shell with:

mail -s "test mail" root </dev/null

/var/log/mailllog:

Apr  1 10:30:14 ip-172-31-41-71 sendmail[20477]: s31AUEPJ020477: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=302
19, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s31AUEN9020478 Message accepted for delivery

I also tried to create root file but nothing is written after test email is sent.

share|improve this question
1  
Maybe a silly question but do you have enough disk space? –  Laurent C. Apr 1 at 12:18
    
Perhaps this tutorial might help: How to Setup a Mail Server on CentOS 5 –  slm Apr 1 at 13:49
    
That's "message accepted for delivery". Where is the line where sendmail tries to actually deliver? What is the output of sendmail -bp? –  Jenny D Apr 1 at 17:44

1 Answer 1

First of all, /var/spool/mail/root is the mail spool file, where mail delivered to the local root user will be written. If this file doesn't exist when the first mail for root enter the system, it will be created automatically. So if the file doesn't exist yet, I see different cause to check :

  • Improprer permission in /var/spool/mail/root. Example permissions for mail : drwxrwsrwt to let anybody write in it, but not to touch file own by other (stiky bit - t)
  • The filesystem with /var/spool/mail may be full
  • The filesystem with /var/spool/mail is mounted read-only due, for instance, to some filesystem error at boot.
  • Sendmail is not configured to deliver local mail to /var/spool/mail. But you didn't share your Sendmail config, so I cannot tell for sure. For instance, if local mail is going to be delivered using procmail, the mail can be written in a totally different directory, depending of the procmail config (/etc/procmailrc or /root/.promailrc).
share|improve this answer
    
Disk space not a problem, is not read-only and it has always worked. I noticed this morning that there was no longer the file "root", i tried to recreate it with the same permissions as other files (eg ec2-user that is working properly) –  user2385354 Apr 1 at 15:17
    
So other mail is getting delivered, but not mails to root? Check if anything has been changed in your sendmail config or aliases. –  Jenny D Apr 1 at 17:42
    
Resolved!, i add "root" to file /root/.forward and work perfectly –  user2385354 Apr 2 at 9:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.