[Dovecot] procmail/formail --> Maildir

Andre Huebner andre.huebner at gmx.de
Mon Dec 3 14:58:17 EET 2007


Hello,

thanks. I will test it in a few days. This week just holidays ;)

Sure, its just a modified example. Reason is to mark mails later graphical 
in a webmailer using some procmail/formail technics.

I think, if i activate the dovecot convert plugin nothig of my procmail must 
be changed. (just only the bugs ;)  ) Mails will be deliverd in mbox format 
to
/var/spool/mail/xxxxx
On Userlogin dovecot is picking up Mails and deliver them to maildir-inbox. 
Don't know if this is a very Feasible way, not really clean...
http://wiki.dovecot.org/Plugins/Convert?highlight=%28convert_mail%29

Thanks

André

----- Original Message ----- 
From: "Karsten Bräckelmann" <guenther at rudersport.de>
To: <dovecot at dovecot.org>
Sent: Monday, December 03, 2007 12:46 PM
Subject: Re: [Dovecot] procmail/formail --> Maildir


> On Mon, 2007-12-03 at 11:02 +0100, Andre Huebner wrote:
>> i switched mailformat from mbox to maildir. Now i have a little
>> problem with procmail/formail and headermanipulation of mails.
>>
>> Here an example:
>>
>> 0
>> * ^From.*gmx.de
>> | (formail -t -I"procmail: gmx.de") >> /var/spool/mail/xxxxxx
>
> I would never do it that way anyway. You are bluntly appending the mail
> to the raw spool (or mbox file) without any locking. Instead, make
> procmail deliver the mail properly, figuring out the correct locking
> method.
>
>
>> So, i can add some different headerlines for later evaluation and the
>> result is attached to inbox.
>                        ^^^^^
>> Now i have the problem that i don't know name of targetfile, cause it
>> is unique for every mail if maildir is used.
>                              ^^^^^^^
> You made that example up, instead of copy-n-paste'ing real life procmail
> receipts, right? Isn't the default system spool still an mbox file, even
> when using Maildir?
>
> Anyway, again -- let procmail figure out how to properly deliver the
> mail. For Maildir storage, just use the directory name, including the
> trailing slash. See 'man procmailrc'. Example below.
>
>
>> I did not found a Option or other workaround to solve this case.
>> I know, it is not a dovecot problem but i hope somebody can give a
>> hint.
>>
>> Could it be a possibility to leave all unchanged? Mails could be
>> transported to /var/spool/mail/xxxxxx and picked up by dovecot if in
>> dovecot.conf the convert-plugin ist always activated?
>
> No. At the very least you need to tell procmail you are using Maildir
> instead if mbox for any delivery receipt.
>
>
> Note: Example untested.
>
> # Set the Maildir prefix, and have the Inbox in there, too.
> MAILDIR=$HOME/Maildir/
> DEFAULT=$MAILDIR
>
> # Filter through formail, appending some custom header.
> :0 fw
> * ^From.*gmx.de
> | formail -I "X-procmail: gmx.de"
>
> # Keep mailing list traffic out of my Inbox. Let procmail care about
> # proper locking.
> :0 :
> * ^List-Id: .+<dovecot.dovecot.org>
> .mailing-lists.dovecot/
>
> # Someone loves me. :)  Whatever survived till this point will get
> # delivered to the $DEFAULT Maildir.
>
>
> Now, some words about that obscure tagging with formail. :)
>
> Since you are using procmail with gmx.de (which does offer POP3 only for
> free) I assume you are harvesting your mail using fetchmail.
>
> Also, I assume the above example isn't actually what you use. It feels
> rather useless to add a custom header for that. Your receipt above will
> match on any From: header with a gmx.de substring, too. Which includes
> the real name. Besides, you can directly evaluate that header anyway...
>
> I guess you actually mean to tag all mail fetched from the gmx.de POP3
> account. In that case, have a look at the fetchmail "tracepolls" option.
> It will add info like "polling $server account $user" to the procmail
> generated Received: header. You can directly filter on that header using
> procmail, instead of a custom added one. If this is your use case, the
> tracepolls option is the only accurate method anyway. Short of using
> dedicated local users. ;)
>
> HTH
>
>  guenther
>
>
> -- 
> char 
> *t="\10pse\0r\0dtu\0. at ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4";
> main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? 
> c<<=1:
> (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ 
> putchar(t[s]);h=m;s=0; }}}
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.503 / Virus Database: 269.16.12/1163 - Release Date: 
> 01.12.2007 12:05
>
> 



More information about the dovecot mailing list