Re: SRS implemenation in sendmail

Mark <[email protected]>
Newsgroups gmane.mail.spam.srs.general
Organization Asarian-host
Message-ID <[email protected]>
Tom Lahti wrote:

> What I don't see is the purpose of
>
> } elsif ($use_address =~ /^\|/) {
>      print "\"$old_address\"\n";
>
> in that script.

When you have defined a "piped" alias, like so:

    test: "| /usr/local/bin/perl /scripts/whatever.pl"

The space-laced address needs to be requoted on return. That is what the
extra check + output does.

> Also, if we send $f to srs2envtol.pl does it include
> the brackets <> ?

No.

> sendmail.cf:
> ---------------------------------------------------------
> SParseLocal=98
>
> # always call reverse_srs
> R$*                             $@ $(reverse_srs $1 $f $)
> ---------------------------------------------------------

I am pretty sure you did not test your code; $f needs to be dereferenced
here, and should be written as $&f instead.

> patch srs2envtol.pl:
>
>   my $old_address = $ARGV[0];
> +my $envelope_sender = $ARGV[1];

This will not work either. If you parse both variables to the reverse_srs
macro, you will need to split the one $ARGV[0], as follows:

my ($old_address, $envelope_from) = split (/ /, $ARGV[0], 2);

(this, btw, may look strange, as you would expect two args; but if you look
at the above piped alias example, sendmail's rationale becomes clear: what
we would generally regard as multiple, space-separated args, in reality is
likely just one arg: a recipient with spaces).

The principle of parsing $f is sound, of course. Indeed you could make the
determination from that whether we have an empty envelope-from + no SRS
signature. By then setting the recipient to "/dev/null" you could indeed
blackhole the email.

- Mark

        System Administrator Asarian-host.org

---
"If you were supposed to understand it,
we wouldn't call it code." - FedEx
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.