Hello!
I have a requirement to check the Cc field for a given list of addresses
which, if found, should be appended to the To: field.
Here's how my recipe currently works:
:0
* ^To:(.*\<)\/[^ ].*
{ TO=$MATCH }
:0
* LOGNAME ?? (POP_ACCOUNT_1| POP_ACCOUNT_2)
*^(Cc):.*(\<user1(_at_)someserver\(_dot_)com)
{
:0 hfw
| /opt/local/bin/formail -i "To: $TO; user1(_at_)someserver\(_dot_)com"
}
The above recipe works just fine as long as I have a single Email
address being searched for in the Cc field. However, if I were to extend
this recipe to check for more than 1 address in the Cc field, I don't
know how to find out which address matched in the Cc condition in order
to be able to add that specific matched address to the To field.
Below is what I want to do.
:0
* ^To:(.*\<)\/[^ ].*
{ TO=$MATCH }
:0
* LOGNAME ?? (POP_ACCOUNT_1| POP_ACCOUNT_2)
*^(Cc):.*(\< user1(_at_)someserver\(_dot_)com|\<
user2(_at_)someserver\(_dot_)com|\<
user3(_at_)someserver\(_dot_)com|\< user4(_at_)someserver\(_dot_)com)
{
:0 hfw
| /opt/local/bin/formail -i "To:
$TO;<EMAIL_ADDRESS_THAT_MATCHED_IN_CC_FIELD>"
}
I can't use the $MATCH variable since I can't use the RegEx operator \/
in this scenario. Can I?
Question: How do I find out which of the above 4 addresses matched in
the Cc condition?
Thanks and regards,
Komal
------------------------------------------------------------------------
------------------------------------------------------------------------
------------------
This email may contain confidential and privileged material for the sole
use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply email and delete all copies of this message.
For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
____________________________________________________________
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