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

client_addr macro sometimes null ???

11 views
Skip to first unread message

Andy Harper

unread,
Jan 29, 1999, 3:00:00 AM1/29/99
to
I've set up a ruleset to match the Message-Id: header line, along these lines:

HMessage-ID: $>CheckMessageID
SCheckMessageId
R .... use of $&{client_addr}

Under apparently random conditions, the value of $&{client_addr} is the null
string at this point (the very first rule in the ruleset!), resulting in the
ruleset misbehaving. I'ld be grateful if anyone has any suggestions - is this
a bug in sendmail ? If so, is there a fix?

This is sendmail 8.9.2 on solaris 2.6.1 compiled with gcc 2.8.1

Thanks

Andy Harper
Kings College London

Andrzej Filip

unread,
Jan 29, 1999, 3:00:00 AM1/29/99
to
Andy Harper wrote:

Based on sendmail 8.8.7+
${client_addr} is not stored in queue files, so its value is lost
after connection has been terminated.
It is available in check_mail, check_rcpt and check_relay.

You may try to recover client address from $_ which is
stored in queue files.
My sendmail stores IP address of sending host in square
brackets t the end of $_
--
Andrzej (Andrew) A. Filip
home e-mail: an...@polbox.com

Andrzej Filip

unread,
Jan 30, 1999, 3:00:00 AM1/30/99
to
*** I think it works for V8.7 and above ***
*** It depends on exact format of $_ ***

Below please find rule set which should
produce [in my opinion :-) ] client ip
address based on ${client_addr} and
when that fails on $_ [ident info]
usage:
R$* $: $>Get_client_addr $1
R<10.0.0.$->$* $@ ok


SGet_client_addr
# try $&{client_addr} first
R$* $: <$&{client_addr}>$1
R<$+>$* $@ <$1>$2
# try to get info from $&_ (ident info)
R<$*>$* $: <$&_>$2
R<$*[$-.$-.$-.$-]>$* $@ <$2.$3.$4.$5>$6
# no success - usually means non tcp delivery
# ( local, uucp ...)
R<$*>$* $@ <> $2

--
Andrzej (Andrew) A. Filip
home e-mail: an...@polbox.com

Andrzej Filip

unread,
Feb 1, 1999, 3:00:00 AM2/1/99
to
Corrected version:

SGet_client_addr
# try $&{client_addr} first

R$* $: <$(dequote "" $&{client_addr} $)>$1


R<$+>$* $@ <$1>$2
# try to get info from $&_ (ident info)

R<$*>$* $: <$(dequote "" $&_ $)>$2

0 new messages