[imapfilter-devel] fetchtext... storetext?

Cedric Pradalier cedric.pradalier at inrialpes.fr
Sun Jun 13 11:37:16 EEST 2004


According to David DeSimone, on Sun, 13 Jun 2004 02:28:02 -0500, 
>Hello, I am a new imapfilter user.
>
>Currently I am using fetchmail to pull my mail from an IMAP server, run
>it through procmail for filtering, and store it locally.  However, I
>would really prefer to leave my mail on the IMAP server instead, and I
>have found imapfilter as an excellent candidate for doing just that.
>
>I have managed to find good substitutes for nearly all of my current
>procmail rules, but I am curious about two things:
>
>1.  I would like to use spamassassin to detect and filter spam messages
>    and send them to a folder for storage.
>
>2.  I would like to make some changes to some of the headers of
>incoming
>    messages.
>
>
>One way to implement spamassassin is to use the fetchtext() and
>pipe_to() methods, piping each message to the "spamc -c" program, and
>then checking the returned exitvalue to decide whether the message
>should move to another folder or not.  However, this solution loses
>some of spamassassin's functionality (such as producing a spam report
>and making it part of the message).  If I am curious how spamassassin
>scored a message, I would have to do extra work.. but this may be
>acceptable.
>
>However, in the second case, I cannot see any way to do it.  Let me
>give an example:
>
>I often receive mailing list messages that look like this:
>
>    Subject: [mailing-list-message] Some mail from mailing-list about
>    "xyz"
>
>In each case, the junk at the start of the Subject is the same, so when
>there are several of these in a mailbox, the subjects are usually cut
>off, and it looks like this:
>
>    Subject: [mailing-list-message] Some mail from mailing-list abou
>    Subject: [mailing-list-message] Some mail from mailing-list abou
>    Subject: [mailing-list-message] Some mail from mailing-list abou
>
>For this case I have a procmail rule that modifies the subject,
>removing the constant parts and producing subjects that can be easily
>read at a glance:
>
>    Subject: xyz
>    Subject: Re: xyz
>    Subject: abc
>
>I can use imapfilter's fetchheader() method to grab the headers I want,
>but it seems there is no corresponding storeheader() method that will
>allow me to replace the modified headers back on the message.  Is this
>functionality planned for a future version of imapfilter?  Or maybe it
>is available but I missed it somehow?
>
>It occurs to me that if I had "store" methods to match the "fetch"
>methods, that I could also better solve my spamassassin problem, by
>letting spamassassin modify the message and then let me store the
>modified message back to the IMAP server.
>
>Is anyone else doing similar things with imapfilter?  I have seen some
>amazing examples already posted to this list.  Thanks very much for
>sharing.  :)
>

Sorry for the out of topic answer, but you may want to have a look at
offlineimap. A good tool to do this loop (get/modify/put). 

Nevertheless, if offlineimap can do it, then imapfilter should be able
also, shouldn't it ?


-- 
Cedric

"[Of course] I'm French! Why do think I have this outrageous 
accent, you silly king-a?!"  Monty Python and the Holy Grail




More information about the Imapfilter-devel mailing list