Thank you all for your suggestions. I am a little lost because none of them 
have done what I want to do. So, let me explain what I am trying to do.

I am getting all my e-mail forwarded from u...@outlook.com to another e-mail 
address, say: u...@gmail.com.

I send myself outgoing e-mails (BCc'ed). These all come from the same e-mail 
address, that is mine.

Almost all forwarded e-mails have a Resent-From: field set to be: 
u...@outlook.com in the mail envelope. However, not all of them. Some of these 
e-mails (appears to be the ones sent within my organization) do not have this 
field even though they are also forwarded.

I want to use procmail to store all the mails (and only those e-mails) with the 
From: u...@outlook.com to my $HOME/Mail/sent folder.

How do I do this? I don't know if this matters but I use: 'procmail -d %s' when 
procmail is invoked by my fetchmail.

Many thanks and best wishes,
Ranjan







On Mon, 23 Dec 2019 22:55:25 -0600 Ranjan Maitra <mai...@email.com> wrote:

> Thank you for your help and in detailing the process. Adding the colon to the 
> From: does not prevent e-mail having the Resent-From set at the same e-mail 
> address.
>
> I am trying out your other suggestion.
>
> Thanks again!
>
> Best wishes,
> Ranjan
>
>
> On Tue, 24 Dec 2019 12:09:38 +0900 "Stephen J. Turnbull" <st...@xemacs.org> 
> wrote:
>
> > Ranjan Maitra writes:
> >
> >  > So, I use in my .procmailrc:
> >  >
> >  > :0:
> >  > *^From.*u...@outlook.com
> >  > $HOME/Mail/sent/.
> >  >
> >  > And it used to work fine. However, recently I have also started
> >  > forwarding my e-mail from the address: u...@outlook.com and what is
> >  > happening is that the e-mail envelope of every forwarded message
> >  > now contains the header: Resent-From.*u...@outlook.com so all
> >  > forwarded e-mail is being saved to the sent folder.
> >
> > Based on your report, one possibility is that your recipe is catching
> > the "Unix From" line (also called "envelope From line"), which has the
> > form
> >
> > From <optional stuff> u...@wherever.dom <optional stuff>
> >
> > and is prepended to emails saved in so-called mbox format.  (This is
> > not part of the RFC 5322 Internet Message Format.  It is specific to
> > the way mail is handled locally by *some* configurations of *some*
> > message delivery agents.  It is not normally displayed by mail
> > clients.)  If this is the case, changing the recipe to
> >
> > :0:
> > *^From:.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > (change is colon after From) should catch only messages with an RFC
> > 5322 From "u...@outlook.com".
> >
> >  > Is it possible to have a double condition? That is something that
> >  > says that if both Resent-From and From have *u...@outlook.com, then
> >  > it should go to the sent-folder. In other words, is it possible to
> >  > use a AND or OR or Negation condition.
> >
> > I'll answer the question, but first I gotta preach. ;-)  When you
> > don't understand the problem, it is bad practice to ask questions in
> > the form "how do I do ...", because respondents are likely to focus on
> > the how of doing what you specifically asked, not on solving your
> > problem.  That's OK in some sense, you'll learn something, but it's
> > likely to be frustrating when you do what you're told and it doesn't
> > solve the underlying problem.
> >
> > To AND conditions:
> >
> > :0:
> > * ^From:.*u...@outlook.com
> > * ^Resent-From:.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > and BOTH conditions must match the header of the email.  To OR
> > conditions, use separate recipes.
> >
> > :0:
> > * ^From:.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > :0:
> > * ^Resent-From:.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > and if either condition matches the header of the mail, the mail will
> > be saved in $HOME/Mail/sent/. .  Most procmail recipes terminate
> > processing on match, so order can matter (but does not in this case
> > because there are no side effects and the action is the same).  To
> > NEGATE a condition, use ! in the recipe:
> >
> > :0:
> > * ! ^Resent-From:.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > sending anything NOT Resent-From u...@outlook.com to .../sent/.
> >
> > The recipe that MIGHT do what you want if the colon suggestion doesn't
> > work:
> >
> > :0:
> > * ^From.*u...@outlook.com
> > * ! ^Resent-From.*u...@outlook.com
> > $HOME/Mail/sent/.
> >
> > (look Ma, no colons!, and the Resent-From condition is negated).
> >
> > HTH
> >
> > Steve
> > XEmacs Project
> > GNU Mailman Project
> > _______________________________________________
> > users mailing list -- users@lists.fedoraproject.org
> > To unsubscribe send an email to users-le...@lists.fedoraproject.org
> > Fedora Code of Conduct: 
> > https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> > List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> > List Archives: 
> > https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
>
>
> --
> Important Notice: This mailbox is ignored: e-mails are set to be deleted on 
> receipt. Please respond to the mailing list if appropriate. For those needing 
> to send personal or professional e-mail, please use appropriate addresses.
> _______________________________________________
> users mailing list -- users@lists.fedoraproject.org
> To unsubscribe send an email to users-le...@lists.fedoraproject.org
> Fedora Code of Conduct: 
> https://docs.fedoraproject.org/en-US/project/code-of-conduct/
> List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
> List Archives: 
> https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org


--
Important Notice: This mailbox is ignored: e-mails are set to be deleted on 
receipt. Please respond to the mailing list if appropriate. For those needing 
to send personal or professional e-mail, please use appropriate addresses.
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org

Reply via email to