Re: OT: help conditioning on multiple fields using procmail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Ranjan Maitra wrote:
> This is an OT question, but one that I am sure someone
> here will likely know the answer to, given how much help I
> have received here on such questions in the past.

I don't think it's off-topic, as procmail is included in
Fedora and used by plenty of folks here.  Granted, there are
probably forums with more procmail users and experts than
this one.

> So, I  store e-mails sent by me to others using the "From"
> field to a folder called "/sent"
>
> So, I use in my .procmailrc:
>
> :0:
> *^From.*user@xxxxxxxxxxx
> $HOME/Mail/sent/.
>
> And it used to work fine. However, recently I have also
> started forwarding my e-mail from the address:
> user@xxxxxxxxxxx and what is happening is that the e-mail
> envelope of every forwarded message now contains the
> header: Resent-From.*user@xxxxxxxxxxx so all forwarded
> e-mail is being saved to the sent folder.
> 
> Is it possible to have a double condition? That is
> something that says that if both Resent-From and From have
> *user@xxxxxxxxxxx, then it should go to the sent-folder.
> In other words, is it possible to use a AND or OR or
> Negation condition.

Conditions are AND'ed by default, so if you want to only
match messages which have both From and Resent-From headers,
you can add another condition to your recipe:

    :0:
    * ^From.*user@xxxxxxxxxxx
    * ^Resent-From:.*user@xxxxxxxxxxx
    $HOME/Mail/sent/.

The procmailrc and procmailex manpages are worth reading
over if you haven't done so in a while. :)

-- 
Todd

Attachment: signature.asc
Description: PGP signature

_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
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@xxxxxxxxxxxxxxxxxxxxxxx
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux