procmail
[Top] [All Lists]

Re: AND and OR recipe?

2010-11-17 14:40:27
At 10:45 2010-11-17, Danny wrote:
The whole family recives mail from Facebook (like all I suppose)

No, not everyone is on facebook.

If it comes from Facebook (in the From: field) AND it is addressed to
dannydebont[AT]gmail[DOT]com (in the To: field) it must go to it's folder

:0:
* ^From:(_dot_)*(_at_)facebookmail\(_dot_)com
* ^To:(_dot_)*dannydebont(_at_)gmail\(_dot_)com
its_folder

# if those conditions matched, the message will have been delivered and
# processing never reaches this point

:0:
* ^To:(_dot_)*dannydebont(_at_)gmail\(_dot_)com
another_folder

# anything that remains will be delivered to $DEFAULT (say, messages where
# you are cc'd or bcc'd, or if you have other addresses which deliver into
# your gmail account or to the account where you're running procmail).

In other words, if it comes from Facebook AND is addressed to me it must go to
"facebook" foder ALL other that is addressed to me must go to "inbox" folder.

Where do messages go which you receive but where you're not cleartexted in the To: (say, lists, or when you're CC'd or Bcc'd)?

HOME=$HOME

By default, this variable will be inherited as such. You are in effect assigning the variable to its current contents.

SENDMAIL=/usr/sbin/sendmail

Unless your default is being set incorrectly, there should be no reason to mess with this.

LOGFILE=/var/log/procmail.log

That's a system log directory.  USERS shouldn't be dumping logs there.

DEFAULT=$HOME/Mail/inbox/inbox

This is where messages which reach the end of your .procmailrc will be delivered.

LOCKFILE=/var/lock/.procmail_lock

Do you understand that by setting this, you're initiating a lock on the entire .procmailrc. Why?

###################################
:0:
* 
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*(_at_)facebookmail\(_dot_)com
* ^TO_dannydebont(_at_)gmail\(_dot_)com
$MAILDIR/incoming/internet/social/facebook
###################################

Is this working or not for you? Note that by matching Cc: and To: that include the facebookmail domain, anytime you're a recipient of a message where there's ALSO a facebook recipient, the message will be filed away as such. This differs from your "From facebook" request in your email.

:0
$DEFAULT

This is unnecessary - mail will automatically be delivered to $DEFAULT if not otherwise delivered by a recipe within .procmailrc

If you were mangling the message (such as tweaking the subject or adding some other header) on the way into the default delivery, you might have an explicit rule for defauly delivery, but if not, there's no need for it.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>