Need help with sendmail / procmail
Need help with sendmail / procmail
am 11.02.2007 04:17:45 von jachall
Hello:
I am having an issue with sendmail & procmail. I'm writing a user
procmail recipe (.procmailrc) to handle email forwarding, and I need
to maintain the envelope sender, just like the .forward file does.
The issue is that in the procmail recipe, if I use either the
"$SENDER" or "$1" variables, they contain no values (they're blank).
I am stumped, am I totally missing something here? I have read all
over and I have not been able to find out what might cause this to
happen.
I'm running on a Red Hat 7.2 system but using sendmail 8.13.6 and
procmail 3.21. Procmail itself is working fine except for this issue
with the variables.
Can anybody help??? Thank you very much...
--
Chris
Re: Need help with sendmail / procmail
am 11.02.2007 07:35:34 von Garen Erdoisa
In article <1171163865.277008.134360@h3g2000cwc.googlegroups.com>,
jachall wrote:
> Hello:
>
> I am having an issue with sendmail & procmail. I'm writing a user
> procmail recipe (.procmailrc) to handle email forwarding, and I need
> to maintain the envelope sender, just like the .forward file does.
> The issue is that in the procmail recipe, if I use either the
> "$SENDER" or "$1" variables, they contain no values (they're blank).
> I am stumped, am I totally missing something here? I have read all
> over and I have not been able to find out what might cause this to
> happen.
Sendmail normally does not normally pass those variables to procmail by
default.
The envelope sender is normally put into the Return-Path: header. However
if the sender provides the Return-Path: header in the SMTP message body
during the SMTP transaction, then sendmail will not overwrite it.
If the header is absent, then sendmail will normally insert that header
prior to the handoff to procmail.
You may be able to extract it from the Berkley mailbox format From header
(the one without the colon). Procmail can see that header, but normally it
will not be visible to an email client.
>
> I'm running on a Red Hat 7.2 system but using sendmail 8.13.6 and
> procmail 3.21. Procmail itself is working fine except for this issue
> with the variables.
>
Try a simple recipe with procmail to see what it sees in those headers:
LOGFILE=${HOME}/procmail.log
NL="
"
# Look for the Berkley mailbox From header used
# internally as a message separator.
:0
* ^()\/From .*
{
FROMHEADER="${MATCH}"
LOG="[$$]$_: FROMHEADER=${FROMHEADER} ${NL}"
}
:0 E
{ LOG="[$$]$_: No From header found.${NL}" }
:0
* ^()\/Return-Path: .*
{
RETURNPATHHEADER=${MATCH}
LOG="[$$]$_: RETURNPATHHEADER=${RETURNPATHHEADER}${NL}"
}
:0 E
{ LOG="[$$]$_: No Return-Path: header found.${NL}" }
> Can anybody help??? Thank you very much...
>
--
Garen
Re: Need help with sendmail / procmail
am 11.02.2007 08:22:49 von Kari Hurtta
[ Added comp.mail.sendmail as recipient ]
Garen Erdoisa writes in comp.mail.misc:
> The envelope sender is normally put into the Return-Path: header. However
> if the sender provides the Return-Path: header in the SMTP message body
> during the SMTP transaction, then sendmail will not overwrite it.
Are you sure?
$ fgrep -i Return-Path conf.c
{ "return-path", H_FORCE|H_ACHECK|H_BINDLATE, NULL },
$
/ Kari Hurtta
Re: Need help with sendmail / procmail
am 11.02.2007 09:47:45 von anfi
Garen Erdoisa writes:
> In article <5dslddgnue.fsf@Hurtta06k.keh.iki.fi>, Kari Hurtta wrote:
>> [ Added comp.mail.sendmail as recipient ]
>>
>> Garen Erdoisa writes in comp.mail.misc:
>>
>>> The envelope sender is normally put into the Return-Path: header. However
>>> if the sender provides the Return-Path: header in the SMTP message body
>>> during the SMTP transaction, then sendmail will not overwrite it.
>>
>> Are you sure?
>
> It's something I've tested in the past (few years back) by telneting to my
> own SMTP server and submitting messages directly to the server to see how it
> reacted under various circumstances.
>
> Since you challenged the statement, I just tried duplicating this
> behavior again, and found that sendmail is replacing the return path
> header given in the SMTP message body DATA with the envelope sender data.
> So somewhere along the line that behavior changed. I stand corrected.
>
> Interesting...
SENDMAIL RELEASE NOTES
[...]
8.2/8.2 1993/07/11
[...]
Fix problem that causes old Return-Path: line to override new
Return-Path: line (conf.c needs H_FORCE to avoid
re-using old value). From Motonori Nakamura.
> [...]
--
[pl>en: Andrew] Andrzej Adam Filip : anfi@priv.onet.pl : anfi@xl.wp.pl
Before You Ask: http://anfi.homeunix.net/sendmail/B4UAsk-Sendmail.html
http://anfi.homeunix.net/sendmail/ [orkut,linkedin,xing]