procmail
[Top] [All Lists]

Re: Redirection help

2005-10-19 05:50:19
On Tue, Oct 18, 2005 at 09:39:55PM -0700, David Sun wrote:
All,

I'm trying to put together a recipe that will take an
e-mail matching my filter criteria, replace the From:
line with another address, and forward it on to a
different address unchanged.  

I put together this recipe: 

:0 h c
* ^Subject:.*test
     | (formail -k -X Subject:) | $SENDMAIL
-fJoe(_at_)foo(_dot_)bar new(_at_)newplace(_dot_)com 

and the formail part seems to work fine from command
line but when invoked within the recipe, I do NOT get
the body of the message, only the header.  Any ideas?

You have invoked the 'h' flag.  The 'h' flag says,
"throw away the body and use only the head"!  Get rid
of the 'h' flag.

You also probably want to guard against looping mail,
e.g., via an X-Loop header.  (See man pages.)

For bonus points, I'd like to get the original From:
line (or at least the sender address) prepended to the
body so people can see where the message originally
came from.

If the body is ever MIME, this is going to be tough.
If the body is ever only text, we can do it, but I
need more coffee.  :-)


Also, I get a warning in the message header when
recieved by another system.  Any ideas of this will
cause messages to be dropped?

Use the -f switch with $SENDMAIL, assuming you system
supports it -- assuming that's the warning you're talking
about.  "Dropped" would depend on the other system's
setup, wouldn't it?  I see nothing to imply default
dropping, if I've understood you correctly about the
warning message.

-- 
dman

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>