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

Re: exim amd .forward



On Fri, Aug 03, 2001 at 10:08:33PM -0700, Osamu Aoki wrote:
> On Fri, Aug 03, 2001 at 01:31:16PM +0100, Patrick Kirk wrote:
> > The nice set of .forward templates that was on www.exim.org has disappeared.
> 
> I set ~/.procmailrc to delivar mail to each folder.  Since I use Maildir
> format it is like: (If you want regular mbox, remove trailing /)
> 
> --------------------------
> # All delivary to Qmail style Maildir.  i.e. followed by /
> # No lock needed
> 
> MAILDIR=$HOME/Mail
> DEFAULT=$MAILDIR/Inbox/
> LOGFILE=$MAILDIR/Maillog
> 
> ################# Message filters   ######################
> 
> # message length for Maildir(qmail)
> :0 Bfh
> * H ?? !^Lines:
> * -1^0
> *  1^1 ^.*$
> | formail -A "Lines: $="
[snip]

but after a few lines, those procmail recipes look too much
like romulan for me. exim's filters (~/.forward) to the rescue:

	# Exim filter

	logfile $home/.forward.log 0600
	# ... so i can still "mailstat ~/.forward.log"

	if error_message
	then
		save Mail/error
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: error				  $message_size"
		finish
	endif

	# --------------
	# paypal payment

	if	$return_path contains "payment@paypal.com"
	then
		save Mail/paypal
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: paypal				  $message_size"
		finish
	endif

	# --------------------
	# checking system logs

	if	foranyaddress $h_to:,$h_cc: (${local_part:$thisaddress} is "root")
	then
		save Mail/root
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: root				  $message_size"
		finish
	endif

	# --------------------
	# debian mailing lists

	#X-Mailing-List: <debian-user@lists.debian.org> archive/latest/151892
	if $h_X-Mailing-List matches "^<debian-(.*)@lists\\\\.debian\\\\.org>"
	then
		save Mail/debian-${lc:$1}
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: debian-${lc:$1}				  $message_size"
		finish
	endif

	# ------------
	# various gunk

	if	$sender_address_domain ends "whatUseek.com"
	or	$sender_address_domain ends "whatUseek.com"
	or	$sender_address_domain ends "websidestory.com"
	or	$sender_address_domain ends "webreview.com"
	or	$sender_address_domain ends "webpronews.com"
	or	$sender_address_domain ends "MotleyFool.com"
	or	$sender_address_domain ends "SearchHound.com"
	or	$sender_address_domain ends "about.com"
	or	$sender_address_domain ends "Mailbits.com"
	or	$sender_address_domain ends "smtp.quote.com"
	or	$sender_address_domain ends "accessmicro.com"
	or	$sender_address_domain ends "itemzone.com"
	or	$sender_address_domain ends "spedia.net"
	or	$sender_address_local_part contains "readers.digest"
	or	$sender_address_local_part contains "TheCounterProfessional"
	or	$sender_address_local_part contains "intelligentxmailbag"
	or	$h_to: contains "unknown@unknown.com"
	then
		save Mail/gunk
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: gunk				  $message_size"
		finish
	endif

	# ------------------------------
	# mailto:webmaster@virtualdomain

	if	$original_local_part is "webmaster"
	and	$original_domain matches "([^.]+[.](com|org|net))\\$"
	then
		save Mail/webmaster-${lc:$1}
		logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: webmaster-${lc:$1}				  $message_size"
		finish
	endif

	# must be junk mail!
	save Mail/JUNK-O-RAMA
	logwrite "From $return_path $tod_log\n Subject: $h_subject:\n  Folder: JUNK-O-RAMA				  $message_size"
	finish

the main snafu here is all the extra "\\\\" involved in the
bizarre quoting mechanismo...

-- 
DEBIAN NEWBIE TIP #27 from Will Trillich <will@serensoft.com>
:
Would you like RXVT to have more than 80 COLUMNS OR 24 ROWS? For an
rxvt session, running under X, specify how many rows and columns
you want:
	rxvt -g 132x30 &
Try "man rxvt" for more info.

Also see http://newbieDoc.sourceForge.net/ ...



Reply to: