[Dovecot] Undertanding what the lmtp_save_to_detail_mailbox actually does

Alan Chandler alan at chandlerfamily.org.uk
Mon Feb 10 21:53:58 UTC 2014


Hi

I am just learning to setup dovecot as part of a project to move my home 
mail serving from a large and complex linux computer which is acting as 
internet router/nat gateway to the internet (this leaving me exposed 
without internet connection when it goes down) to a raspberry pi - which 
will be port-forwarded to, when I turn my internet cable modem back into 
a router/modem.

I have chosen to try and do this with a Postfix/Dovecot combination with 
some key user information coming from an sqlite database. Postfix will 
use Dovecot for authentication (where needed) and use its lmtp service 
for local delivery.

I have so far got Dovecot working fine for the basic stuff, including 
using rsync to copy each of my users entire maildir from the old machine 
to the new to prove that it can be accessed.

but I have one last specific piece of functionality I want to achieve 
that the old system does (and has been doing) for at least 5 years (that 
is what is still online - I think I have "archived" some older stuff).

The existing environment uses a Exim4/Cyrus IMAP combination and with 
Exim I have managed to develop the rules so that all outgoing mail from 
my internal clients is copied into a subdirectory of their sent mail 
folder.  The format of the folder is Sent.yyyy.mm where yyyy and mm are 
computed on the fly from todays date.  (the .separator defining a 
subfolder in the hierarchy) I now have several years of saved messages 
in my existing system.

Postfix has nowhere near the flexibility of Exim to develop rules like 
that, but I think I could potentially use an sql query on my user 
database to set up a sender_bcc_map that addressed the result to <sender 
local part>+Sent.<yyyy>.<mm>  (or 
maybe<senderlocalpart>+Sent/<yyyy>/<mm> and then send that to dovecot.

I have then to decide how to handle it.

The problem I am facing is I can find no documentation about what 
lmtp_save_to_detail_mailbox actually causes lmtp to actually do. 
Searching the wiki refers to it only in the LMTP page.

How should the detail of the address be formatted to specify a 
subdirectory - can it be specified even? Should I be using it?

I have seen comments in the past about people recommending using sieve 
for this sort of thing. and indeed it might be better if I could figure 
it out, in that

1) I could then send to something more simple like 
<senderlocalpart>+saveoutgoing and use the "date" extension of sieve to 
generate the split.
2) Users could ultimately decide what to do them selves with this tag 
(and I could define a global "after_sieve" to throw it away.

Unfortunately my reading of the fileinto extension is that the 
destination can only be a literal string and not a "computed" value 
based on the date.

UNLESS anyone knows different?

I would welcome any advice anyone could give me

Thanks

Alan Chandler








More information about the dovecot mailing list