procmail
[Top] [All Lists]

Re: Problem with modification of the Email subject

2007-06-13 14:28:50
On Wed, Jun 13, 2007 at 01:25:54PM -0400, Alex Kosach wrote:

I am trying to modify subject line of incoming emails by
inserting special variables. However, all emails still have the
original email subject when they arrive, but the header of the
email shows the subject line as I want it to be.


Microsoft Mail Internet Headers Version 2.0
Content-Type: multipart/report; report-type=delivery-status;
      boundary="l57JUfC3025865.1181244680/server.domain.com"
Auto-Submitted: auto-generated (failure)
Subject: {My Text}  {Original Text}
Return-Path: my email


I use the following procmail recipe 


:0
 * ^From.*(MAILER-DAEMON|info@|mail[0-9].)
{
  :0 fwh
   | ${FORMAIL:-formail} -I"Subject: ${REASON} ${SUBJ_}"
  :0
  !my email
}

I'm not entirely sure I understand what you are describing.
I see a likely problem and something you may be making overly
complicated, though.

First of all, why are you sending the altered message back
into the (I presume, local) SMTP server?  Why not just drop
it in your local mailbox?

Second of all, you really need to employ an X-Loop header
if you are going to look for messages using unanchored regexes
and then send the messages to yourself again.  Otherwise, you
will end up with a nasty mail loop and, in all likelihood,
bring your server to its knees.  (I suppose that alternatively,
here, you could reject based on the presence of $REASON
in the Subject instead of using an X-Loop.)

Does anybody have an idea why this happens? 

What do your verbose logs show?

Dallman
____________________________________________________________
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