Hi,
I did not realy expect a reply like this ... :)
But anyhow, I will try and answer to the best of my abilities ...
To: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
Date: Wed, 17 Nov 2010 12:40:02 -0800
From: Professional Software Engineering
<PSE-L(_at_)mail(_dot_)professional(_dot_)org>
Subject: Re: AND and OR recipe?
X-Mailer: QUALCOMM Windows Eudora Version 7.1.0.9
X-BeenThere: procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
LOGFILE=/var/log/procmail.log
That's a system log directory. USERS shouldn't be dumping logs there.
The reason I log it here is to have one default location for viewing log files.
I don't want log files all over the place. Yes I know it is not "secure" or the
right way, but this is the way I prefer ... :)
LOCKFILE=/var/lock/.procmail_lock
Do you understand that by setting this, you're initiating a lock on the
entire .procmailrc. Why?
To be honest, no, I did not know that. Should I comment this out and rather have
procmail assign it's own lockfile?
###################################
: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.
Nope, it is not working for me. That is the reason I posted here. I want all the
mail that has "dannydebont[AT]gmail[DOT]com" anywhere in the header to be sent
to $HOME/inbox/inbox unless the mail originated from facebook but is still
addressed to "dannydebont[AT]gmail[DOT]com", in that case it must go to
$HOME/incoming/internet/social/facebook.
:0
$DEFAULT
This is unnecessary - mail will automatically be delivered to $DEFAULT if
not otherwise delivered by a recipe within .procmailrc
This I also did not know. All recipes on the net has this last recipe, so I am
jumping into the fire with them?
Now, let me explain the method behind my recipe madness. Followiing is part of
my recipes:
///////////////////////////////////////////////////////////////////////////////////////////////////
SHELL=/bin/sh
HOME=$HOME
PATH=$HOME/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin
SENDMAIL=/usr/sbin/sendmail //points to postfix's sendmail
replacement
MAILDIR=$HOME/Mail
LOGFILE=/var/log/procmail.log //I will change this
LOGABSTRACT="all"
VERBOSE="on"
DEFAULT=$HOME/Mail/inbox/inbox
#DEFAULT=/var/spool/mail/fetchmail
PMDIR=$HOME/.procmail
#INCLUDERC=$PMDIR/spam.rc
LOCKFILE=/var/lock/.procmail_lock //I will change this
###################################
: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
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*(_at_)facebookmail\(_dot_)com
* ^TO_debontvanessa(_at_)gmail\(_dot_)com
$MAILDIR/incoming/friends/vanessa/vanessa
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*misc(_at_)openbsd\(_dot_)org
$MAILDIR/incoming/operating_systems/openbsd/misc/openbsd-misc
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*debian-user(_at_)lists\(_dot_)debian\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/debian/debian-user
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*debian-security(_at_)lists\(_dot_)debian\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/debian/debian-security
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*debian-i18n(_at_)lists\(_dot_)debian\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/debian/debian-i18n
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*debian-laptop(_at_)lists\(_dot_)debian\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/debian/debian-laptop
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*debian-news(_at_)lists\(_dot_)debian\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/debian/debian-news
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*freebsd-questions(_at_)freebsd\(_dot_)org
$MAILDIR/incoming/operating_systems/freebsd/general/freebsd-questions
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*freebsd-net(_at_)freebsd\(_dot_)org
$MAILDIR/incoming/operating_systems/freebsd/general/freebsd-questions
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*mutt-users(_at_)mutt\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/mail/mutt/mutt-users
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*procmail(_at_)informatik\(_dot_)RWTH-Aachen\(_dot_)de
$MAILDIR/incoming/operating_systems/linux/mail/procmail/procmail-users
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*mysql(_at_)lists\(_dot_)mysql\(_dot_)com
$MAILDIR/incoming/operating_systems/linux/database/mysql/mysql-users
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*proftp-user(_at_)lists\(_dot_)sourceforge\(_dot_)net
$MAILDIR/incoming/operatimg_systems/linux/networking/ftp/proftp-users
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*postfix-users(_at_)postfix\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/mail/postfix/postfix-users
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*postfix-users(_at_)cloud9\(_dot_)net
$MAILDIR/incoming/operating_systems/linux/mail/postfix/postfix-users
###################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*enlightenment-users(_at_)lists\(_dot_)sourceforge\(_dot_)net
$MAILDIR/incoming/operating_systems/linux/windowmanagers/e-users
##################################
:0:
* ^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*vim(_at_)vim\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/editors/vim-users
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*service(_at_)intl\(_dot_)paypal\(_dot_)com
$MAILDIR/incoming/online_shopping/paypal
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*magick-users(_at_)imagemagick\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/graphix/image-magick-users
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*fetchmail-users(_at_)lists\(_dot_)berlios\(_dot_)de
$MAILDIR/incoming/operating_systems/linux/mail/fetchmail/fetchmail-users
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*kalaharisupport(_at_)kalahari\(_dot_)net
$MAILDIR/incoming/online_shopping/kalahari.net
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*moderationteam(_at_)hilux4x4\(_dot_)co\(_dot_)za
$MAILDIR/incoming/offroading/hilux4x4/hilux4x4
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*info(_at_)tracks4africa\(_dot_)co\(_dot_)za
$MAILDIR/incoming/offroading/tracks4africa/tracks4africa
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*general(_at_)lists\(_dot_)mozilla\(_dot_)org
$MAILDIR/incoming/programming/mozilla/general
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*php-general(_at_)lists\(_dot_)php\(_dot_)net
$MAILDIR/incoming/programming/php/php
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*info(_at_)openDesktop\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/windowmanagers/e17-stuff
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*wine-users(_at_)winehq\(_dot_)org
$MAILDIR/incoming/operating_systems/linux/wine/wine
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*openvpn-users(_at_)lists\(_dot_)sourceforge\(_dot_)net
$MAILDIR/incoming/operating_systems/linux/networking/vpn/openvpn/openvpn-users
##################################
:0:
* ^Subject:(_dot_)*root(_at_)fever
$MAILDIR/incoming/system/cron
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*zs-sat(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/zs-sat/zs-sat-list
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*zs-sat(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/zs-vhf/zs-vhf-list
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*icom(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/icom/icom-list
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*icom(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/icom/icom-list
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*Kenwood(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/kenwood/kenwood-list
##################################
:0:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*yahesu(_at_)mailman\(_dot_)qth\(_dot_)net
$MAILDIR/incoming/hamradio/yaesu/yahesu-list
##################################
:0
$DEFAULT
///////////////////////////////////////////////////////////////////////////////////////////////////
Now, let us take the mailing list misc(_at_)openbsd(_dot_)org for example. I
use the
following:
*
^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):(_dot_)*misc(_at_)openbsd\(_dot_)org
misc(_at_)openbsd(_dot_)org can be in either one of the OR fileds. I am merely
trying to
catch any field that contains the e-mail address
misc(_at_)openbsd(_dot_)org(_dot_)
I understand that my recipes needs tuning and many of them can be condensed
and/or amalgamated into a more efficient recipe. My reasoning for the way I
write
the recipes the way I do is to keep it simple for error tracking. As you know,
one might work with procmail (or any other app for that matter) for 2 weeks at
end and then never return to it for 3 years. And after 3 years you want to
change something and you do not understand your own code.
Thank You
Danny
____________________________________________________________
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