<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.mail.procmail">
    <title>gmane.mail.procmail</title>
    <link>http://blog.gmane.org/gmane.mail.procmail</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48029"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48020"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48019"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48014"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48008"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/48003"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47999"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47998"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47996"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47992"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47982"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47974"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47971"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47963"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47962"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47960"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47940"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47939"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47930"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.mail.procmail/47927"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48029">
    <title>detect an email with japanese characters</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48029</link>
    <description>&lt;pre&gt;
Hi,

How it is possible to detect (and filter) an email written in Japanese characters (which I cannot read anyway)?

The content-Type specifies charset="utf-8". The "From" field is apparently invalid, and may not necessarily contain .jp

Regards,
Konstantin.
&lt;/pre&gt;</description>
    <dc:creator>Konstantin</dc:creator>
    <dc:date>2012-05-21T18:59:41</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48020">
    <title>Playing a sound</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48020</link>
    <description>&lt;pre&gt;Hi guys,

Is it possible to play a soundfile when procmail encounters mail from a certain
e-mail address?

Thank You

Danny
&lt;/pre&gt;</description>
    <dc:creator>Danny</dc:creator>
    <dc:date>2012-04-17T19:27:32</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48019">
    <title>(unknown)</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48019</link>
    <description>&lt;pre&gt;I have the following procmail recipe to auto-respond upon certain
criteria.  The recipe "works" in the way to match and to send reply email;
however the sent email only has mail header without mail body (empty), 
that I could not get it why mail body is "not formed" or "not sent":

SUBJADDR =`formail -xSubject: |perl -pe 's/.*sub.*\s+([^\s]+\&amp;lt; at &amp;gt;[^\s]+)/$1/sg;s/^\s+//g;s/\s+$//g;'`
HISTMARK = `date +"%s"`

:0
* ^TO.*watchdog&amp;lt; at &amp;gt;my.domain
| (formail -i"Subject: Confirmation needed" \
       -I "To: $SUBJADDR"; \
       echo " "; \
       echo " "; \
       echo "Confirmation mark: $HISTMARK") | $SENDMAIL -oi $SUBJADDR

I tried single or double 'echo " ";' lines to leave 1 or 2 space lines 
between mail header and body - that makes no difference.  Any suggestion 
would be appreciated.

Zhiliang
&lt;/pre&gt;</description>
    <dc:creator>Zhiliang</dc:creator>
    <dc:date>2012-02-09T20:32:22</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48014">
    <title>Organizing</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48014</link>
    <description>&lt;pre&gt;I’m thinking about taking a run at organizing, really organizing, all the procmail recipes for my several email accounts.

I have, needless to say, code that is shared, duplicated, or nearly duplicated across my 4 primary accounts,a bout a half-dozen secondary accounts, and then a portion of that code is shared over to most of the user accounts on the system.

Before I got started, I wanted some recommendations on how, exactly to go about this.

I was considering something along these lines, with * items being things the are already done.

* procmailrc file with basic variable extraction, mail backup

* hand off processing to .procmailrc if user has one, otherwise process for spam

In .procmailrc
call external basicrc file for all users to process list messages, + addressing, and set default delivery locations (like .$ARG/ or .SPAM/)

process local rc files (~/.procmail/.*rc)

call a deliveryrc file that actually delivers the mail and logs to user’s log file (~/logs/pm.10-11-2011.log)


I figure the deliveryrc and basicrc can be the same file for everyone if I do it right, though I am unsure how to load arbitrary files in the user’s ~/.procmail/ folder.

Does all of this sound reasonable? Does anyone have any hints (or samples) on something like this? What I envision is something that is going to be necessarily a lot more complicated than what I am currently doing, but will end up being more flexible and easier to manage since most files will just be shared between all users. I may even look into doing something like creating a library of procmail includes that a user could just comment/uncomment to run if wanted

#Check and tag message for spamishness
#INCLUDERC=/path/to/spamcheck

#Sort users in ~/.friends into .friends/
#calls /path/to/eliveryrc to deliver the message
INLCUDERC=/path/to/friendsort

#Put all extensions into .Plus.$ARG/
#calls /path/to/eliveryrc to deliver the message
INCLUDERC=/path/to/plussort

etc.

Thoughts?

&lt;/pre&gt;</description>
    <dc:creator>LuKreme</dc:creator>
    <dc:date>2011-11-09T20:13:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48008">
    <title>Querying a DB to determine destination mailbox for an email usingProcmail</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48008</link>
    <description>&lt;pre&gt;Requirement: I need to devise a solution where a procmail script can dynamically determine the final destination mailbox by querying a database for a particular keyword to get the corresponding mailbox.

Approach I have in mind:
Based on my knowledge of procmail so far, I envision the following steps but wanted some expert opinion on finding the right approach.
1. Use a database to maintain a key/value pair type information for a keyword and a corresponding mailbox name. This information may be maintained manually or using a custom application (outside of procmail).
2. Write a Perl script which takes an input parameter from procmail (I have not done this before but I believe procmail can call a Perl script and just pass an argument in the call). 
3. The Perl script performs the actual query to database for a given keyword to find the corresponding mailbox name.
4. The script then returns the mailbox name to the procmail script/recipe that invoked the Perl script.
5. The procmail recipe then directs that email (which had the keyword) to its intended mailbox (which was dynamically determined using the query executed by the PERL script).

Is the above approach an appropriate way to implement the requirement outlined at the beginning of this email?

If yes, are there any conditions that I missed in my approach that I need to be mindful of before beginning research and development for this solution using this approach?

If no, can you suggest an alternate way of achieving this requirement?

Thanks and regards,
Komal

------------------------------------------------------------------------------------------------------------------------------------------------------------------
Komal Tagdiwala | IT Engineer | Cisco Systems, Inc.| Contact Center Applications &amp;amp; Technologies
400 E Tasman Dr | SJC 12/3 | San Jose, CA 95134 | ktagdiwa&amp;lt; at &amp;gt;cisco.com | Office: (408)527-2163
------------------------------------------------------------------------------------------------------------------------------------------------------------------
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
&lt;/pre&gt;</description>
    <dc:creator>Komal Tagdiwala (ktagdiwa</dc:creator>
    <dc:date>2011-10-28T00:58:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/48003">
    <title>sed syntex in procmailrc question</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/48003</link>
    <description>&lt;pre&gt;
I have a recipe wish 'sed' in one of my Smartlist rc, like:

    sed 's/SUBJET/'"$SUBJ"/g

which works fine.  I forgot where did I copied it from but have been 
puzzled by its syntex with respect to the use of the single quotes "'". 
Following what's described in sed tutorials I made it:

    sed 's/SUBJET/"$SUBJ"/g'

and it fails.  Could someone kindly point me to a "right" resource I 
should check? (I wondered in between sh/csh shell scripting syntex 
and general RE, among several other resources having things "alike"; Or 
is it really a 'sed/awk' thing that I have not really get into?)

Thanks in advance,

Zhiliang
&lt;/pre&gt;</description>
    <dc:creator>Zhiliang</dc:creator>
    <dc:date>2011-10-13T22:55:03</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47999">
    <title>Long line of OR</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47999</link>
    <description>&lt;pre&gt;I have a recipe that has a very long line of matches

* 9876543210^0 ! VAR ?? (aa|apsumo|beni|candy|casa|cf|cpr|db|dbl|dhosts|fb|glue|gofobo|hita|ic|llc|logi|micr|netf|ocb|plus|pl|rcc|rk|rocb|scv|snap|spot|su|tor|tripa|twit|v365|vm|root|admin|rsmith|bsmith)

and it occurred to me there might be a reason not to do that.

&lt;/pre&gt;</description>
    <dc:creator>LuKreme</dc:creator>
    <dc:date>2011-10-12T14:16:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47998">
    <title>Invitation to connect on LinkedIn</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47998</link>
    <description>&lt;pre&gt;LinkedIn
------------




    Diego Lima requested to add you as a connection on LinkedIn:
  
------------------------------------------

Manu,

I'd like to add you to my professional network on LinkedIn.

Accept invitation from Diego Lima
http://www.linkedin.com/e/m7kteh-gt8pszef-1w/aqAYqIuparUlmf046DrYdwIw2RWcq-YzmuwPddwIhh_E/blk/I1758890267_3/1BpC5vrmRLoRZcjkkZt5YCpnlOt3RApnhMpmdzgmhxrSNBszYPnPsScz0Ve3wRdP59bQFEsj0RpSlkbP8McPgRdzsNd3gLrCBxbOYWrSlI/EML_comm_afe/?hs=false&amp;amp;tok=1el11Tf2VS3kY1

View invitation from Diego Lima
http://www.linkedin.com/e/m7kteh-gt8pszef-1w/aqAYqIuparUlmf046DrYdwIw2RWcq-YzmuwPddwIhh_E/blk/I1758890267_3/3dvdPoOc3AUe3kTckALqnpPbOYWrSlI/svi/?hs=false&amp;amp;tok=3xgGP31zZS3kY1 

------------------------------------------
DID YOU KNOW you can use your LinkedIn profile as your website? Select a vanity URL and then promote this address on your business cards, email signatures, website, etc
http://www.linkedin.com/e/m7kteh-gt8pszef-1w/ewp/inv-21/?hs=false&amp;amp;tok=24X0XNyk9S3kY1

 
&lt;/pre&gt;</description>
    <dc:creator>Diego Lima via LinkedIn</dc:creator>
    <dc:date>2011-10-01T14:46:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47996">
    <title>unexpected procmail recipe behavior</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47996</link>
    <description>&lt;pre&gt;
The procmail manpages say that procmail regexes behave "exactly" as egrep ones.

I'm baffled as to why this conditon:
  * ^References:.*[&amp;lt;]\/[^&amp;gt;][^&amp;gt;]*
sets MATCH to the  _first_ Message-ID on the line, and not the _last_ one.

Standard regex definition is that repeat patterns are 'greedy' -- i.e.,
that given multiple matches at the same starting point, the -longest-
match will be chose.

Thus, to my understanding, the sequence '.*[&amp;lt;] should match evrything up to
the -last- "&amp;lt;" on the line.

and, in fact, using a sed(1) substitution "s/^.*[&amp;lt;]([^&amp;gt;][^&amp;gt;]*)[&amp;gt;].*$/\1/"
I do get the desired last tiem.


Can anyone 'explain this thing to me" or (with apolgies to The Weavers)
should this old fool just put his chamberpot on his head, saddle up his
milk cow, and ride away ?  *GRIN*

I've had to re-write 'modern egrep'-compliant regexes many times, to get
the desired behavior out of procmail. But, how to re-write this one, where
there may be a variable number of '&amp;lt;...&amp;gt;' items on the line, has got me
stumped.


Does anybody have a _detailed_ description of exactly how procmail's 
'internel pattern-match' works?  Saying it 'works like egrep(1)' is 
woefully incomplete/inaccurate, given the changes to egrep's behavior 
that have occured over the years.

You know 'minor', 'insignificant', things like which 'repeat' characters
it recognizes, whether it uses "("/")" or "\("/"\)"  for grouping, whether
it recognizes 'named' character classes -- e.g. " [:upper:]",  how it
resolves 'ambiguous' matches,  etc.    &amp;lt;wry grin&amp;gt;
&lt;/pre&gt;</description>
    <dc:creator>Robert Bonomi</dc:creator>
    <dc:date>2011-09-25T21:09:10</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47992">
    <title>Command time limit exceeded:,    "/usr/bin/procmail"</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47992</link>
    <description>&lt;pre&gt;Hi,

so I am receiving notifications that sometimes incoming mail is bouncing 
due to 'Command time limit exceeded:    "/usr/bin/procmail"'

What is the best way to figure out what is causing this.  I am running 
spamd and also invoking spamc from the .procmailrc .

what is the best method to controlling spam?  using spamd or having a 
local invocation of spamc in each users' homedir .procmailrc ?

here is my procmailrc -  is this file fairly complete or are there other 
options I should be considering?



--- snip ---

PATH=/usr/local/bin:/bin:/usr/bin:$PATH
HOME=/home/&amp;lt;user&amp;gt;
MAILIN=$HOME/mail
DEFAULT=/var/mail/&amp;lt;user&amp;gt;
#MAILDIR=$HOME/Mail
#LOGFILE=$MAILDIR/from
LOCKFILE=/var/mail/&amp;lt;user&amp;gt;.lock
NULL=/dev/null

:0fw: spamassassin.lock
| /usr/bin/spamc

:0
* ^X-Spam-Status: Yes
$MAILIN/Spam

--- snip ---
&lt;/pre&gt;</description>
    <dc:creator>Noah</dc:creator>
    <dc:date>2011-09-03T18:01:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47982">
    <title>Procmailrc start</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47982</link>
    <description>&lt;pre&gt;Hi,

Yes I am a newbie to procmail, so I ask that you point me to some
information so I can start using and understanding this program.

Be kind, I am a KDE user with limited cli usage.

I would like to start using Procmail for email filtering as I currently
have almost 600 filters listed in Mozilla Thunderbird moving email to an
equally large number of folders. The Mozilla filters are failing on
occasions and this is only due to the large number. Doing the recipes in
procmail is going to be LOTS of fun :|

Unfortunately this is a production system and there is no backup. That
is being remedied but in the meantime the procmail filters still need
setting up.

I have obtained and had an introductory read of the book called Procmail
Companion (McCarthy), the procmail homepage, and done significant Google
searching as well as fairly extensive man page work, all without being
able to find an explanation of what the 'default' lines of code would be
for a procmailrc file. Is there a list of the lines of code that could
go in the start of the file, if so where?

If not, what are the bare minimum lines? A full listing of them would be
better as then I can add just the ones needed.

I would assume the following lines of code before the recipes:

Maildir
log
verbose
path

What else before the recipes start?

Appreciated
Hylton
&lt;/pre&gt;</description>
    <dc:creator>Hylton Conacher (ZR1HPC</dc:creator>
    <dc:date>2011-08-26T13:21:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47974">
    <title>Domain based sorting</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47974</link>
    <description>&lt;pre&gt;A certain person in my household who shall remain nameless has a habit of signing up for email newsletters or whatever at a rather astonishing rate, and I’ve been unable to keep up with any sort of sorting methodology that can help her.. errr, can help this nameless person keep up with the mail.

I have tried to setup procmail so that ‘real’ mail gets sent in to the inbox and everything else gets sent into a misc box, but too much ‘real’ mail misses the inbox and it is difficult (for some reason I don’t understand) for this person to search and find the important mail.

Now, this isn’t spam, it’s stuff like amazon, woot, group on, land’s end, and several dozens of others, and all email that, at least in theory, is ‘wanted’

So, my idea was instead of dumping it into Misc.2011-08 I would dump it in misc.&amp;lt;domain&amp;gt; and then as long as she has some clue as to where the mail might be from, she should be able to find it. Er, this unnamed person, that is.

this would be simple if the stupid mailers used Precedence: bulk like they are SUPPOSED to, but let’s not go there.

So, my idea is this:

(cribbed from Sean)

# I’m already doing from here to defining FROM_DOMAIN anyway in the procmailrc
:0 h
CLEANFROM=|formail -IReply-To: -rtzxTo:

# username portion
:0
* CLEANFROM ?? ^\/[^&amp;lt; at &amp;gt;]+
{ FROM_USER=$MATCH }

# domain portion
:0
* CLEANFROM ?? &amp;lt; at &amp;gt;\/.*
{ FROM_DOMAIN=$MATCH }

# Process spam and friends and other real mail here

# add this
:0
* ! FROM_DOMAIN ^^^^
.Misc.${FROM_DOMAIN}/

So, my question isn’t so much how to do this, but rather if anyone has any comments, ideas, suggestions, warnings, caveats, &amp;amp;c?

One thing I will have to fix is that the FROM_DOMAIN will contain, for example, mx3.domain.tld and I want it to contain just “domain”. That’s trivial though (And in fact, I may have to check the procmailrc, but it might already be grabbed into a variable I’ve forgotten about).

&lt;/pre&gt;</description>
    <dc:creator>LuKreme</dc:creator>
    <dc:date>2011-08-18T10:57:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47971">
    <title>procmail and SpamBayes issues</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47971</link>
    <description>&lt;pre&gt;hello

for some reason when my email is processed with procmail and SpamBayes
the email is lost.  I am new at this and I am not sure why. someone
told me that my procmailRC is wrong...  I keep on getting an procmail:
Program failure (2) of "/usr/bin/python" ERROR not sure how to correct
this any help would be much appreciated.  I know that the file is
where it is supose to be but for some reason it cannot be open.

I have included my log and also the procmail config file.

thanks

=======
LOG

From xxxxx&amp;lt; at &amp;gt;abc.com  Sun Aug 14 18:19:13 2011
 Subject: test Sunday
 Folder: /var/mail/edward                                                 2910
procmail: [1818] Sun Aug 14 19:37:25 2011
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "MAILDIR=/Users/edward/Mail/Dovecot"
procmail: Assigning "SPAMBAYESDIR=/usr/local/cutedge/spambayes"
procmail: Assigning
"DELIVER=/usr/local/cutedge/dovecot/libexec/dovecot/deliver -c
/usr/local/cutedge/dovecot/etc/dovecot.conf"
procmail: Assigning "INCLUDERC=/etc/rc.custom1"
procmail: Assigning "LASTFOLDER=cat &amp;gt;&amp;gt; /Users/edward/postbayeslog"
From sentto-2240464-41435-1313364858-xxx=abc.com&amp;lt; at &amp;gt;returns.groups.yahoo.com
 Sun Aug 14 19:37:25 2011
 Subject:  Re: test
 Folder: cat &amp;gt;&amp;gt; /Users/edward/postbayeslog                               15416
procmail: Executing "cat &amp;gt;&amp;gt; /Users/edward/postbayeslog"
procmail: Executing "/usr/bin/python,/sb_filter.py,-f,-p,/hammiedb.pck"
/usr/bin/python: can't open file '/sb_filter.py': [Errno 2] No such
file or directory
procmail: Program failure (2) of "/usr/bin/python"
procmail: Rescue of unfiltered data succeeded
procmail: No match on "^X-SpamBayes-Classification: spam"
procmail: Incomplete recipe
procmail: Assigning
"PATH=/Users/edward/bin:/bin:/usr/bin:/usr/local/bin:/usr/X11/bin"
From sentto-2240464-41435-1313364858-xxx=abc.com&amp;lt; at &amp;gt;returns.groups.yahoo.com
 Sun Aug 14 19:37:25 2011
 Subject: Re: test
 Folder: /var/mail/edward                                                15416


PROCMAIL RC

UMASK7

SHELL=/bin/sh
LOGFILE=/Users/tempo/procmail.log
VERBOSE=on
MAILDIR=/Users/tempo/Mail/Dovecot
SPAMBAYESDIR=/usr/local/cutedge/spambayes
DELIVER='/usr/local/cutedge/dovecot/libexec/dovecot/deliver -c /usr/
local/cutedge/dovecot/etc/dovecot.conf'

INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom1

:0 fw
| /usr/bin/python /usr/local/cutedge/spambayes/sb_filter.py -f -p /
usr/
local/cutedge/spambayes/hammiedb.pck

:0
* ^X-SpamBayes-Classification: spam
{
INCLUDERC=/usr/local/cutedge/etc/rc.sendtodevnull

:0
|  -m Spam
#.Spam/
}

INCLUDERC=/usr/local/cutedge/spambayes/etc/rc.custom2

:0 w
|
&lt;/pre&gt;</description>
    <dc:creator>Edward McKeown</dc:creator>
    <dc:date>2011-08-16T14:48:39</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47963">
    <title>Help with filter-flags</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47963</link>
    <description>&lt;pre&gt;OK - You'll have to read on a bit to see the meaning of the subject.

I have used Procmail for several years, but only rarely write recipes. I
always have to get back up the learning curve when I do.

Clamassassin is a program which will invoke clamd scanning of email to
detect virus and (with the additional SaneSecurity signatures) other
malware. I use it in my current mail chain, calling it from Procmail.
The program is no longer in development and has a bug. I have tried to
contact the author without success, and then it occurred to me that I
could recreate the functionality either with a shell script, or directly
from within Procmail.

The functionality provided by Clamassassin, and which I wish to
recreate, is as follows:
1) It should call clamd.
2) It should add a header X-Clamd-Version (eg. "clamassassin 1.2.4 with
clamdscan / ClamAV 0.97.1/13398/Thu Aug  4 03:15:14 2011") to every mail
to show the version of clamd and sigs being used.
3) It should add a header X-Clamd-Status to every mail which will either
be "No" for clean mail, or "Yes" if malware is detected. This will be
used for subsequent filtering.
4) If malware is detected a third header would be added
"X-Clamd-Report:" which will detail the signature found (eg
"X-Clamd-Report: Sanesecurity.Phishing.Bank.15855.UNOFFICIAL FOUND")
5) If there is a problem with clamd (clamd is not running or there is a
SELinux permission problem etc) It will report the error concisely in
the headers.

Item 5 is the bug in the current version of Clamassassin. It will try to
insert a header with something like "ERROR: Can't connect to clamd:
Permission denied
ClamAV 0.97.1"
which splits over two lines. This causes a corruption of the mbox in
Dovecot.

Pseudocode:
===========

VERSION=Current Clamd Version &amp;amp; Signature Version
Foreach email:
{
IF (clamd produces an error)
  { Mark up the email with a concise header to that effect;
    Stop this recipe and drop return to calling procmail recipe
  }

ELSE
   { Scan the email for malware;
IF (malware detected)
   { mark up header "X-Clamd-Status: Yes"
      mark up header "X-Clamd-Version: VERSION"
       mark up header "X-Clamd-Report: Signature of Malware"
   }

ELSE (message clean)
   { mark up header "X-Clamd-Status: No"
      mark up header "X-Clamd-Version: VERSION"
   }
return to calling procmail recipe
}

Soooo...

This is where I've got to so far:

Using Sean's testing sandbox, the recipe below *kind of* works, but
produces "procmail: Extraneous filter-flag ignored" warnings. I can't
work out how to get rid of them.

Also, I have not yet managed to incorporate the error checking. Can I
have a brace within a brace as in my pseudocode?

Finally, I guess I could also accomplish this with a shell script (my
bash scripting is only *marginally* better than my procmail recipe
writing) would it actually be cheaper or more expensive in processing
terms to shell out to a bash script?

Thanks in advance for any help, suggestions, constructive criticism or
general encouragement...


My first attempt:
===================8&amp;lt;============================================================

#################################################
#
#
# Clamd recipe Version 0.1
#
# Scan for viruses &amp;amp; malware
#

CLAMDSCAN=/usr/bin/clamdscan
CLAMDVERS=`${CLAMDSCAN} -V --stdout`

:0
VIRUS=|${CLAMDSCAN} --no-summary --stdout -

:0fw
* VIRUS ?? ^.*: \/.* FOUND
{
  # Set Virus status to YES and include the virus found
  :0fw
  | formail -b -f -t -I "X-Clamd-Status: Yes"
  :0fw
  | formail -b -f -t -I "X-Clamd-Version: $CLAMDVERS"
  :0fw
  | formail -b -f -t -I "X-Clamd-Report: $MATCH"

  
  # grab the subject, if any
  :0afw
  * ^Subject: \/.*
  { SUBJECT = "${MATCH}" }

  # add the Virus warning message
  :0afw
  | formail -i "Subject: [Virus] ${SUBJECT}"

  # Deliver to Virus Folder
  :0:
  Malware/Virus
}

:0Ew
{
  :0fw
  | formail -b -f -t -I "X-Clamd-Status: No"
  :0fw
  | formail -b -f -t -I "X-Clamd-Version: $CLAMDVERS"
  # Deliver to OK Folder (for testing only)
  # would normally drop through for further processing
  :0:
  Malware/OK
}

===================8&amp;lt;============================================================

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail&amp;lt; at &amp;gt;lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
&lt;/pre&gt;</description>
    <dc:creator>Arthur Dent</dc:creator>
    <dc:date>2011-08-04T15:21:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47962">
    <title>Taste massage, Ignore</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47962</link>
    <description>&lt;pre&gt;Tasting, tasting, one, two, three, tasting.....
This has been a taste, _ONLY_ a taste,
of the tastefully tasteful,
xpresso boredcasting system.

See, I told you to ignore it.....:-)
&lt;/pre&gt;</description>
    <dc:creator>Bill Vance</dc:creator>
    <dc:date>2011-07-28T13:41:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47960">
    <title>Taste Massage, Ignore</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47960</link>
    <description>&lt;pre&gt;
Tasting, tasting, one, two, three, tasting.....
This has been a taste, _ONLY_ a taste,
of the tastefully tasteful,
xpresso boredcasting system.

See, I told you to ignore it.....:-)
&lt;/pre&gt;</description>
    <dc:creator>Bill Vance</dc:creator>
    <dc:date>2011-07-13T07:54:21</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47940">
    <title>MIME headers in Procmail</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47940</link>
    <description>&lt;pre&gt;As I expect everyone is aware, you can use MIME hackery in mail
headers to include non-ASCII text in just about everything other than
the actual e-mail address.  Writing patterns to match MIME stuff is
painful, since there's about a dozen character sets with somewhat
different encoding, and if they do base64 encoding, the coded values
change depending on where in the string the characters are.

So it would be handy if there were an option to interpret all the MIME
and turn all the text into UTF-8 which (assuming they are 8 bit clean)
existing regex code should handle.

Anyone done that?  Thought about it?

Regards,
John Levine, johnl&amp;lt; at &amp;gt;iecc.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. http://jl.ly
&lt;/pre&gt;</description>
    <dc:creator>John Levine</dc:creator>
    <dc:date>2011-07-08T02:59:59</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47939">
    <title>Invitation to connect on LinkedIn</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47939</link>
    <description>&lt;pre&gt;LinkedIn
------------

   
I'd like to add you to my professional network on LinkedIn.

- Emmanuel

Emmanuel Buamah
Computer &amp;amp; Network Security Professional
Ghana

Confirm that you know Emmanuel Buamah
https://www.linkedin.com/e/m7ku6x-gpi3cmuv-2q/isd/3377921001/7Ks6YGpn/


 
&lt;/pre&gt;</description>
    <dc:creator>Emmanuel Buamah</dc:creator>
    <dc:date>2011-06-29T09:36:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47930">
    <title>Help rule</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47930</link>
    <description>&lt;pre&gt;I would help of experts in a procmail. I want to get a message that it
has the header X-Amavis-Alert and change the subject of it, is this
possible? My idea would be:

:0:
* ^X-Amavis-Alert:BAD HEADER,
$MAILDIR/Maildir/.Spam/

My question is how to change the subject of the message and do not know
if he'll understand BAD HEADER (it has a space in it).

&lt;/pre&gt;</description>
    <dc:creator>Márcio Luciano Donada</dc:creator>
    <dc:date>2011-04-01T12:53:51</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47927">
    <title>Replacement for "mimedecode" wanted</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47927</link>
    <description>&lt;pre&gt;Hello *,

I use since many years "mimedecode" in my scripts  and  it  was  working
perfectly up the Debian/Lenny.  OK, some weird mails trigered a malloc()
error.

Now since Debian/Squeeze it is droped and there is no replacement.

Since I need it in bashscripts which are called from  my  ~/.procmailrc,
I can not use pure procmail stuff.

Can someone recommend me an equivalent commandline tool please?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

&lt;/pre&gt;</description>
    <dc:creator>Michelle Konzack</dc:creator>
    <dc:date>2011-03-27T21:54:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.mail.procmail/47922">
    <title>Quick and dirty rebuild of list messages</title>
    <link>http://comments.gmane.org/gmane.mail.procmail/47922</link>
    <description>&lt;pre&gt;I want to rebuild a mailing list based on the gziped mbox files I've downloaded from the list archives. The messages aren't TO anyone, and my mailspool is in Maildir format, so I think the easiest thing to do is just formial -s the file and dump it into a Maildir folder.

Do I HAVE to create a simple procmailrc file to feed the command line or is there a way to just pass ".folder/" as the destination on the command line?

formail -s procmail -m rcfile &amp;lt; mbox

does something like 

formail -s procmail -m "`echo :0\n.folder/`" &amp;gt; mbox work?

(The reason is I actually want to automate this, and it's a lot simple if I don't have to create an rc file).

&lt;/pre&gt;</description>
    <dc:creator>LuKreme</dc:creator>
    <dc:date>2011-03-18T13:16:56</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.mail.procmail">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.mail.procmail</link>
  </textinput>
</rdf:RDF>

