Tuesday, May 29, 2018

I got smtpd.conf working thanks to the man page

Just in case it could be useful to others.

After upgrading the snaptshot requiring the new version of smtpd.conf
it happend that the new rules I'd written (included the last one Gilles
passed me) were all wrong.

I could get it working thanks to the man page. The result:

# OLD
accept from local for local alias <aliases> deliver to mbox
accept from any for domain <vdomains> virtual <valiases> deliver to mbox
accept from local sender <addresses> for any relay


# FIST ATTEMPT (smtpd -n told me the three last lines were wrong)
action local_users mbox alias <aliases>
action remote_users relay

match from local for local apply local_users
match from any for domain <vdomains> virtual <valiases> apply local_users
match from local sender <addresses> for any apply remote_users
match auth from any sender <addresses> for any apply remote_users


# NOW WORKING
action "local" mbox alias <aliases>
action "virtual" mbox virtual <valiases>
action "relay" relay

match from local for local action "local"
match from any for domain <vdomains> action "virtual"
match mail-from <addresses> for any action "relay"
match auth mail-from <addresses> for any action "relay"


My advice to others is not to pay attention to anything but the man
page, checking one by one each option you used in the old configuration,
if it still exists, if it was replaced and finally *where* to pass it,
if to match or to action. Doing it in that order you'll probably go
faster. :-)

As you see above I had to replace "sender" for "mail-from" and to create
a third action to pass the virtual aliases table that in the first
attempt I'd wrongly included it in the match.

No comments:

Post a Comment