Re: SRS sendmail integration

"Stuart D. Gathman" <[email protected]>
Newsgroups gmane.mail.spam.srs.general
Message-ID <[email protected]>
On Wed, 24 Mar 2004, Mark wrote:

> Good question. ;) Seriously, though, as I suspected, m4 does not provide
> such fine-grained control. I asked, to be sure, and got word from Claus
> Assman today, saying this is, indeed, not possible (if proto.m4 does does
> provide the hook either; but editing proto.m4 leaves us exactly where
> editing sendmail.cf leaves us). He said that when he himself was faced with
> such a situation, that he just uses a patch file against the newly created
> cf.

I fixed the EnvFromSMTP - and I'm not even an m4 expert!  m4 uses redirections,
so I changed pysrs.m4 like this:

diff -c -r1.2 pysrs.m4
*** pysrs.m4    24 Mar 2004 01:03:21 -0000      1.2
--- pysrs.m4    24 Mar 2004 22:03:44 -0000
***************
*** 32,41 ****
  F{noSrsMailers}-o NO_SRS_FILE %[^\#]
  ')dnl
  
! LOCAL_RULESETS
  
  SEnvFromSMTP
  R$+           $: $>MakeSrs $1         make SRS
  
  SIsSrs
  # Answers YES or NO whether the address in parameter is srs or not
--- 32,43 ----
  F{noSrsMailers}-o NO_SRS_FILE %[^\#]
  ')dnl
  
! MAILER_DEFINITIONS
  
  SEnvFromSMTP
  R$+           $: $>MakeSrs $1         make SRS
+ 
+ LOCAL_RULESETS
  
  SIsSrs
  # Answers YES or NO whether the address in parameter is srs or not


As a finishing touch, I can check that HACK(pysrs) comes after the smtp mailer
by checking that _MAILER_DEFINED_ is defined.

This, however, leaves ParseLocal as follows:

SParseLocal=98

# addresses sent to [email protected] will give a 551 error code
R$* < @ $+ .REDIRECT. >		$: $1 < @ $2 . REDIRECT . > < ${opMode} >
R$* < @ $+ .REDIRECT. > <i>	$: $1 < @ $2 . REDIRECT. >
R$* < @ $+ .REDIRECT. > < $- >	$#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>

SParseLocal=98
R$*				$: $>ReverseSrs $1

This can be fixed by providing a feature which does

LOCAL_RULESET_0
R$*				$: $>ReverseSrs $1

and must come before redirect.

However, is this really necessary?  It looks like adding REDIRECT has
already been done before entering ParseLocal. And the ReverseSrs would
not do anything in that case.  On the other hand, if REDIRECT has *not*
been added, then ReverseSrs will work normally.

-- 
			Stuart D. Gathman <[email protected]>
      Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
      "Very few of our customers are going to have a pure Unix
      or pure Windows environment." - Dennis Oldroyd, Microsoft Corporation
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.