Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to add rules in Ruleset MAILER_DEFINITIONS & SEnvFromSMTP using m4 ?

166 views
Skip to first unread message

j...@artech.net

unread,
Feb 18, 2019, 8:17:03 PM2/18/19
to
Hi,

Using this minimal sendmail.mc:

divert(-1)dnl
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl # make -C /etc/mail
dnl #
divert(0)dnl
include(`/usr/src/sendmail-8.15.2/cf/m4/cf.m4')dnl
VERSIONID(`setup for Red Hat Linux')dnl
OSTYPE(`linux')dnl
MAILER(smtp)dnl
dnl
MAILER(procmail)dnl
dnl #
HACK(`srs',`/var/run/milter/socketmapd.sock')dnl

in srs.m4:


MAILER_DEFINITIONS
SEnvFromSMTP
R$+ $$ >MakeSrs $1 make SRS MAILER





-> give two lines of SEnvFromSMTP in my cf file, but want only add a row at end of previous defined SEnvFromSMTP from smtp.m4, like below:


#
# envelope sender rewriting
#
SEnvFromSMTP
R$+ $: $>PseudoToReal $1 sender/recipient common
R$* :; <@> $@ list:; special case
R$* $: $>MasqSMTP $1 qualify unqual'ed names
R$+ $: $>MasqEnv $1 do masquerading
R$+ $: $>MakeSrs $1 make SRS MAILER

Can't figure out how to do that in srs.m4 file.
Find a old ref to http://www.harker.com/sendmail/adding-to-rulesets.html
But divert(8) is now a part of sendmail m4.

//Jan


Claus Aßmann

unread,
Feb 18, 2019, 8:41:50 PM2/18/19
to
Jan wrote:

> MAILER_DEFINITIONS
> SEnvFromSMTP
> R$+ $$ >MakeSrs $1 make SRS MAILER


Please see cf/README about the purpose of MAILER_DEFINITIONS:

Sometimes you may need to add entirely new mailers or rulesets. They
should be introduced with the constructs MAILER_DEFINITIONS and
LOCAL_RULESETS respectively. For example:

MAILER_DEFINITIONS
Mmymailer, ...
...

LOCAL_RULESETS
Smyruleset
...

> -> give two lines of SEnvFromSMTP in my cf file, but want only add a row at end of previous defined SEnvFromSMTP

I already answered your question in another thread by pointing to
the documentation (doc/op.*), didn't I?

5.1. R and S -- Rewriting Rules
...
Sets the current ruleset being collected to n. If you
begin a ruleset more than once it appends to the old
definition.

--
Note: please read the netiquette before posting. I will almost never
reply to top-postings which include a full copy of the previous
article(s) at the end because it's annoying, shows that the poster
is too lazy to trim his article, and it's wasting the time of all readers.
0 new messages