From e39f14a06d6795ba0348bfca8bd3b43c2754242e Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 7 Apr 2010 19:49:12 +0200 Subject: [PATCH 01/16] do not purge duplicates but discard them --- procmail/duplicates | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/procmail/duplicates b/procmail/duplicates index eb14d4b..aa9f1b7 100644 --- a/procmail/duplicates +++ b/procmail/duplicates @@ -8,8 +8,7 @@ LOCKFILE = $MID_CACHE_FILE$LOCKEXT * ? $FORMAIL -D 16384 $MID_CACHE_FILE { LOG="duplicate: drop duplicate message $MSGID$NL" - - :0 - $NULL + LOCKFILE # unlock + SWITCHRC=$PMDIR/discard } LOCKFILE # unlock -- 2.39.5 From 48c76ab2a04663c2df60766ca3c813a26d19a5e2 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 6 Apr 2010 07:59:55 +0200 Subject: [PATCH 02/16] create earlyquirks filter to manipulate before defines --- procmail/earlyquirks | 6 ++++++ procmail/procmailrc | 2 ++ 2 files changed, 8 insertions(+) create mode 100644 procmail/earlyquirks diff --git a/procmail/earlyquirks b/procmail/earlyquirks new file mode 100644 index 0000000..941e99c --- /dev/null +++ b/procmail/earlyquirks @@ -0,0 +1,6 @@ +:0 f +* ^X-Original-To: forge\.funambol\.org@pobox\.madduck\.net$ +* ^List-Id: <\/[^.]* +|$FORMAIL -i "X-Original-To: ${MATCH}=core.forge.funambol.org@mass.madduck.net" + +# vim:ft=procmail diff --git a/procmail/procmailrc b/procmail/procmailrc index ac807d3..6936771 100755 --- a/procmail/procmailrc +++ b/procmail/procmailrc @@ -8,6 +8,8 @@ PMDIR=$HOME/.etc/mailfilter/procmail INCLUDERC=$PMDIR/defer +INCLUDERC=$PMDIR/earlyquirks + INCLUDERC=$PMDIR/defines #VERBOSE=yes -- 2.39.5 From 38f9d4b42d12c8b5ba0f39ab08cbb486ba7bb8e7 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Sun, 11 Apr 2010 15:25:19 +0200 Subject: [PATCH 03/16] remove notmuch from justme exceptions --- config/justme-address-exceptions | 1 - 1 file changed, 1 deletion(-) diff --git a/config/justme-address-exceptions b/config/justme-address-exceptions index 271c994..c29eecb 100644 --- a/config/justme-address-exceptions +++ b/config/justme-address-exceptions @@ -24,6 +24,5 @@ ^lca-announce=lists\.linux\.org\.au@mass\.madduck\.net$ ^lca2010-(chat|miniconfs|helpers)=lists\.lca2010\.org\.nz@mass\.madduck\.net$ =teams\.debian\.net@mass\.madduck\.net$ -^notmuch=notmuchmail\.org@mass\.madduck\.net$ ^campers=groups\.baacamp\.org@mass\.madduck\.net$ ^discuss=lists\.privacycommons\.org@mass\.madduck\.net$ -- 2.39.5 From 92f8bd8e6c8457428fb09474f1192e4ff430ac0c Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 27 Apr 2010 13:36:54 +0200 Subject: [PATCH 04/16] t-mobile apparently sell addresses --- config/spamtraps | 1 + 1 file changed, 1 insertion(+) diff --git a/config/spamtraps b/config/spamtraps index 19585c5..902b787 100644 --- a/config/spamtraps +++ b/config/spamtraps @@ -63,6 +63,7 @@ ^flyingblue@pobox\.madduck\.net$ ^draytek-?vigor@pobox\.madduck\.net$ ^emusic\.com@pobox\.madduck\.net$ +^tmobile\.de@pobox\.madduck\.net$ ^kinesis-?advantage@pobox\.madduck\.net$ ^sourceforge\.net@pobox\.madduck\.net$ ^dict\.leo\.org@pobox\.madduck\.net$ -- 2.39.5 From 0c16b401e7aa24c05c875f709707f438713552fb Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 26 May 2010 19:58:41 +0200 Subject: [PATCH 05/16] replace ytnef with killtnef --- bin/killtnef | 286 +++++++++++++++++++++++++++++++++++++++++++ procmail/tnef-filter | 13 +- 2 files changed, 295 insertions(+), 4 deletions(-) create mode 100755 bin/killtnef diff --git a/bin/killtnef b/bin/killtnef new file mode 100755 index 0000000..8d8fcc8 --- /dev/null +++ b/bin/killtnef @@ -0,0 +1,286 @@ +#!/usr/bin/perl + +############ +# killtnef # +############ + +use strict; +use Convert::TNEF; +use MIME::Parser; +use MIME::Types; + +my $VERSION = 1.0.3; +my $mimetypes = MIME::Types->new; + +my $message; +while (defined(my $line = )) { + my $msg_bound; + if ($line =~ /^(From\s+.+)\r?\n/ and length($message) or eof) { + parse_message(\$message, $msg_bound); # All the action happens here... + $message = ""; + $msg_bound=$line; + } elsif ($line =~ /^(From\s+.+)\r?\n/) { + $msg_bound=$line; # The first + } + $message.=$line; +} +exit; + + +# Subroutines ############################################################### + +sub parse_message { + my $msg_body = shift @_; + my $msg_bound = shift @_; + my $mime_parser = new MIME::Parser; + + # This module likes to use tmp files, but I try to stop it here. + $mime_parser->use_inner_files(1); + $mime_parser->output_to_core(1); + my $ent = $mime_parser->parse_data($$msg_body); + my $num_parts=$ent->parts; + + # Determine if we have a MIME w/ms-tnef and act accordingly. + if ( ($num_parts < 1) || ($$msg_body !~ /ms-tnef/i) ) { + print "$$msg_body"; + } else { + # Get the head info + my $head = $ent->head; + my $ReturnPath = $head->get('Return-Path'); + my @all_received = $head->get('Received'); + my $Date = $head->get('Date'); + my $From = $head->get('From'); + my $XSender = $head->get('X-Sender'); + my $To = $head->get('To'); + my $Subject = $head->get('Subject'); + my $MessageID = $head->get('Message-ID'); + my $boundary = $head->multipart_boundary; + + # Build a new MIME message based on the one we are examining + # - LHH: it would probably be better to build this $new_ent + # using $ent->head as the basis, thus getting *all* of + # the headers, instead of just these few. We only needed + # these few headers for the project this script was + # originally written for, but if someone wants to change + # this and submit a patch, that would be great. + my $new_ent = MIME::Entity->build( + 'Type' => "multipart/mixed", + 'Boundary' => $boundary, + 'X-Mailer' => undef + ); + my $new_head=$new_ent->head; + # Try to preserve the order of headers in the original message by + # extracting it from the original formatted header. + my(%did_tag); + foreach my $tag (@{$head->header}, $head->tags) { + $tag =~ s/:.*//s; + next if ($did_tag{lc $tag}++); + next if ($new_head->count($tag)); + foreach my $value ($head->get_all($tag)) { + $new_head->add($tag, $value); + } + } + + # Loop over each MIME part adding each to the new message + foreach my $mime_part_i (0 .. ($num_parts - 1)) { + my $ent_part=$ent->parts($mime_part_i); + if ($ent_part->mime_type =~ /ms-tnef/i ) { + add_tnef_parts($ent_part, $new_ent); + } else { + $new_ent->add_part($ent_part); + } + } + + # Set the preamble and epilogue equal to the original + $new_ent->preamble($ent->preamble); + $new_ent->epilogue($ent->epilogue); + + # Print the newly constructed MIME message + print "$msg_bound"; + print STDOUT $new_ent->stringify; + } +} + +sub add_tnef_parts { + my $ent = shift; + my $new = shift; + + ## Create a tnef object + my %TnefOpts=('output_to_core' => '4194304', 'output_dir' => '/tmp'); + my $tnef = Convert::TNEF->read_ent($ent, \%TnefOpts); + my $head=$new->head; # Get the header object from the new message + if (! $tnef) { + warn "TNEF CONVERT DID NOT WORK: " . $Convert::TNEF::errstr . "\n"; + warn " - Failed on msg w/subj: " . $head->get('Subject') . "\n"; + return ''; + } + + ############################################################################# + # This section of code smokes lots of crack, and tries to dig the From: + # header out of the $tnef->message if the new message we are appending + # this attachment to does not already have a "From" header. This is + # required on most of the Outlook emails that never touch SMTP, only + # Exchange servers, and never had valid SMTP From headers placed! + ############################################################################# + my $msg=$tnef->message; + my $mapi_props=$msg->data('MAPIProps'); + #warn join(", ", keys %{$msg->{MAPIProps}}) . "\n"; + #warn $msg->{MAPIProps}->{MBS_Data} . "\n\n----------------------------\n\n"; + #warn "$mapi_props\n\n---------------------------------\n\n"; + my $test=0x0024; + #if ($mapi_props =~ m/(\0\0\0\xf8.{20})/) { warn "MATCHED a prop $1\n"; } + #if (0) { + if (! length($head->get('From')) ) { + my $from=''; + my $cntrl_chars='[\c' . join('\c', ('A' .. 'Z')) . ']'; + if ($mapi_props =~ m/From:\s+([^\s\@]+\@[^\s]+)/) { + $from=$1; + } elsif ($mapi_props =~ m/\xf8\?\cA\0\0\0$cntrl_chars\0\0\0([^\0]+)\0+\cB\cA/) { + $from=$1; + } else { + if ($mapi_props =~ m/(\xf8\?\cA.{30})/) { warn "MATCH: $1\n"; } + #$from="Unknown Sender"; + } + if( length($from)) { $head->replace('from', $from); } + } + ############################################################################# + + for ($tnef->attachments) { + $_->longname=~/^[\w\W]+\.(\w+)$/; + my $ext = $1; + my $type = $mimetypes->mimeTypeOf($ext); + if (! $type) { + warn "No MIME type for (" . $_->longname . "/" . $_->name . ")\n"; + $type = "Application/OCTET-STREAM"; + } + my $encoding; + if ($type) { + if ($type =~ m,^text/,) { + if ($_->data =~ /[^\001-\177]/) { + $encoding = '8bit'; + } + else { + $encoding = '7bit'; + } + } + else { + $encoding = 'base64'; + } + } + elsif ($_->data =~ /[^\t\n\r\f\040-\177]/) { + $encoding = 'base64'; + } + else { + $encoding = '7bit'; + } + + $new->attach( + Type => $type, + Encoding => $encoding, + Data => $_->data, + Disposition => 'attachment', + Filename => $_->longname + ); + } + # If you want to delete the working files + $tnef->purge; +} + + +# POD documentation + +=head1 SYNOPSIS + +cat mbox_msg_w_tnef | killtnef > mbox_msg_mime_compliant + +=head1 README + +killtnef - Converts emails with MS-TNEF, Microsoft's proprietary +Transport Neutral Encapsulated Format, attachments into standard +MIME-compliant emails. + +This script reads an mbox, or a single email message, from STDIN, +extracts data from any ms-tnef attachments that may exist, and writes +a new mbox (or a single email message) to STDOUT which has each of the +files that were encoded in any ms-tnef attachments attached separately, +as RFC-822/RFC-1521 compliant MIME emails/attachments. + +Any email(s) containing no ms-tnef MIME attachments are passed through +this script untouched. + +=head1 DESCRIPTION + +This script was originally written to convert about 35,000 emails from +some Microsoft Outlook *.pst (post office) files, almost all of which +had ms-tnef encoded attachments, into MIME-compliant emails so that +they could be imported into an email-archiving system that 10East +supplies to some of its customers. If anyone is curious, an imapd +was used to move the emails from the *.pst files to mbox format using +Outlook 2000 as an IMAP client. + +This script can also be used as an incoming mail filter which will +automatically convert ms-tnef attachments into MIME-compliant +attachments. + +=head1 AUTHORSHIP + +Andrew Orr (no longer a maintainer) + +Lester Hightower (maintainer) + +=head1 LICENSE + +This software is licensed under the terms of the GNU Public License, +which is available for review at http://www.gnu.org/copyleft/gpl.html + +=head1 CHANGE LOG + +Feb-22-2002: Originally created by Andy Orr + +Feb-26-2002: A few enhancements and bug-fixes by Lester Hightower. + +Mar-06-2002: Documentation and a few comments added by Lester Hightower +in preparation for submitting this script to CPAN. + +Mar-07-2002: After realizing that a POD README section is needed for the +HTML pages generated for the script index in CPAN, LHH added one and +submitted this as killtnef-1.0.1.pl. + +Sep-20-2005: Applied a patch provided by Jonathan Kamens and released that +as killtnef-1.0.2.pl. The patch did: + * Use /usr/bin/perl instead of /usr/local/bin/perl. + * Use MIME::Types instead of hard-coded list of + extensions and MIME types. + * Preserve MIME boundary and headers from original + message. + * Try to use 7bit or 8bit encoding instead of base64 + whenever possible. This makes resulting messages + smaller and easier to full-text index. + +May-30-2007: Applied a patch provided by Stefan Bertels and released that +as killtnef-1.0.3.pl. The patch uses any "\w" characters after the last +dot in each attachments' longname as the file extenstion, instead of just +"([A-Za-z]{2,4})" and also defaults the type to "Application/OCTET-STREAM" +if no mimetype can be found for the file extenstion. + +=head1 PREREQUISITES + +This script requires the C, C, +C, and C modules. + +=head1 COREQUISITES + +None. + +=pod OSNAMES + +Any Unix-like. + +=pod SCRIPT CATEGORIES + +Mail +Mail/Converters +Mail/Filters + +=cut + diff --git a/procmail/tnef-filter b/procmail/tnef-filter index b1d52da..790a25c 100644 --- a/procmail/tnef-filter +++ b/procmail/tnef-filter @@ -1,4 +1,9 @@ -:0 fw -* ^X-MS-TNEF-Correlator: -* B ?? winmail.dat -|ytnef-filter +:0 +* ^X-MS-TNEF-Correlator: < +* B ?? ^Content-Type: application/ms-tnef +{ + :0 fw + |$MAILFILT/bin/killtnef | $FORMAIL -IX-MS-Has-Attach: -IX-MS-Tnef-Correlator: \ + -IX-MimeOLE: -IContent-Class: -I'X-Tnef: killed' + LOG="tnef-filter: converted TNEF attachment$NL" +} -- 2.39.5 From 7e7f50ee2f6d2ab4e392c75e0a9d96e53f6bac35 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Wed, 26 May 2010 19:58:57 +0200 Subject: [PATCH 06/16] no need to scan bodies for test and ignore patterns --- procmail/flag-test-messages | 2 +- procmail/ignore | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/procmail/flag-test-messages b/procmail/flag-test-messages index a247504..eeb6a31 100644 --- a/procmail/flag-test-messages +++ b/procmail/flag-test-messages @@ -1,4 +1,4 @@ -:0 BH +:0 * ? $EGREP -qif $CONF/test-messages { LOG="flag-test: flagging test message $MSGID$NL" diff --git a/procmail/ignore b/procmail/ignore index 682cc4e..19cf5cd 100644 --- a/procmail/ignore +++ b/procmail/ignore @@ -1,4 +1,4 @@ -:0 BH +:0 * ? $EGREP -qif $CONF/ignore { LOG="ignore: discarding ignored message$NL" -- 2.39.5 From 94f7e744b418ad402c9d67dccb7f420572b19c1c Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 27 May 2010 16:08:36 +0200 Subject: [PATCH 07/16] fix debian.ch community address --- config/justme-address-exceptions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/justme-address-exceptions b/config/justme-address-exceptions index c29eecb..02eafab 100644 --- a/config/justme-address-exceptions +++ b/config/justme-address-exceptions @@ -9,7 +9,7 @@ ^jppy=zanu\.org\.uk@mass\.madduck\.net$ ^os-renet=insel\.cs\.tu-berlin\.de@mass\.madduck\.net$ ^(community|discuss)=opensource\.mit\.edu@mass\.madduck\.net$ -^debian\.ch=fortytwo\.ch@mass\.madduck\.net$ +^community=lists\.debian\.ch@mass\.madduck\.net$ ^libkdtree-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^logcheck-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^pkg-mdadm-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ -- 2.39.5 From b14949d40b7be98a0eeba0a7da5af62a029aaa64 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 27 May 2010 16:08:49 +0200 Subject: [PATCH 08/16] do not except debconf this year --- config/justme-address-exceptions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/justme-address-exceptions b/config/justme-address-exceptions index 02eafab..c45e1d3 100644 --- a/config/justme-address-exceptions +++ b/config/justme-address-exceptions @@ -13,7 +13,7 @@ ^libkdtree-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^logcheck-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^pkg-mdadm-devel=lists\.alioth\.debian\.org@mass\.madduck\.net$ -^debconf-(team|press|discuss)=lists\.debconf\.org@mass\.madduck\.net$ +##^debconf-(team|press|discuss)=lists\.debconf\.org@mass\.madduck\.net$ ^netconf-(devel|commits)=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^packaging-handbook-project=lists\.alioth\.debian\.org@mass\.madduck\.net$ ^vcs-pkg-(discuss|commits)=lists\.alioth\.debian\.org@mass\.madduck\.net$ -- 2.39.5 From e240fb6eb8ba566a5791c64ec924a0416829aaed Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 15 Jun 2010 12:51:19 +0200 Subject: [PATCH 09/16] improved spamtrapping of msgids --- config/spamtraps | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/spamtraps b/config/spamtraps index 902b787..4ca9f36 100644 --- a/config/spamtraps +++ b/config/spamtraps @@ -1,5 +1,6 @@ .+@(diamond|cirrus)\.madduck\.net$ -^[[:alpha:]]{2}[[:xdigit:]]+@(piper|lapse)\.madduck\.net$ +^[[:alpha:]]{2}[[:xdigit:]]+@piper\.oerlikon\.madduck\.net$ +^[[:alpha:]]{2}[[:xdigit:]]+@(lapse|fishbowl)\.rw\.madduck\.net$ ^(webmaster|info|sales)@belligerence\.net$ ^(webmaster|info|sales)@krafftwerk\.(de|com|net|eu|ch)$ ^(webmaster|info|sales)@limerence\.org$ -- 2.39.5 From 03383614d78f2f96fb6aac6e587bcdc998098efa Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 27 Jun 2011 13:24:00 +0200 Subject: [PATCH 10/16] more spamtraps --- config/spamtraps | 67 ++++++++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 30 deletions(-) diff --git a/config/spamtraps b/config/spamtraps index 4ca9f36..426590b 100644 --- a/config/spamtraps +++ b/config/spamtraps @@ -66,39 +66,46 @@ ^emusic\.com@pobox\.madduck\.net$ ^tmobile\.de@pobox\.madduck\.net$ ^kinesis-?advantage@pobox\.madduck\.net$ -^sourceforge\.net@pobox\.madduck\.net$ ^dict\.leo\.org@pobox\.madduck\.net$ ^vmware\.com@pobox\.madduck\.net$ ^myspace\.com@pobox\.madduck\.net$ ^facebook\.com@pobox\.madduck\.net$ ^electrumx\.com@pobox\.madduck\.net$ ^trac\.edgewall\.com@pobox\.madduck\.net$ -^naming-?theme@pobox.madduck.net$ -^blog@pobox.madduck.net$ -^ipv6-?howto@pobox.madduck.net$ -^ie-?talk@pobox.madduck.net$ -^asia2006@pobox.madduck.net$ -^ienote@pobox.madduck.net$ -^dms-?suggestions@pobox.madduck.net$ -^computer-?closet@pobox.madduck.net$ -^samsung-?q-?series@pobox.madduck.net$ -^printers@pobox.madduck.net$ -^myanmar2006@pobox.madduck.net$ -^lpi-?or-?not@pobox.madduck.net$ -^imap-?outbox@pobox.madduck.net$ -^im20@pobox.madduck.net$ -^encryptedhome@pobox.madduck.net$ -^chinese-charity@pobox.madduck.net$ -^vertical-tabs@pobox.madduck.net$ -^vcshome@pobox.madduck.net$ -^bz@pobox.madduck.net$ -^dns-?server@pobox.madduck.net$ -^voip-?phones@pobox.madduck.net$ -^squid-?sleep@pobox.madduck.net$ -^pim@pobox.madduck.net$ -^org@pobox.madduck.net$ -^mnet-?referral@pobox.madduck.net$ -^logitech-?adapter@pobox.madduck.net$ -^libhid@pobox.madduck.net$ -^keysigning@pobox.madduck.net$ -^delaying-?mail@pobox.madduck.net$ +^naming-?theme@pobox\.madduck\.net$ +^blog@pobox\.madduck\.net$ +^ipv6-?howto@pobox\.madduck\.net$ +^ie-?talk@pobox\.madduck\.net$ +^asia2006@pobox\.madduck\.net$ +^ienote@pobox\.madduck\.net$ +^dms-?suggestions@pobox\.madduck\.net$ +^computer-?closet@pobox\.madduck\.net$ +^samsung-?q-?series@pobox\.madduck\.net$ +^printers@pobox\.madduck\.net$ +^myanmar2006@pobox\.madduck\.net$ +^lpi-?or-?not@pobox\.madduck\.net$ +^imap-?outbox@pobox\.madduck\.net$ +^im20@pobox\.madduck\.net$ +^encryptedhome@pobox\.madduck\.net$ +^chinese-charity@pobox\.madduck\.net$ +^vertical-tabs@pobox\.madduck\.net$ +^vcshome@pobox\.madduck\.net$ +^bz@pobox\.madduck\.net$ +^dns-?server@pobox\.madduck\.net$ +^voip-?phones@pobox\.madduck\.net$ +^squid-?sleep@pobox\.madduck\.net$ +^pim@pobox\.madduck\.net$ +^org@pobox\.madduck\.net$ +^mnet-?referral@pobox\.madduck\.net$ +^logitech-?adapter@pobox\.madduck\.net$ +^libhid@pobox\.madduck\.net$ +^keysigning@pobox\.madduck\.net$ +^delaying-?mail@pobox\.madduck\.net$ +^dollyfish\.net\.nz@pobox\.madduck\.net$ +^grep\.be@pobox\.madduck\.net$ +^dns-server@pobox\.madduck\.net$ +^puppet-conversion@pobox\.madduck\.net$ +^munin-monitoring\.org@pobox\.madduck\.net$ +^asia2006@pobox\.madduck\.net$ +^libhid@pobox\.madduck\.net$ +^samsung-q-series@pobox\.madduck\.net$ -- 2.39.5 From d54682894f13d340c4561e4bdd3fc6f74dea2510 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Mon, 27 Jun 2011 13:24:10 +0200 Subject: [PATCH 11/16] ignore linkedin invitations --- config/ignore | 1 + 1 file changed, 1 insertion(+) diff --git a/config/ignore b/config/ignore index 9ae3715..188770f 100644 --- a/config/ignore +++ b/config/ignore @@ -36,6 +36,7 @@ ^To:.*\ ^From:.*$ ^From:.*$ +^From:.*$ ^To:.*\ ^X-Launchpad-Bug: product=udd ^Subject: =\?iso-8859-1\?Q\?\[ARP-MESSAGE\]_Pr=FCfung_der_Kontaktdaten\?=$ -- 2.39.5 From 53690a27958f40bc80a598842a629fe747d8078f Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 5 Oct 2010 22:37:39 +0200 Subject: [PATCH 12/16] add swan as mail relay --- procmail/defines | 2 +- spamassassin/user_prefs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/procmail/defines b/procmail/defines index bb07680..d1cbb9f 100644 --- a/procmail/defines +++ b/procmail/defines @@ -65,7 +65,7 @@ CRM_MISCLASSIFY_SA_AUTOTRAIN_LIMIT_SPAM=11 NL=" " RE_MYDOMAIN="(.+\.)*madduck\.net" -RE_MAILRELAYS="(seamus|clegg)\.madduck\.net" +RE_MAILRELAYS="(seamus|swan|clegg)\.madduck\.net" RE_SPACE="[ ]" RE_NOT_SPACE="[^ ]" RE_SPACE_NEWLINE="(^|$RE_SPACE)" diff --git a/spamassassin/user_prefs b/spamassassin/user_prefs index f12ea28..5a8f12c 100644 --- a/spamassassin/user_prefs +++ b/spamassassin/user_prefs @@ -148,4 +148,4 @@ score BAYES_95 0.0001 0.0001 4.0 4.0 score BAYES_99 0.0001 0.0001 5.0 5.0 # VBounce -whitelist_bounce_relays clegg.madduck.net seamus.madduck.net +whitelist_bounce_relays clegg.madduck.net seamus.madduck.net swan.madduck.net -- 2.39.5 From f9580451f506db43603243fef630f8ebfcc4a884 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 6 Jan 2011 08:59:33 +0100 Subject: [PATCH 13/16] enable vacation autoreplies --- config/vacation-rcpts | 3 +++ procmail/defines | 2 ++ procmail/procmailrc | 1 + procmail/vacation | 11 +++++++++++ 4 files changed, 17 insertions(+) create mode 100644 config/vacation-rcpts create mode 100644 procmail/vacation diff --git a/config/vacation-rcpts b/config/vacation-rcpts new file mode 100644 index 0000000..baa8139 --- /dev/null +++ b/config/vacation-rcpts @@ -0,0 +1,3 @@ +^.*@martin-krafft\.net$ +^madduck@madduck\.net$ +^madduck@debian\.org$ diff --git a/procmail/defines b/procmail/defines index d1cbb9f..4470c76 100644 --- a/procmail/defines +++ b/procmail/defines @@ -37,6 +37,8 @@ SPAMC="$NICE /usr/bin/spamc --log-to-stderr --no-safe-fallback" #SPAMC="$SPAMASSASSIN" TRAINER="$NICE $MAILFILT/bin/train" +VACATION="$NICE /usr/bin/vacation" + SQLITE="$NICE /usr/bin/sqlite3" BASE=$HOME/.maildir diff --git a/procmail/procmailrc b/procmail/procmailrc index 6936771..69b3c70 100755 --- a/procmail/procmailrc +++ b/procmail/procmailrc @@ -42,6 +42,7 @@ INCLUDERC=$PMDIR/spamfilter INCLUDERC=$PMDIR/handlespam #INCLUDERC=$PMDIR/autoreplies +INCLUDERC=$PMDIR/vacation INCLUDERC=$PMDIR/tickle diff --git a/procmail/vacation b/procmail/vacation new file mode 100644 index 0000000..7f8f4d1 --- /dev/null +++ b/procmail/vacation @@ -0,0 +1,11 @@ +:0 c +* ! DEST ?? . +*$ !$MSG_DEJAVU +* ? echo "$ORIGINAL_TO" | $EGREP -qif $CONF/vacation-rcpts +{ + LOG="vacation: maybe sending vacation autoreply to $SENDER$NL" + :0: $PMVAR/vacation.db.lock + |$VACATION -j -r 3 -f $PMVAR/vacation.db -m $REPLIES/vacation $LOGNAME +} + +# vim:ft=procmail -- 2.39.5 From 0856d0a1c8825d9d97a490463bc2e0ba58391137 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 6 Jan 2011 12:36:47 +0100 Subject: [PATCH 14/16] filter mldonkey stuff into subfolders --- procmail/rules/all | 2 ++ procmail/rules/mldonkey | 12 ++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 procmail/rules/mldonkey diff --git a/procmail/rules/all b/procmail/rules/all index 1c0303b..955aedf 100644 --- a/procmail/rules/all +++ b/procmail/rules/all @@ -12,6 +12,8 @@ INCLUDERC=$PMRULES/debian INCLUDERC=$PMRULES/ul + INCLUDERC=$PMRULES/mldonkey + INCLUDERC=$PMRULES/test-messages INCLUDERC=$PMRULES/dsn INCLUDERC=$PMRULES/gpg diff --git a/procmail/rules/mldonkey b/procmail/rules/mldonkey new file mode 100644 index 0000000..c0b43db --- /dev/null +++ b/procmail/rules/mldonkey @@ -0,0 +1,12 @@ +:0 +* FROM ?? ^MLDonkey $ +{ + :0 + * B ?? /srv/downloads/pdl/ + { DEST=pdl } + + :0 E + { DEST=mldonkey } +} + +# vim:ft=procmail -- 2.39.5 From 3fbf937c6a6973eddaec854427371c21be037511 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Thu, 6 Jan 2011 12:44:04 +0100 Subject: [PATCH 15/16] filter ardex into its own folder Signed-off-by: martin f. krafft --- procmail/rules/all | 1 + procmail/rules/ardex | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 procmail/rules/ardex diff --git a/procmail/rules/all b/procmail/rules/all index 955aedf..6800bfb 100644 --- a/procmail/rules/all +++ b/procmail/rules/all @@ -8,6 +8,7 @@ INCLUDERC=$PMRULES/feeds INCLUDERC=$PMRULES/mass INCLUDERC=$PMRULES/admin + INCLUDERC=$PMRULES/ardex INCLUDERC=$PMRULES/sudetia INCLUDERC=$PMRULES/debian INCLUDERC=$PMRULES/ul diff --git a/procmail/rules/ardex b/procmail/rules/ardex new file mode 100644 index 0000000..fa1e7b3 --- /dev/null +++ b/procmail/rules/ardex @@ -0,0 +1,5 @@ +:0 +* ORIGINAL_TO ?? ^ardex@martin-krafft\.net$ +{ DEST=ardex } + +# vim:ft=procmail -- 2.39.5 From 46d57b0e1b08f618e5d46f2538c7ac92c79e2326 Mon Sep 17 00:00:00 2001 From: "martin f. krafft" Date: Tue, 1 Feb 2011 08:49:50 +0100 Subject: [PATCH 16/16] add subject cleaner --- procmail/procmailrc | 1 + procmail/subject-cleaner | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 procmail/subject-cleaner diff --git a/procmail/procmailrc b/procmail/procmailrc index 69b3c70..e5620b3 100755 --- a/procmail/procmailrc +++ b/procmail/procmailrc @@ -49,6 +49,7 @@ INCLUDERC=$PMDIR/tickle INCLUDERC=$PMDIR/tnef-filter INCLUDERC=$PMDIR/listquirks +INCLUDERC=$PMDIR/subject-cleaner INCLUDERC=$PMRULES/all diff --git a/procmail/subject-cleaner b/procmail/subject-cleaner new file mode 100644 index 0000000..2dd3387 --- /dev/null +++ b/procmail/subject-cleaner @@ -0,0 +1,15 @@ +:0 +* SUBJECT ?? ^.+\[AntiVir checked\]$ +{ NEWSUBJECT="`echo $SUBJECT | sed -e 's,\[AntiVir checked\]$,,'`" } + +:0 +* NEWSUBJECT ?? . +{ + :0 fw + |$FORMAIL -I "Subject: $NEWSUBJECT" + SUBJECT="$NEWSUBJECT" + NEWSUBJECT +} + +# vim:ft=procmail + -- 2.39.5