Alias Expansion Problem

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Alias Expansion Problem

Hirayama, Pat
Alias Expansion Problem

Hello,

I've recently converted from sendmail, and postfix seems to be having problem with a recursive alias we use.

So, in our aliases file, we have an address like this:

allstaff: user1, user2, user3 ... user79, user80, allstaff80
allstaff80: user81, user82, ... user159, user160, allstaff160
allstaff160: user160, user161, ... user219, user220, allstaff220
...
and so forth and so on ... at user1921 (contained in alias allstaff1920), postfix starts responding with:

warning: alias database loop for user1921

and continues in that vein for the remaining 1000+ addresses.

I've tried adjusting virtual_alias_expansion_limit and virtual_alias_recursion_limit -- but even upping them to 10000 doesn't seem to remedy the situation.

Any thoughts on what I should be setting to address this issue?

Thanks,

                  -p


--
Pat Hirayama
IT / Server Operations
Fred Hutchinson Cancer Research Center
[hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Alias Expansion Problem

Victor Duchovni
On Fri, Jun 26, 2009 at 12:52:33PM -0700, Hirayama, Pat wrote:

> Hello,
>
> I've recently converted from sendmail, and postfix seems to be having problem with a recursive alias we use.
>
> So, in our aliases file, we have an address like this:
>
> allstaff: user1, user2, user3 ... user79, user80, allstaff80
> allstaff80: user81, user82, ... user159, user160, allstaff160
> allstaff160: user160, user161, ... user219, user220, allstaff220
> ...

Because Postfix does not modify the queue file during local alias
expansion, this is a poor way to represent the alias with Postfix.

Instead:

    /etc/aliases:
        owner-allstaff: [hidden email]
        allstaff: :include:/etc/postfix/allstaff

    /etc/postfix/allstaff:
    [hidden email]
        [hidden email]
        ...  flat list of all the users ...

If at all possible ensure that the none of the addresses in the
"allstaff" file are "local", rather it is better if they are
all in a virtual alias domain, which rewrites them to local
addresses. You could even resort to:

        virtual_alias_domains = valias.example.com
        virtual_alias_maps = ... pcre:/etc/postfix/virtual.pcre

    virtual.pcre:
    /(.*)@valias\.example\.com$/ ${1}@example.com

and list:

    /etc/postfix/allstaff:
    [hidden email]
        [hidden email]
        ...  flat list of all the users ...

anything to suppress parallel recursive alias expansion in Postfix.

--
        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:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

RE: Alias Expansion Problem

Hirayama, Pat
RE: Alias Expansion Problem

So, the problem is with the recursion, and in fact, if it were just an alias with 3000+ addresses in a flat file, that will be handled without difficulty?

     -p



-----Original Message-----
From: Victor Duchovni [[hidden email]]
Sent: Fri 6/26/2009 2:41 PM
To: Hirayama, Pat
Cc: [hidden email]
Subject: Re: Alias Expansion Problem

On Fri, Jun 26, 2009 at 12:52:33PM -0700, Hirayama, Pat wrote:

> Hello,
>
> I've recently converted from sendmail, and postfix seems to be having problem with a recursive alias we use.
>
> So, in our aliases file, we have an address like this:
>
> allstaff: user1, user2, user3 ... user79, user80, allstaff80
> allstaff80: user81, user82, ... user159, user160, allstaff160
> allstaff160: user160, user161, ... user219, user220, allstaff220
> ...

Because Postfix does not modify the queue file during local alias
expansion, this is a poor way to represent the alias with Postfix.

Instead:

    /etc/aliases:
        owner-allstaff: [hidden email]
        allstaff: :include:/etc/postfix/allstaff

    /etc/postfix/allstaff:
        [hidden email]
        [hidden email]
        ...  flat list of all the users ...

If at all possible ensure that the none of the addresses in the
"allstaff" file are "local", rather it is better if they are
all in a virtual alias domain, which rewrites them to local
addresses. You could even resort to:

        virtual_alias_domains = valias.example.com
        virtual_alias_maps = ... pcre:/etc/postfix/virtual.pcre

    virtual.pcre:
        /(.*)@valias\.example\.com$/    ${1}@example.com

and list:

    /etc/postfix/allstaff:
        [hidden email]
        [hidden email]
        ...  flat list of all the users ...

anything to suppress parallel recursive alias expansion in Postfix.

--
        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:
<[hidden email]>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply | Threaded
Open this post in threaded view
|

Re: Alias Expansion Problem

Victor Duchovni
On Fri, Jun 26, 2009 at 04:25:37PM -0700, Hirayama, Pat wrote:

> So, the problem is with the recursion, and in fact, if it were just
> an alias with 3000+ addresses in a flat file, that will be handled
> without difficulty?

Not exactly, the problem is that when expanding the list, Postfix
encounters local users, some of whom also have aliases, .forward
files, ... and all of this needs to happen in a single processing
step for compatibility with Sendmail aliases(5) semantics.

It is not the flatness of the expansion but the fact that users
have .forward files, mailboxes, ... which means that alias expansion
generates not just new addresses for a secondary queue-file, but also
parallel deliveries to mailboxes and pipes, ... Loops certainly don't
help either.

Faced with all this complexity, I redesign the namespace to make the
problem cases impossible.

    - All "real" email addresses are non-local

    - Any local addresses arise only from virtual(5) expansion of
      real addresses to internal local addresses of corresponding
      local mailboxes

    - Any local mailbox that is an alias expands to a set of
      non-local real addresses, the RHS of a local alias is never
      (directly) another local alias.

This eliminates support for recursive local aliases, but also
eliminates all the associated problems.

--
        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:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.