[Dovecot] Undertanding what the lmtp_save_to_detail_mailbox actually does
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
- I could then send to something more simple like <senderlocalpart>+saveoutgoing and use the "date" extension of sieve to generate the split.
- 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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 10 Feb 2014, Alan Chandler wrote:
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?
<uid>+Sent@...
<uid>+users.
I think, you must use mUTF7 for non-ASCII characters, you cannot use spaces and @ and many other characters impose problems. Also, which hierarchie separator you need to use, depends a little, just try with dots and the configured separator.
Also, for testing I advice to enable lda_mailbox_autocreate, in order to see when you did wrong and can try another spelling.
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.
that's not the problem with the variables extension. See http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples and search for
fileinto "users/${name}";
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUvnUL3D1/YhP6VMHAQLoSQf/a1w1WILx/7e0uvabPlv5OhuQR2Hjmgnc wVDU4B495OVj7gCSLiV+UK4KmpGHWwB5CcNuoL5tE0XmV9mYwCQxhTw5X8evY7cw 39dbY92tCyCE+pxl1SG14oZ9En/9Ul99NIKGN9iionyzq+xrBzUQu/xnhRJaHRC+ axXfVi5fGnEZ7Xu0umXSF3JpmqZTdmp/FSSk209etvNMavBTCebm3MGmFr6c03YD uDiqwEj7aRR9vG7jls3nYiDi7+S+cJNvl0n5fTLA+RvDaxHdvkzIlJq4bUxEnJXJ WJlqsztWkP1WdsHTfM03z7ZSopv/11e4DBNttjPODrD/ravqtNdjfQ== =WvWW -----END PGP SIGNATURE-----
On 11/02/14 07:41, Steffen Kaiser wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Mon, 10 Feb 2014, Alan Chandler wrote:
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?
<uid>+Sent@... <uid>+users.
.SentNow@... <uid>+Archive.2013-01@... I think, you must use mUTF7 for non-ASCII characters, you cannot use spaces and @ and many other characters impose problems. Also, which hierarchie separator you need to use, depends a little, just try with dots and the configured separator.
Also, for testing I advice to enable lda_mailbox_autocreate, in order to see when you did wrong and can try another spelling.
Thanks - just what I needed to know.
I was about to set up an experiement, but I have to get postfix setup first (as a vehicle for delivering mail to lmtp) and there are aspects of that that I haven't got nailed yet.
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.
that's not the problem with the variables extension. See http://wiki2.dovecot.org/Pigeonhole/Sieve/Examples and search for
fileinto "users/${name}";
Brilliant - even better. I had searched for quite some time looking for that and hadn't found it.
Thanks
Alan Chandler
participants (2)
-
Alan Chandler
-
Steffen Kaiser