On Sun, Dec 08, 2013 at 03:20:28PM +0000, John Cox wrote:
> Hi
> 

Hi,


> 1st off, very many thanks for your prompt and illuminating reply. I'll
> get the current version of OpenSMTPD and try to make it work shortly.
>
> There's one bit I don't quite understand in your reply though:
> 
> >> accept from any for domain example.net\
> >>   alias <aliases>\
> >>   deliver to maildir %(user.directory)/Maildir
> >> 
> >> seems clearly wrong as we don't want to deliver there.  So we have to
> >> split the forwarding rules from the alias rules?
> >>
> >
> >The "deliver" part is the default action, it will only be matched for
> >aliases entries that map to local users, if a user has an alias that
> >has an email address as a target, mail will match that action first
> >so the deliver part will be discarded.
> 
> That is excellent, but could you expand on what happens there.  The
> alias expands to an email address - so far so good - it isn't
> delivered locally because it isn't a local address - yes - but what
> happens next?  Does smtpd run the entire ruleset over the new
> destination address from the start, does it continue to run the
> ruleset from the current line (i.e. earlier rules aren't checked) or
> is there some other auto-magic that forwards it to the right
> destination?
> 

Quite simple actually, say you have an alias that states:

      gilles           [email protected]

and a ruleset that goes:

      accept from any for domain foobar.org deliver to maildir
      accept from local for any relay

When you send mail to [email protected], during the smtp transaction we
find a match on the first rule, we generate an envelope for it.

That envelope goes throuh an expansion process to resolve aliasing, and
at this point we realize that we're not the final destination.

We therefore generate a new envelope locally and reapply the entire
ruleset on it, but since this process is initiated from a user which
is valid to start with, the envelope is generated with a local source
and requires a rule to accept relaying from local.


> Sorry to take up your time, but I'd really like to understand what is
> actually meant to happen so I don't waste your time in the future.
> 

np, these kinds of questions are nice to fill our archives ;-)


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

-- 
You received this mail because you are subscribed to [email protected]
To unsubscribe, send a mail to: [email protected]

Reply via email to