Archive
Tested: 2+ weeks live, tests written and passed
Description^
The archive module can be used to archive any passing mail. You can store all mails in a structured directory, based on the recipient or sender domain / address and date. You have to compress the archived mails yourself, but this should be no big problem if you use a time-variable in the archive_dir path and compress old folders.
Configuration^
archive_dir^
Default: -
Allowed values: String (path name with variables)
The archive modules will store any mail in this directory. The directory might contain variable names and will create non existing directories on the fly.
Variables are:
- %ym%
Year-month .. eg 2010-06 - %ymd%
Year-month-day, eg 2010-06-15 - %recipient_domain%
The name of the recipient domain (somedomain.tld). Defaults to “unknown” (if not given) - %recipient_prefix%
The prefix part of the recipient domain .. for someone@somedomain.tld this would be “someone”. - %recipient_address%
The whole recipient address (someone@somedomain.tld) - %sender_domain%, %sender_prefix%, %sender_address%
Same as recipient, but for sender
Examples^
- /var/spool/archive/%ymd%/%recipient_domain%/%recipient_prefix%/
/var/spool/archive/2010-01-25/somedomain.tld/username/mail-123213123-asd213.eml - /var/spool/archive/%ymd%/%recipient_domain%/%recipient_prefix%
/var/spool/archive/2010-01-25/somedomain.tld/username-123213123-asd213.eml - /var/spool/archive/%ym%/%recipient_address%/
/var/spool/archive/2010-01/username@somedomain.tld/mail-123213123-asd213.eml
Each mail has to be unique, therefore the (unix) timestamp and a random, 6 char length string will be suffixed.
drop^
Default: 0
Allowed values: Bool (0 or 1)
If this is enabled, any archived mail will be dropped and not further forwarded (useful if you have an archive-only MTA instance).
Example^
--- disable: 0 archive_dir: /var/spool/decency/archive/%ymd%/%recipient_domain%/%recipient_prefix% drop: 0
My Name is Ulrich Kautz and this is my private blog about server administration, perl programming and some other stuff that is on my mind. I study part-time computer sience at FU Berlin and work as sys admin and web developer at our hosting company