Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Address re-writes

5 views
Skip to first unread message

Daniel L. Miller

unread,
Apr 3, 2012, 12:47:23 PM4/3/12
to
I'm sure I've done something dumb as usual - I just don't see it.

My users are all virtual and stored in LDAP. I also have LDAP aliases.
I also have recipient, sender, canonical, and transport entries.

I have defined a particular alias in LDAP - this alias is mapped to two
users. If I send a message to that alias, using Hotmail as an external
test, it processes correctly.

From main.cf:
smtpd_sender_restrictions =
reject_unlisted_sender,
check_sender_access hash:/etc/postfix/maps/fax-access

and fax-access:
mes...@inbound.efax.com REDIRECT thea...@amfes.com

It appears that the redirection occurs - but then is handed to the lda
for delivery, without resolving the alias. This used to work when I was
using a simple mailbox - but is now broken when using the alias.

--
Daniel

Wietse Venema

unread,
Apr 3, 2012, 1:27:35 PM4/3/12
to
Daniel L. Miller:
> I'm sure I've done something dumb as usual - I just don't see it.
>
> My users are all virtual and stored in LDAP. I also have LDAP aliases.
> I also have recipient, sender, canonical, and transport entries.
>
> I have defined a particular alias in LDAP - this alias is mapped to two
> users. If I send a message to that alias, using Hotmail as an external
> test, it processes correctly.
>
> From main.cf:
> smtpd_sender_restrictions =
> reject_unlisted_sender,
> check_sender_access hash:/etc/postfix/maps/fax-access
>
> and fax-access:
> mes...@inbound.efax.com REDIRECT thea...@amfes.com

As documented, REDIRECT affects all recipients. It is meant to yank
mail out of its normal path, and was originally implemented for
emergencies (that is also why the feature is not subject to canonical,
virtual alias, or BCC address mappings, and none of this is properly
documented).

In other words, don't use REDIRECT for routine mail processing.

Wietse

Daniel L. Miller

unread,
Apr 3, 2012, 1:32:39 PM4/3/12
to
On 4/3/2012 10:27 AM, Wietse Venema wrote:
> Daniel L. Miller:
>> and fax-access:
>> mes...@inbound.efax.com REDIRECT thea...@amfes.com
> As documented, REDIRECT affects all recipients. It is meant to yank
> mail out of its normal path, and was originally implemented for
> emergencies (that is also why the feature is not subject to canonical,
> virtual alias, or BCC address mappings, and none of this is properly
> documented).
>
> In other words, don't use REDIRECT for routine mail processing.
>
>

Ok - I'm using the wrong tool for the job. So - please let me rephrase
my question.

What would be the proper way to redirect inbound mail originally
destined for a valid user, to an alias which can be expanded/redirected
through normal handling, based on the sender?
--
Daniel

Wietse Venema

unread,
Apr 3, 2012, 2:03:50 PM4/3/12
to
Daniel L. Miller:
So you want to replace the recipient only some of the time,
but not all of the time. That is not built into Postfix.

Yesterday someone asked for size-dependent delivery paths. With
enough of such features, the mail system becomes really hard to
understand, like firewall rules.

Wietse

Daniel L. Miller

unread,
Apr 3, 2012, 11:28:06 PM4/3/12
to
I think a broader statement for what I'm looking for is to be able to
re-write the recipient based on the sender, and vice versa. If Postfix
does not support this, do you know of a tool that does that I can use as
a proxy/filter?
--
Daniel

Noel Jones

unread,
Apr 3, 2012, 11:32:27 PM4/3/12
to
On 4/3/2012 10:28 PM, Daniel L. Miller wrote:
>
> I think a broader statement for what I'm looking for is to be able
> to re-write the recipient based on the sender, and vice versa. If
> Postfix does not support this, do you know of a tool that does that
> I can use as a proxy/filter?

A milter should be able to do what you want. Look around at some of
the ones available.


-- Noel Jones

Daniel L. Miller

unread,
Apr 4, 2012, 5:06:13 PM4/4/12
to
Google didn't immediately turn one up for me - I'm probably using the
wrong search terms.

At the moment, I have a solution that appears to work. For sender
re-writes based on recipient, I'm using the suggestion you gave me a
month ago - a transport map & smtp_generic_maps. For recipient re-write
based on sender, I now use a feature of ASSP.

--
Daniel

0 new messages