On Tue, Aug 15, 2017 at 09:22:41AM +0200, Walter Alejandro Iglesias wrote:
> Hello everyone,
> 
> I'd appreciate experienced opensmtpd users tell me if I'm understanding
> well the mechanism in the following rule.
> 
> Currently, in my smtpd.conf I have this line:
> 
>   accept from any for domain <vdomains> virtual <valiases> deliver to mbox
> 
> But since all keys in my "valiases" table are full email addresses, in
> the form:
> 
>   u...@example.org    user
> 
> I'm thinking the use of "vdomains" table is redundant.  I could safely
> simplify the rule to:
> 
>   accept from any for any virtual <valiases> deliver to mbox
> 
> 
> Am I wrong in this assumption?
>

kind of, smtpd.conf being a first match ruleset it is impossible to make
this kind of analysis without having your other rules too.

in this case, this may or may not give the desired behavior depending on
rules following it because envelope matching happens _before_ virtual is
even evaluated.

with:

    accept from any for domain <vdomains> [...]

you will only match envelopes for the domains in <vdomains>, it allows a
different rule to match other domains:

    accept from any for domain <vdomains> [...]
    accept from any for domain foobar.org [...]

with:

    accept from any for any [...]

you will match all envelopes so you're essentially creating a catch-all.


virtual happens AFTER a rule has been matched so if you recipient is not
found the RCPT will be rejected, smtpd will not search for another rule.


-- 
Gilles Chehade

https://www.poolp.org                                          @poolpOrg

Reply via email to