Aliases file not working

Richard G

Verified User
Joined
Jul 6, 2008
Messages
14,183
Location
Maastricht
I've discovered a problem which was not present before.

At first you have the /etc/aliases file in which several users are forwarded to root like this
Code:
mailer-daemon:  postmaster
postmaster:     root
abuse:    root

Ofcourse you have to forwat this so at the end you will do something like this:
Code:
# Person who should get root's mail
#root:          marc
root:   [email protected]
diradmin: :blackhole:

But this isn't working anymore. Mail send to abuse, postmaster, hostmaster or whatever, is not forwarded to [email protected] anymore.
I guess this is already since a longer time, but just discovered by accident.

I tried doing the newaliases command and restarting Exim, but mail is not send.
You only get this error:
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

[email protected]
Nothing more. Seems that the address does not exist.

How can I fix this? I know about the /root/.forward file, but this should working with the aliases file too.
Any clues/idea's on wy this is not working as designed?
 
I still find it strange that this is not catched by Directadmin or changed in Exim by DA.
Because in /var/named/domain.nl.db (for example) you also see hostmaster.mydomain.com which is also not reachable in spite of the fact that it's mentioned in /etc/aliases.
So in fact even for the root domain which is used to install Directadmin, a forward for important emails like abuse, hostmaster and/or postmaster should be made manually? I don't recall having to do that some time back, by my memory could be playing tricks on me.
 
I don't remember to work it another way. The /etc/aliases file works for domains of a suspended account also.
 
Oke thanks for explaining.
I can remember from 2 years back, I had to disable the "webmaster" and "support" parts in aliases, because otherwise all mail to [email protected] was automatically redirected to [email protected] (from server.maindomain.nl) automatically. But maybe that was a bug in Exim and is fixed in the meantime.
I will create the forwards, thanks!
 
Try


Code:
chmod 755  /home/admin/.forward
chown admin:admin  /home/admin/.forward

If it does not help then check /var/log/exim/mainlog for errors.
 
This won't work either. Not a single .forward is working. Maybe because DA is looking at another place for forwards.
No errors in /var/log/exim/mainlog:
2014-09-06 02:07:47 1XQ3Xf-0002g6-5f <= [email protected] H=ns1.someserver.nl (server18.someserver.nl) [46.4.xxx.xx] P=esmtps X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 S=1083 [email protected] T="testing" from <[email protected]> for [email protected]
2014-09-06 02:07:47 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XQ3Xf-0002g6-5f
2014-09-06 02:07:47 cwd=/tmp 4 args: /usr/sbin/exim -oMr spam-scanned -bS
2014-09-06 02:07:49 1XQ3Xf-0002gA-CV <= [email protected] U=mail P=spam-scanned S=1496 [email protected] T="testing" from <[email protected]> for [email protected]
2014-09-06 02:07:49 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XQ3Xf-0002gA-CV
2014-09-06 02:07:49 1XQ3Xf-0002gA-CV ** [email protected] F=<[email protected]> R=virtual_aliases:
2014-09-06 02:07:49 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1XQ3Xf-0002gA-CV
2014-09-06 02:07:49 1XQ3Xh-0002gI-K2 <= <> R=1XQ3Xf-0002gA-CV U=mail P=local S=2328 T="Mail delivery failed: returning message to sender" from <> for [email protected]
2014-09-06 02:07:49 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1XQ3Xh-0002gI-K2
2014-09-06 02:07:49 1XQ3Xf-0002gA-CV Completed
2014-09-06 02:07:49 1XQ3Xf-0002g6-5f => abuse <[email protected]> F=<[email protected]> R=spamcheck_director T=spamcheck S=1366
2014-09-06 02:07:49 1XQ3Xf-0002g6-5f Completed
2014-09-06 02:07:50 1XQ3Xh-0002gI-K2 => [email protected] F=<> R=lookuphost T=remote_smtp S=2394 H=mail.myprivate.nl [46.4.xxx.xxx] X=TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256 C="250 OK id=1XQ3Rc-0000zl-M9"
2014-09-06 02:07:50 1XQ3Xh-0002gI-K2 Completed

Seems only way to fix this is to make real forwards from within DA itself. They wil get into /etc/virtual/aliastestdomain.nl/aliases which contains the content below at this moment, after creating aliases via DA:
Code:
abuse: [email protected]
admin:admin
hostmaster: [email protected]
postmaster: [email protected]
*: :fail:

I'm just wondering, I think the default line :
Code:
*: :fail:
is taking care of the fact that nothing works except if you put it in here.
 
Last edited:
Back
Top