[Dovecot] OT: Run Sieve On A Mailbox Manually

Neil neil at voidfx.net
Sat Nov 22 21:48:40 EET 2008


On 22 Nov 2008, at 12:55, Ben Winslow wrote:

> On Fri, 21 Nov 2008 23:51:11 -0500
> Neil <neil at voidfx.net> wrote:
>
>> (Apologies for being offtopic.)
>>
>> The subject basically says it all...does anyone know of a tool to
>> run a sieve script on a mailbox (in particular, Maildirs) manually?
>> Ideally, I'd like to do it without adding a bunch of new headers to
>> the mail.
>>
>> So, could I just do a find (or for-loop, if it was just one maildir)
>> command and pipe all the mails into deliver..?
>
> That should work fine, although Sieve won't know the envelope from or
> to.  You can easily add the envelope to address on the command line if
> you want to use the same one for every message, but adding the  
> envelope
> from is a little trickier -- the envelope from isn't standardized in
> Maildir, so you'll have to try to pull it from the message headers.
>
> If you want to run sieve on all the messages in an mbox file, you  
> could
> use formail from procmail in place of your for loop (e.g. formail -s
> deliver < mboxfile.)

Why would deliver need to know the envelope to/from ?  It wouldn't  
just use the To: and From: headers?


More information about the dovecot mailing list