LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   postfix ignores /etc/aliases (http://www.linuxquestions.org/questions/linux-software-2/postfix-ignores-etc-aliases-4175457939/)

CeSinge 04-12-2013 02:52 PM

postfix ignores /etc/aliases
 
Hello,

I want postfix to sent e-mails to root or postmaster to another e-mail address.
So I have the following in /etc/aliases :

root@ secumailtest:/var/log# more /etc/aliases
# See man 5 aliases for format
postmaster: francois.lagrange@ securendo.com
abuse: francois.lagrange@ securendo.com
root: francois.lagrange@ securendo.com

Still, notifications to root are not sent to francois.lagrange@ securendo.com, but rather to root@ cesinge.com. cesinge.com is the domain of the server, the only entry in the mysql mail database.

mysql> select * from domains;
+-------------+
| domain |
+-------------+
| cesinge.com |
+-------------+
1 row in set (0.00 sec)


Postfix is otherwise configured to use /etc/aliases.

root@secumailtest:/var/log# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no


So why is postfix ignoring the aliases and sending these notifications to root@ local domain instead of the defined alias?
I did a newaliases.

Note: I added a space after the '@' because the site's editor stubbornly converts them to clickable e-mail addresses...


Thank you,

bigrigdriver 04-14-2013 07:49 PM

I'm also running Debian. Your /etc/aliases looks very different from mine.
Yours:
Code:

root@ secumailtest:/var/log# more /etc/aliases
 # See man 5 aliases for format
 postmaster: francois.lagrange@ securendo.com
 abuse: francois.lagrange@ securendo.com
 root: francois.lagrange@ securendo.com

Mine:
Code:

mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root

And for your host domain:
Code:

Still, notifications to root are not sent to francois.lagrange@ securendo.com,
but rather to root@ cesinge.com. cesinge.com is the domain of the server,
the only entry in the mysql mail database.

 mysql> select * from domains;
 +-------------+
 | domain |
 +-------------+
 | cesinge.co

What do you have in /etc/hosts?

CeSinge 04-15-2013 02:52 AM

bigrigdriver,

This is /etc/hosts. There's not much in it.
Code:

cesinge@secumailtest:~$ more /etc/hosts
127.0.0.1      localhost

[IPv6 standard lines skipped]
95.138.172.242  secumailtest.cesinge.com        secumailtest
10.179.70.42          secumailtest.cesinge.com        secumailtest
127.0.1.1            secumailtest.cesinge.com        secumailtest
2a00:1a48:7805:0113:0e13:f616:ff08:3f99 secumailtest.cesinge.com        secumailtest

/etc/hostname contains just the line
secumailtest - that's all.
It seems that Postfix or SpamAssassin just ignore /etc/aliases (and also the postfix forwardings table). I see that all notification mails are always sent to and from root@cesinge.com. I assume that root is because that's the user running postfix and spamassassin. And I guess @cesinge.com because it's the DNS domain to which the machine belongs?
What bothers me is that I don't have a clear understanding of how this works. Then I could consider tweaking something to force these mails to a mailbox that I read.

CeSinge 04-15-2013 03:37 AM

Testing this further, I replaced all the .cesinge.com in the hosts file by .securendo.com, to see if these would be used when system root mails are sent.
I then sent a mail to just root: mail root

The mail cannot be delivered, because the machine, secumailtest, cannot be resolved (no A record) in that other domain securendo.com (normal).

While the mail to root itself fails, the system still manages to send me an undelivered mail notification root@cesinge.com! So I have to conclude that this @cesinge.com is somehow forced in there for system generated messages. I does not come from the host file. It ignores any modification from the aliases or forwardings. From where does this adres root@cesinge.com come, then? <puzzled>


All times are GMT -5. The time now is 08:08 PM.