Creating a backup of incoming mail

LuKreme kremels at kreme.com
Mon Sep 1 16:46:58 UTC 2014


On 30 Aug 2014, at 10:33 , Oscar del Rio <delrio at mie.utoronto.ca> wrote:

> You could use a global "sieve_before" filter.
> 
> http://wiki2.dovecot.org/Pigeonhole/Sieve/Configuration

And, I get hampered on the very first step:

To use Sieve, you will first need to make sure you are using Dovecot LDA or LMTP for delivering incoming mail to users' mailboxes. Then, you need to enable the Pigeonhole Sieve plugin in your configuration:

protocol lda {
  mail_plugins = $mail_plugins sieve
}

OK, so I am using dovecot-lda via postfix/master.cf, but in my configuration I have a section tagged protocols, not protocol.

Don't know if this is the same thing, or a slightly different thing. I don't know where/what $mail_plugins refers to, and there is no "plugins" section of my configuration file. In fact, the string "plug" doesn't appear in dovecot.conf (there are some commented lines for mail_plugins in conf.d/ files).

Then, sieve_global_path is deprecated, but despite being tagged as deprecated, the example config uses the sieve_global_path. Shouldn't the example use sieve_default?

Looks like further down is the sieve_before, but really, the documentation feels almost like it has set out with the intention of being as obtuse as possible.

If I understand it, and I am sure I do not, what I need to add in to dovecot.conf is something like this:

protocol lda {
  mail_plugins = $mail_plugins sieve
}

(which is separate and unrelated to my "protocols = imap" existing line in dovecot.conf)

plugin {
   sieve = ~/.dovecot.sieve
   sieve_before = /var/lib/dovecot/sieve/archive.sieve
}

And then in archive.sieve I find out what the commands are to write a COPY of the mail to a location after getting the date info.

require ["variables","date","fileinto","mailbox"];

if currentdate :matches "year" "*" { set "year" "${1}"; }
if currentdate :matches "month" "*" { set "month" "${1}"; }

And a command like this, but not this, since i wan the backup stores in an absolute path outside the IMAP store and I obviously only want a copy of that message.

  fileinto :create "INBOX.Lists.${year}.${month}.dovecot";
}

-- 
Did they get you to trade your heroes for ghosts? Hot ashes for trees?
Hot air for a cool breeze? Cold comfort for change?



More information about the dovecot mailing list