currHeader not working
am 05.01.2008 12:02:30 von trbosjek
Hello,
I'm trying to use $&{currHeader} on RHS of a rule.
When I test it with:
$ /usr/sbin/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter
> TheRule something@somewhere
rewrite: ruleset 184 input: something @ somewhere
rewrite: ruleset 184 returns:
....returns nothing.
As for the sendmail version, with -d0.1 switch I get the following:
Version 8.9.3 (PHNE_34936)
Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
NAMED_BIND NDBM NETINET NETUNIX NEWDB NIS NISPLUS
QUEUE SCANF
SMTP USERDB XDEBUG
Am I doing something wrong or is it a wrong version I'm using? Or
something else...?
Re: currHeader not working
am 05.01.2008 21:19:36 von Bill Cole
In article
<226723d4-b6cb-490e-a678-9da735a65984@i12g2000prf.googlegroups.com>,
trbosjek wrote:
> Hello,
>
> I'm trying to use $&{currHeader} on RHS of a rule.
> When I test it with:
>
> $ /usr/sbin/sendmail -bt
> ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
> Enter
> > TheRule something@somewhere
> rewrite: ruleset 184 input: something @ somewhere
> rewrite: ruleset 184 returns:
>
> ...returns nothing.
Without knowing what your special ruleset is and how it tries to use
$&{currHeader}, no one will be able to help you in any specific way.
However, I don't see how you expect to test anything involving
message-specific macros using sendmail -bt without manually defining the
values for the macros you expect to use. The ${currHeader} macro is only
defined when Sendmail is running a header-checking ruleset, and it
contains the full raw text of the header. The header-checking ruleset
itself is not passed an address (the "normal" input for ruleset testing)
but rather the header being checked *after* it has been passed through a
filter to strip RFC822 comments and redundant spaces. I don't see any
way that passing a header-checking ruleset a simple bare address as you
do above can ever match real usage, and if you don't define
${currHeader} or any other message-specific macros manually, you will
not have them in a test.
> As for the sendmail version, with -d0.1 switch I get the following:
>
> Version 8.9.3 (PHNE_34936)
> Compiled with: LDAPMAP MAP_REGEX LOG MATCHGECOS MIME7TO8 MIME8TO7
> NAMED_BIND NDBM NETINET NETUNIX NEWDB NIS NISPLUS
> QUEUE SCANF
> SMTP USERDB XDEBUG
>
> Am I doing something wrong or is it a wrong version I'm using? Or
> something else...?
Version 8.9.3 is a dangerously obsolete version of sendmail. It may not
support the ${currHeader} macro at all, and it really is not worth
anyone's effort to look that up. If the machine you are running this on
has exposure to any potentially malicious mail your top priority in
regards to sendmail should be to upgrade to a modern version.
--
Now where did I hide that website...