[prev in list] [next in list] [prev in thread] [next in thread] 

List:       procmail
Subject:    Re: CC: results in extra copy of message when forwarding
From:       "Gerald V. Livingston II" <debuser () sysmatrix ! net>
Date:       2007-02-24 0:16:24
Message-ID: E1HKl1n-0000jd-00 () phorce1 ! sytes ! net
[Download RAW message or body]

Please reply to list messages on list for the archives.

On Fri, 23 Feb 2007 17:49:52 -0500 Patrick Baldwin
<Patrick.Baldwin@studsvikscandpower.com> wrote:

> Gerald V. Livingston II wrote:
> 
> > On Fri, 23 Feb 2007 11:45:06 -0500 Patrick Baldwin
> > <Patrick.Baldwin@studsvikscandpower.com> wrote:
> > 
> 
> <SNIP>
> 
> >>I'm forwarding a copy of a user's email to gmail.
> > 
> > 
> > Actually, you are piping the entire message (including all original
> > headers) with a changed "To:" header and added "X-Loop:" header back to
> > sendmail for delivery.
> 
> Sorry, I'll try and be more specific next time.
> 
> > Note the (including ALL original headers) and be VERY glad you paid
> > attention during the "X-Loop:" part of procmail class.
> 
> Oh, if only there had been "procmail class", and not just me, Google,
> and procmail.
> 
> 
> >>This seems to be working fine, except when someone
> >>sends something CC: instead of To:, there ends up
> >>being 2 copies of the email in his local INBOX.
> > 
> > 
> > [...]
> > 
> > 
> >>The other copy has a To: line containing
> >>the gmail address we're forwarding to, and
> >>the same CC: line as the first copy.
> >>
> >>The procmail file:
> > 
> > 
> > [...]
> > 
> > 
> >>:0c
> >>* !^FROM_DAEMON
> >>* !^FROM_MAILER
> >>* !^X-Loop: to_gmail
> >>| (formail -t -I"To: the.traveller.in.black@gmail.com" \
> >>                -A"X-Loop: to_gmail" \
> >>   ) | $SENDMAIL -t
> > 
> > 
> > What you have pipes the original message with a new To: header and the
> > original Cc: header. So, it gets Cc:'d again. 
> 
> 
> OK, that makes sense.
> 
> > If you'd missed out on adding the X-Loop: you'd get a lot more than one
> > extra copy.
> > 
> > Try this:
> > 
> > |(formail -i"Cc:" -I"To: the.traveller.in.black@gmail.com"\
> >                 -A"X-Loop: to_gmail"
> >   ) |$SENDMAIL -t
> > 
> > -i will preserve the old Cc: header as "Old-Cc:". Use -I if you just want
> > to drop the Cc: header.
> > 
> 
> Do you have any suggestions as to which approach would be best?
> I don't see any particular reason to retain the Cc: header, but
> perhaps I'm missing something.

Neither is "best". It's personal choice. But since you are moving a copy
outside the system you may want to know who it was originally addressed and
CC'd to just by viewing the headers. If you change the " -ITo: the..." to "
-iTo: the..." you would also preserve the original "To:" header as
"Old-To:"

Gerald

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic