I would like to store e-mails sent by me to others using the "From" field to a folder called "/sent"
So, I use:
:0:
*^From.*[email protected]
$HOME/Mail/sent/.
And it used to work fine. However, now I am also forwarding my e-mail from the address:[email protected], what is happending is that the e-mail envelope contains the header: Resent-From.*[email protected] 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 *[email protected], then it should go to the sent-folder. In other words, is it possible to use a AND or OR or Negation condition.
Update: The provided solution is correct. I was making an error in that I had neglected the ":". Thanks for both the solution and the patience. I also learnt a number of things and about a number of resources, for which also I am grateful,
Thanks!
Procmail by default does exactly what you ask. Multiple conditions will be ANDed together. The first one which fails causes the recipe to be abandoned; if they all succeed, the action is taken.
Notice also how I modified your regex to tighten it up.
To do NOT, add a
!in front of the condition. To do OR, you can negate both conditions, and take the action in the "else" part (de Morgan's law).Of course, if both conditions are regular expressions, you can simply use the regex or operator.