tarballed
September 10th, 2003, 13:55
Back everyone. :evil:

Just curious about the user of the alias file for postfix...
Reason I ask is that, I was scanning through my logs this morning when this particular entry caught my eye:

[code:1:6f16bfc75a]Sep 10 04:02:01 corpmail postfix/pickup[1799]: 7E4B3AB543: uid=0 from=<root>
Sep 10 04:02:01 corpmail postfix/cleanup[1960]: 7E4B3AB543: message-id=<20030910110201.7E4B3AB543@corpmail.acme.com>
Sep 10 04:02:01 corpmail postfix/qmgr[704]: 7E4B3AB543: from=<root@acme.com>, size=984, nrcpt=1 (queue active)
Sep 10 04:02:22 corpmail postfix/smtp[1964]: 7E4B3AB543: to=<root@acme.com>, orig_to=<root>, relay=www.acme.com[209.126.174.148], delay=21, status=sent (250 2.0.0 h8AAxwa17629 Message accepted for delivery)
Sep 10 04:02:43 corpmail postfix/pickup[1799]: 6A064AB543: uid=0 from=<root>
Sep 10 04:02:43 corpmail postfix/cleanup[1960]: 6A064AB543: message-id=<20030910110243.6A064AB543@corpmail.acme.com>
Sep 10 04:02:43 corpmail postfix/qmgr[704]: 6A064AB543: from=<root@acme.com>, size=702, nrcpt=1 (queue active)
Sep 10 04:03:11 corpmail postfix/smtp[1964]: 6A064AB543: to=<root@acme.com>, orig_to=<root>, relay=www.acme.com[209.126.174.148], delay=28, status=sent (250 2.0.0 h8AB0ta17691 Message accepted for delivery)
[/code:1:6f16bfc75a]

Ok...if im reading this correctly, it appears that root on the local server sent a mail to root, which in turn was relayed through our ISP's mail server (which is what I want it to do for now)...

That correct?

If so, why wasn't that email sent to me? I setup the alias file so that all emails for root will be sent to me, not to root?

Can someone clarify that for me? I appreciate it.

Tarballed

soup4you2
September 10th, 2003, 14:30
how is your aliases stated in your postfix conf file?

if you followed the howto's here your using /etc/aliases

after editing aliases you need to run newaliases

tarballed
September 10th, 2003, 14:35
soup4you2,

That is exactly what I did...edited the alias file and ran postalias after I was completed.

That is why im confused about what happened.

Tarballed

|MiNi0n|
September 10th, 2003, 14:49
Once you replace the correct settings in mailer.conf you'll be able to use postfix's newaliases command to create them again. If the postalias you did in the mean time worked, there should be an aliases and aliases.db file in /etc

tarballed
September 10th, 2003, 15:18
Thanks Minion. The only problem is, this particular issue is on the actual mail server itself, running RH, not OpenBSD. :(

I'm working on the mailer.conf for the OpenBSD box...im just confused as to why this was not sent to my account and relayed instead...


Tarballed

bmw
September 11th, 2003, 08:30
Just curious about the user of the alias file for postfix...
From those logs, and knowing nothing else about your net, I infer:

- your Postfix box handles the domain corpmail.acme.com.
- your ISP handles the domain acme.com.

Therefore root@acme.com is non-local to the Postfix box and so should be sent to the ISP, which is indeed what happened. Aliasing didn't occur because the Postfix box only treats addresses in corpmail.acme.com as local to it.

If you want to snarf root@acme.com and deal with it specially, create a virtual mapping; eg: root@acme.com -> tarballed@corpmail.acme.com

The important thing to keep in mind about aliases is they are treated identically to local users on the Postfix box. If an address could resolve to a local user, then an alias for that user will work; otherwise not.

However, virtual maps can match any passing address. They are more efficient too as they remap the recipient address in the cleanup daemon and avoid an extra round trip through Postfix as happens with aliases. (Not usually a concern except in high-volume environments of course.)

tarballed
September 11th, 2003, 13:18
The only thing I can thing of is the following:

When I set mydestination to the following:

[code:1:50debe5ec0]mydestination = $myhostname, localhost.$mydomain[/code:1:50debe5ec0]

The box relays through my ISP...which is what I want it to do, fon now...

Now, when I add the following to mydestinatin:

[code:1:50debe5ec0]mydestination = $myhostname, localhost.$mydomain, $mydomain[/code:1:50debe5ec0]

It delivers mail locally (for instance, if I send to a user on my domain...which is what the end result is going to be...

So, I imagine, when I finalize the box and put $mydomain at the end of mydestination, all of root's email will then be forwarded to me...

I could be wrong though....

T.

bmw
September 11th, 2003, 13:42
No, tarballed, you are exactly right! :-)

When you set mydestination to include your domain, you are making your Postfix box answer for (be authoritative for) your domain, thus making root@foo.acme.com == root@acme.com and both local to the PF box "foo".

The virtual map would fix your problem now and continue to work (ie be harmless) when you alter your config later.

tarballed
September 11th, 2003, 14:03
Woot! Feels good to figure something out, especially after how my last couple of weeks have shaped up...

I appreciate your input bmw...I'll give the virtual maps a shot here....BTW, redoing the OpenBSD box...have some time today and i'd like to work on a few things.

Tarballed