procmail
[Top] [All Lists]

Re: adding 'f' to :0w breaks things? odd!

2000-08-24 12:56:19
I don't think you need to add a 'f' flag when forwarding a message.
Does your perl script print to STDOUT?



On Thu, 24 Aug 2000, cory wrote:

All the documentation I've read has said to use 'f' when filtering /
using pipes, but when I do so in the following .rc then things break.

The following acts as an email relay (any mail from a user claiming to
be cory(_at_)nortelnetworks(_dot_)com with xxx: username(_at_)here can send 
mail as
though it came from cory(_at_)olga(_dot_)net -- don't worry, there's some
security involved).

Note that I am a procmail novice -- please be gentle.

:0
* ^From:[      ]*(_dot_)*cory(_at_)nortelnetworks\(_dot_)com
* ^Subject:[   ]*.*xxx:
{
 :0
 { RULE="Forwarding message from cory(_at_)nortelnetworks(_dot_)com(_dot_)" }

 :0 w ***
 | $METAMAIL  \
 | $FORMAIL -k -X From: -X Subject: \
 | $PERL $HOME/Procmail/n2w.pl | $SENDMAIL $SENDMAILFLAGS -t
}

:0
* !^From:[       ]*(_dot_)*cory(_at_)nortelnetworks\(_dot_)com
* !^FROM_MAILER
* !^FROM_DAEMON
{
 :0
 { RULE="Forwarding message to cory(_at_)nortelnetworks(_dot_)com(_dot_)" }

 :0 wc ***
 | $METAMAIL  \
 | $FORMAIL -k -X From: -X Subject: \
 | $PERL $HOME/Procmail/w2n.pl | $SENDMAIL $SENDMAILFLAGS -t
}

When adding 'f' to both locations marked '***', somehow both RULE
assignments occur.  Here is the log file (with both 'f's), trimmed:

procmail: Match on "^From:[    ]*(_dot_)*cory(_at_)nortelnetworks\(_dot_)com"
procmail: Match on "^Subject:[         ]*.*To:"
procmail: Assigning "RULE=Forwarding message from 
cory(_at_)nortelnetworks(_dot_)com(_dot_)"
procmail: Executing " $METAMAIL  \
 | $FORMAIL -k -X From: -X Subject: \
 | $PERL $HOME/Procmail/n2w.pl | $SENDMAIL $SENDMAILFLAGS -t"
Warning: Cannot freopen /dev/tty to stdin
procmail: Match on ! "^From:[       
]*(_dot_)*cory(_at_)nortelnetworks\(_dot_)com"
procmail: Match on ! "(^(((Resent-)?...
procmail: Match on ! "(^(Mailing-List:...
procmail: Assigning "RULE=Forwarding message to 
cory(_at_)nortelnetworks(_dot_)com(_dot_)"
procmail: Extraneous copy-flag ignored
procmail: Executing " $METAMAIL  \
 | $FORMAIL -k -X From: -X Subject: \
 | $PERL $HOME/Procmail/w2n.pl | $SENDMAIL $SENDMAILFLAGS -t"
Warning: Cannot freopen /dev/tty to stdin
procmail: Locking "/var/spool/mail/cory.lock"
procmail: Assigning "LASTFOLDER=/var/spool/mail/cory"
procmail: Opening "/var/spool/mail/cory"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/spool/mail/cory.lock"
 Folder: /var/spool/mail/cory                                              40
procmail: Notified comsat: "cory(_at_)11773:/var/spool/mail/cory"

I'd appreciate any input.  Also, I believe those 'Warning' lines occur
from calling metamail without any flags.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail