[Dovecot] OT: Run Sieve On A Mailbox Manually
(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..?
Thanks, Neil.
On Fri, 21 Nov 2008 23:51:11 -0500 Neil neil@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.)
Thanks, Neil.
-- Ben Winslow rain@bluecherry.net
On 22 Nov 2008, at 12:55, Ben Winslow wrote:
On Fri, 21 Nov 2008 23:51:11 -0500 Neil neil@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?
On Sat, 22 Nov 2008 14:48:40 -0500 Neil neil@voidfx.net wrote:
Why would deliver need to know the envelope to/from ? It wouldn't
just use the To: and From: headers?
Sieve distinguishes between the envelope and message to/from. I filter some mailing lists on the envelope from, since it's usually always the same or in a fixed format. If none of your rules filter on the envelope from/to, you should be fine running deliver without that info.
-- Ben Winslow rain@bluecherry.net
participants (2)
-
Ben Winslow
-
Neil