When writing a sendmail.mc rule, you can use some operators on the left hand side, like $- (match exactly one token), $+ (match one or more tokens) and $* (match zero or more tokens). You may find yourself in a situation where for example you want to use a certain delivery agent for some of your users. Normally you would write something like the following:
LOCAL_CONFIG Kmitsos btree -m -a.mitsos /etc/mail/mitsosusers LOCAL_RULE_0 : R$- < @ $=w . > $* $: $(mitsos $1 $) $3 R$- . mitsos $* $#mitsos $: $1
The above example seems to be correct, right? But what if you have a user in mitsosusers that contains a dot (.) in the user name (for example yiorgos.adamopoulos)? Because the . is a token separator (see the OperatorChars definition in your sendmail.cf), $- will not match the name. So the correct ruleset in this case is:
R$+ < @ $=w . > $* $: $(mitsos $1 $) $3 R$+ . mitsos $* $#mitsos $: $1
I got bitten by this sometime ago, and that is why I am sharing it.
Fuck it, use postfix, btw check out ./ about the nosql crowd !
:)
I was using an alpha version of Postfix 10+ years ago, right after being renamed to Postfix from VMailer.
I am very fond of it, and even recommend it for new installations when asked, but switching to it? That would take considerable effort for our infrastructure.
Plus, I highly doubt that many people write local rulesets anymore, which makes a default .mc configuration as easy as 7 lines:
VERSIONID(`some info here’)dnl
DOMAIN(`generic’)dnl
OSTYPE(`openbsd’)dnl
FEATURE(`no_default_msa’)dnl
DAEMON_OPTIONS(`Name=MTA, Port=smtp’)dnl
MAILER(`local’)dnl
MAILER(`smtp’)dnl
(or use sendmail.conf and sendmailconfig in Debian and so on…)
[ Thanks for the /. pointer; I’ve seen that it references my own post ]