Discussion:
sendmail-style aliases in Postfix
(too old to reply)
James Garrison
2004-09-14 17:55:29 UTC
Permalink
I'm trying to set up something in Postfix that's trivial in sendmail,
but having difficulty. A typical aliases setup in sendmail causes
mail to various system login IDs (such as bin, daemon, named, www,
abuse, postmaster, etc.) to be forwarded to the appropriate
recipients, which can be local or remote addresses. Typically most of
these are aliased to "root", and root is aliased to the real admin's
address, which is probably not local.

Having read the documentation, I understand that the aliases database
is used ONLY by the local(8) delivery agent, while virtual_alias_maps
is used during cleanup(8), so virtual aliasing happens much earlier in
the process.

This seems to imply that sendmail's alias function is actually more
closely mirrored by Postfix's virtual aliasing, and I should move all
the traditional sendmail alias mappings to virtual_alias_maps in order
to achieve similar functionality.

One thing that definitely doesn't work is to leave the sendmail
aliases where they are and use a virtual alias root->realAdmin. Mail
originally addressed to root gets forwarded correctly (due to virtual
aliasing), but mail originally to one of the system IDs and aliased to
root in /etc/postfix/aliases.db just gets delivered locally because
virtual aliasing happens before local aliasing. .

Is there any reason I shouldn't implement the traditional sendmail
aliases db in virtual_alias_maps in Postfix?
--
James Garrison Athens Group, Inc.
mailto:***@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
PGP: RSA=0x92E90A3B DH/DSS=0x498D331C (512) 345-0600 x150
Matt
2004-09-14 18:20:28 UTC
Permalink
Post by James Garrison
I'm trying to set up something in Postfix that's trivial in sendmail,
but having difficulty. A typical aliases setup in sendmail causes
mail to various system login IDs (such as bin, daemon, named, www,
abuse, postmaster, etc.) to be forwarded to the appropriate
recipients, which can be local or remote addresses. Typically most of
these are aliased to "root", and root is aliased to the real admin's
address, which is probably not local.
Works exactly the same way with Postfix.
Post by James Garrison
One thing that definitely doesn't work is to leave the sendmail
aliases where they are and use a virtual alias root->realAdmin. Mail
originally addressed to root gets forwarded correctly (due to virtual
aliasing), but mail originally to one of the system IDs and aliased to
root in /etc/postfix/aliases.db just gets delivered locally because
virtual aliasing happens before local aliasing. .
I may be missing the point here, but are you just wanting the same local
root to email address or local alias setup? Are you actually using virtual
domains? Sorry if I've misinterpreted the question, but:

root: ***@example.com or root: user

works exactly the same way. It delivers to the RHS (alias|email-address).

Matt
Victor Duchovni
2004-09-14 18:22:08 UTC
Permalink
Post by James Garrison
I'm trying to set up something in Postfix that's trivial in sendmail,
but having difficulty. A typical aliases setup in sendmail causes
mail to various system login IDs (such as bin, daemon, named, www,
abuse, postmaster, etc.) to be forwarded to the appropriate
recipients, which can be local or remote addresses. Typically most of
these are aliased to "root", and root is aliased to the real admin's
address, which is probably not local.
Having read the documentation, I understand that the aliases database
is used ONLY by the local(8) delivery agent, while virtual_alias_maps
is used during cleanup(8), so virtual aliasing happens much earlier in
the process.
Yes.
Post by James Garrison
This seems to imply that sendmail's alias function is actually more
closely mirrored by Postfix's virtual aliasing, and I should move all
the traditional sendmail alias mappings to virtual_alias_maps in order
to achieve similar functionality.
No. Even in Sendmail aliases apply only for local deliveries. The Postfix
aliases(5) mechanism is essentially Sendmail compatible by design, there
is a minor difference in the syntax of "\user" in .forward files, with
Postfix having the more semantics IMHO :-)

From false premises you can arrive at any conclusion, so the discussion
ends here.
--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:***@postfix.org?body=unsubscribe%20postfix-users>
James Garrison
2004-09-14 18:28:14 UTC
Permalink
Post by Victor Duchovni
No. Even in Sendmail aliases apply only for local deliveries. The Postfix
aliases(5) mechanism is essentially Sendmail compatible by design, there
Yes, but in sendmail you can easily achieve the desired result of
forwarding all 'root' mail to a non-local address, regardless of
how the mail got aliased to root. If virtual_alias_maps is not the
Postfix mechanism, I'd appreciate a pointer to the document that
describes how to achieve the same goal. Thanks in advance.
--
James Garrison Athens Group, Inc.
mailto:***@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
PGP: RSA=0x92E90A3B DH/DSS=0x498D331C (512) 345-0600 x150
James Garrison
2004-09-14 18:31:23 UTC
Permalink
Post by Matt
works exactly the same way. It delivers to the RHS (alias|email-address).
Not quite. Sendmail allows non-local addresses on the RHS.
Postfix does not, since aliases happens only after local delivery
has been selected.
--
James Garrison Athens Group, Inc.
mailto:***@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
PGP: RSA=0x92E90A3B DH/DSS=0x498D331C (512) 345-0600 x150
Wietse Venema
2004-09-14 18:32:13 UTC
Permalink
Post by James Garrison
One thing that definitely doesn't work is to leave the sendmail
aliases where they are and use a virtual alias root->realAdmin. Mail
You can't use virtual(5) alias for this.

The local(8) delivery agent does not expand virtual(5) aliases.
It expands local(8) aliases(5) instead.
Post by James Garrison
originally addressed to root gets forwarded correctly (due to virtual
aliasing), but mail originally to one of the system IDs and aliased to
root in /etc/postfix/aliases.db just gets delivered locally because
virtual aliasing happens before local aliasing. .
Use local(8) aliases(5) instead.
Post by James Garrison
Is there any reason I shouldn't implement the traditional sendmail
aliases db in virtual_alias_maps in Postfix?
Yes. The local(8) delivery agent does not expand virtual(5) aliases.

Wietse
Wietse Venema
2004-09-14 18:33:12 UTC
Permalink
Post by James Garrison
Post by Matt
works exactly the same way. It delivers to the RHS (alias|email-address).
Not quite. Sendmail allows non-local addresses on the RHS.
Postfix does not, since aliases happens only after local delivery
has been selected.
This is plain wrong. Postfix aliases RHS can have any domain.

Wietse
Victor Duchovni
2004-09-14 18:49:59 UTC
Permalink
Post by James Garrison
Post by Matt
works exactly the same way. It delivers to the RHS (alias|email-address).
Not quite. Sendmail allows non-local addresses on the RHS.
Postfix does not, since aliases happens only after local delivery
has been selected.
From false premises you can draw any desired conclusion. The local
delivery agent forwards external recipients that result from alias
expansion back into the queue for remote delivery. Without this aliases
would not work correctly.

The implementation difference from Sendmail is that the expansion process
happens in the Postfix local delivery agent (not to be confused with
external delivery programs such as procmail, ...) Sendmail does this
is one big monolithic binary and uses external delivery programs such
as /bin/mail. The Postfix local delivery agent does a lot more than
procmail or /bin/mail (in particular it subsumes alias processing).
--
Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:***@postfix.org?body=unsubscribe%20postfix-users>
James Garrison
2004-09-14 18:53:53 UTC
Permalink
Did this change between Postfix v1 and v2?
No. local(8) NEVER expands virtual(5) aliases.
I distinctly remember
seeing error messages about not allowing non-local addresses
on the RHS of an alias definition in V1.
No. You can't use domains on the LEFT HAND side.
Wietse
Either that or I'm
going crazy.... :-)
Post by Wietse Venema
This is plain wrong. Postfix aliases RHS can have any domain.
My apologies. Thanks for the clarification.
--
James Garrison Athens Group, Inc.
mailto:***@athensgroup.com 5608 Parkcrest Dr
http://www.athensgroup.com Austin, TX 78731
PGP: RSA=0x92E90A3B DH/DSS=0x498D331C (512) 345-0600 x150
Loading...