Actually that's not possible the way he did it.

    > > |accept from any for domain "domain.tld" alias <aliases> deliver to 
maildir
    > > |accept from any for domain "domain.tld" virtual <vmap> deliver to 
maildir

The condition for matching a rule does not look into aliases mapping as this
would create some issues that you can easily figure out if you have a relay
rule at the end of your ruleset.

The conditions include "from", "sender", "for", "recipient", therefore you
can achieve the desired result by having:

   accept from any for domain "domain.tld" recipient <rcptlist> alias <aliases> 
...
   accept from any for domain "domain.tld" virtual <vmap> ...

recipients for @domain.tld that are not part of rcptlist would not match the
first rule but would match the second one.

That being said, your use-case of having the same domain both primary AND
virtual, is quite strange, while doable it very likely needs a bit more
thinking or down the road there be dragons ;-)


On Wed, Dec 11, 2013 at 06:51:00AM -0800, Barbier, Jason wrote:
> That is possible as long as the mail never matches the first rule.
> OpenSMTPD is setup as a first match rule set so if you get a message that
> matches rule one and you really want it to match rule 2 that wont work. but
> with what you are describing that would work.
> 
> 
> On Wed, Dec 11, 2013 at 6:31 AM, Maurice Janssen <[email protected]> wrote:
> 
> > Hi,
> >
> > I was wondering if something like this is possible:
> >
> > +--------------
> > |listen on all
> > |
> > |table aliases db:/etc/mail/aliases.db
> > |table vmap file:/etc/mail/virtual-users
> > |
> > |accept from any for domain "domain.tld" alias <aliases> deliver to maildir
> > |accept from any for domain "domain.tld" virtual <vmap> deliver to maildir
> > |accept from any for domain "other_domain.tld" virtual <vmap> deliver to
> > maildir
> > |accept for local alias <aliases> deliver to maildir
> > |accept for any relay
> > +--------------
> >
> > So two accept rules for one domain.
> >
> > The idea behind this is as follows:
> > The alias table contains the more or less default aliases for root,
> > postmaster, etc.
> > The vmap table contains aliases for the regular user account, such as
> > m.janssen       maurice
> >
> > I prefer to keep these separate, because I'd like to use the same
> > virtual users for some other virtual domains as well.
> >
> > Is this possible?
> >
> > Thanks,
> > Maurice
> >
> > --
> > You received this mail because you are subscribed to [email protected]
> > To unsubscribe, send a mail to: [email protected]
> >
> >
> 
> 
> -- 
> Jason Barbier
> 
> Pro Patria Vigilans

-- 
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