The UNIX and Linux Forums

The UNIX and Linux Forums (http://www.unix.com/index.php)
-   UNIX for Advanced & Expert Users (http://www.unix.com/unix-for-advanced-and-expert-users/)
-   -   [SOLVED] Root mail going to user "mail" instead of root (http://www.unix.com/unix-for-advanced-and-expert-users/180005-solved-root-mail-going-user-mail-instead-root.html)

Narnie 03-26-2012 08:54 PM

[SOLVED] Root mail going to user "mail" instead of root
 
I running Linux Mint Debian Edition tracking testing and have started a cron job that will send something to the root mailbox. Mint has heirloom and exim4 installed. However, mail was getting nothing. I realized that in /etc/aliases, there was a line

Code:

root: mint
Since you can't log into the mint user (and /var/mail had no mint file), I commented out the root: mint line and did a:

Code:

/etc/init.d/exim4 restart
Now, mail is going to the user mail not root. Roots mail can be found in /var/mail/mail.

For some reason, it is not going to the root user. As root, I can

Code:

su mail
But this is inconvenient. I would like root's mail to go to root.

Can someone let me know how to have root's mail actually go to root's mailbox?

There is no /root/.forward file, either.

Thanks,
Narnie

---------- Post updated at 07:54 PM ---------- Previous update was at 12:21 AM ----------

I had done a:

Code:

grep -R mail /etc/exim4
And didn't see anything interesting.

I decided to do a:

Code:

grep -R root /etc/exim4
And got an interesting hit that fits. In /etc/exim4/conf.d/mmm_mail4root (which should have giving me a hint but was among many other files so I couldn't see the forest for the trees) I found this:

Code:

### router/mmm_mail4root
#################################
# deliver mail addressed to root to /var/mail/mail as user mail:mail
# if it was not redirected in /etc/aliases or by other means
# Exim cannot deliver as root since 4.24 (FIXED_NEVER_USERS)

mail4root:
  debug_print = "R: mail4root for $local_part@$domain"
  driver = redirect
  domains = +local_domains
  data = /var/mail/mail
  file_transport = address_file
  local_parts = root
  user = mail
  group = mail

That was the smoking gun I needed. Now I know what was going on.


All times are GMT -4. The time now is 05:46 AM.

Linux and Unix Supported by: vBulletin
Search Engine Optimisation provided by DragonByte SEO v1.1.4 (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
The UNIX and Linux Forums Content Copyright ©1993-2013. All Rights Reserved.
Forum Operations by The UNIX and Linux Forums