[Dovecot] Dovecot Deliver?
I guess Dovecot has an LDA called deliver. What is it and how do I use it? Or is it ready to be used. can't find any docs on it.
-- Marc Perkel - marc@perkel.com
Spam Filter: http://www.junkemailfilter.com My Blog: http://marc.perkel.com
It appears the recent -test series is the only one to have the deliver agent. It is not in -stable or the "normal" branch (see TODO file).
deliver appears to take just two arguments:
-d user (local user who is to receive the message - default to self) -a path (auth master socket path)
You could try:
deliver -a /var/run/dovecot/login/default < sample.email.txt
Zach.
Marc Perkel wrote:
I guess Dovecot has an LDA called deliver. What is it and how do I use it? Or is it ready to be used. can't find any docs on it.
On Jul 31 2005, Zach Bagnall wrote:
It appears the recent -test series is the only one to have the deliver agent. It is not in -stable or the "normal" branch (see TODO file).
deliver appears to take just two arguments:
-d user (local user who is to receive the message - default to self) -a path (auth master socket path)
You could try:
deliver -a /var/run/dovecot/login/default < sample.email.txt
Zach.
Marc Perkel wrote:
I guess Dovecot has an LDA called deliver. What is it and how do I use it? Or is it ready to be used. can't find any docs on it.
See http://article.gmane.org/gmane.mail.imap.dovecot/5542/match=lda or http://www.dovecot.org/list/dovecot/2005-March/006512.html
(gmane is more searchable so I tend to look there first, though you can probably persuade Google to help with the dovecot.org archives)
I'd consider it pretty beta from what Timo said.
Chris
-- --+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+- Christopher Wakelin, c.d.wakelin@reading.ac.uk IT Services Centre, The University of Reading, Tel: +44 (0)118 378 8439 Whiteknights, Reading, RG6 2AF, UK Fax: +44 (0)118 975 3094
Sounds like something I should wait for.
Zach Bagnall wrote:
It appears the recent -test series is the only one to have the deliver agent. It is not in -stable or the "normal" branch (see TODO file).
deliver appears to take just two arguments:
-d user (local user who is to receive the message - default to self) -a path (auth master socket path)
You could try:
deliver -a /var/run/dovecot/login/default < sample.email.txt
Zach.
Marc Perkel wrote:
I guess Dovecot has an LDA called deliver. What is it and how do I use it? Or is it ready to be used. can't find any docs on it.
-- Marc Perkel - marc@perkel.com
Spam Filter: http://www.junkemailfilter.com My Blog: http://marc.perkel.com
Marc Perkel wrote:
I guess Dovecot has an LDA called deliver. What is it and how do I use it? Or is it ready to be used. can't find any docs on it.
Now you can find some at http://wiki.dovecot.org/moin.cgi/LDA
I'v been using deliver many months on test only system without problems and just started to use it on small mail host couple weeks ago, haven't got any problems there either.
-- Tomi Hakala
Tomi Hakala wrote:
Marc Perkel wrote:
Now you can find some at http://wiki.dovecot.org/moin.cgi/LDA
I'v been using deliver many months on test only system without problems and just started to use it on small mail host couple weeks ago, haven't got any problems there either.
Good job of documenting it too.
I'm using Exim for my MTA. I set up a trick to deliver directly to IMAP folders by using a "-" to separate the name from the folder.
user-folder@domain.com
This delivers to user@domain.com and puts it in the IMAP "folder" for that user. The folder has to already exists for this to work. It's very popular with my users too because it's like each folder has it's own email address.
I suggest Dovecot support this idea, but it would need some configuration settings. My choice of a single "-" for the delimiter between user and folder probably wasn't the best choice. So the delimiter needs to be setable.
deliver-delimiter = "-"
Then mail coming in as:
user[delimiter]folder@domain.com
is delivered to that folder.
This is a very powerful feature and I recommend it for dovecot.
-- Marc Perkel - marc@perkel.com
Spam Filter: http://www.junkemailfilter.com My Blog: http://marc.perkel.com
On Tue, 2005-08-16 at 07:37 -0700, Marc Perkel wrote:
I'm using Exim for my MTA. I set up a trick to deliver directly to IMAP folders by using a "-" to separate the name from the folder.
user-folder@domain.com
This delivers to user@domain.com and puts it in the IMAP "folder" for that user. The folder has to already exists for this to work. It's very popular with my users too because it's like each folder has it's own email address.
I suggest Dovecot support this idea, but it would need some configuration settings. My choice of a single "-" for the delimiter between user and folder probably wasn't the best choice. So the delimiter needs to be setable.
I think the best way to implement this would be to code it using a Sieve script. I'm not sure if it's powerful enough without extensions though (I've only seen simple Sieve scripts), but I think that's the right way to do it..
Timo Sirainen wrote:
On Tue, 2005-08-16 at 07:37 -0700, Marc Perkel wrote:
I'm using Exim for my MTA. I set up a trick to deliver directly to IMAP folders by using a "-" to separate the name from the folder.
user-folder@domain.com
This delivers to user@domain.com and puts it in the IMAP "folder" for that user. The folder has to already exists for this to work. It's very popular with my users too because it's like each folder has it's own email address.
I suggest Dovecot support this idea, but it would need some configuration settings. My choice of a single "-" for the delimiter between user and folder probably wasn't the best choice. So the delimiter needs to be setable.
I think the best way to implement this would be to code it using a Sieve script. I'm not sure if it's powerful enough without extensions though (I've only seen simple Sieve scripts), but I think that's the right way to do it..
Timo,
Would a single Sieve script be able to do this for all users. I'm not familiar with Sieve so would anyone have an example of how to do this?
If sieve can't do this for everyone in a single script then I'd like you to keep thinking about my proposal for direct delivery to folders with some kind of user[delimiter]folder@domain.com syntax. I'm using that and it is very powerful.
On Wed, Aug 17, 2005 at 08:09:44AM -0700, Marc Perkel wrote:
Timo Sirainen wrote:
I think the best way to implement this would be to code it using a Sieve script. I'm not sure if it's powerful enough without extensions though (I've only seen simple Sieve scripts), but I think that's the right way to do it..
Timo,
Would a single Sieve script be able to do this for all users. I'm not familiar with Sieve so would anyone have an example of how to do this?
If you implement that delivery scheme centrally, the big question is how are you going to let each user override it? I don't think it would be a good idea to decide to do that style of delivery for all users-- I certainly wouldn't want it. There are some tagged address that I want to go into their own folders, but more typically I will group mail to different tagged address into common folders, and have many of them simply going into my inbox because that's where I want them
Better to let each user decide how they want their mail delivered, IMHO. If the implementation provides access to match results (as via the upcoming "variables" extension or via some other means such as in mine), it's pretty easy for each user to have this choice.
Now, if your LDA implementation supports include-files or script libraries, you could provide such a thing that each user could choose to invoke. But that's another tangent :-)
mm
Mark E. Mallett wrote:
On Wed, Aug 17, 2005 at 08:09:44AM -0700, Marc Perkel wrote:
Timo Sirainen wrote:
I think the best way to implement this would be to code it using a Sieve script. I'm not sure if it's powerful enough without extensions though (I've only seen simple Sieve scripts), but I think that's the right way to do it..
Timo,
Would a single Sieve script be able to do this for all users. I'm not familiar with Sieve so would anyone have an example of how to do this?
If you implement that delivery scheme centrally, the big question is how are you going to let each user override it? I don't think it would be a good idea to decide to do that style of delivery for all users-- I certainly wouldn't want it. There are some tagged address that I want to go into their own folders, but more typically I will group mail to different tagged address into common folders, and have many of them simply going into my inbox because that's where I want them
Better to let each user decide how they want their mail delivered, IMHO. If the implementation provides access to match results (as via the upcoming "variables" extension or via some other means such as in mine), it's pretty easy for each user to have this choice.
Now, if your LDA implementation supports include-files or script libraries, you could provide such a thing that each user could choose to invoke. But that's another tangent :-)
mm
I've had this feature on my email server for several years and never had anyone ask about turning it off. In fact it never occurred to me that someone wouldn't want it. If you don't want to use it you just wouldn't have anyone email you to your unpublished folder addresses. I don't know of any down side to have it there.
On Wed, Aug 17, 2005 at 02:36:05PM -0700, Marc Perkel wrote:
I've had this feature on my email server for several years and never had anyone ask about turning it off. In fact it never occurred to me that someone wouldn't want it.
Yeah, I probably have a number of admin-type decisions like that too :-) Sometimes people just assume "that's the way things work," and you don't get feedback about alternatives. In fact that's often frustrating.
If you don't want to use it you just wouldn't have anyone email you to your unpublished folder addresses.
That's not really a great alternative, though, unless I misunderstand you... which is likely. Extended addresses (subaddresses, what-have-you) are good; being able to file them the way you (as an end user) want them filed is good; having the admin say "don't use them if you don't want them filed the way I tell you to" is not as good.
My perspective, anyway. OTOH I often tend to think that users want more control than they really do.
mm
I've had this feature on my email server for several years and never had anyone ask about turning it off. In fact it never occurred to me that someone wouldn't want it. If you don't want to use it you just wouldn't have anyone email you to your unpublished folder addresses. I don't know of any down side to have it there.
if the convention is widespread, publication is unnecessary. what if spammers start sending e-mail to marc-Drafts@perkel.com ?
-- Kjetil T.
On Tue, 16 Aug 2005, Marc Perkel wrote:
I'm using Exim for my MTA. I set up a trick to deliver directly to IMAP folders by using a "-" to separate the name from the folder.
user-folder@domain.com
Sendmail has been using something called "detail" using the "plussed" syntax for a long time: quote from cd/README:
"The local mailer accepts addresses of the form "user+detail", where the "+detail" is not used for mailbox matching but is available to certain local mail programs (in particular, see FEATURE(`local_procmail')). For example, "eric", "eric+sendmail", and "eric+sww" all indicate the same user, but additional arguments <null>, "sendmail", and "sww" may be provided for use in sorting mail."
It cuts the "+<<detail>>" part before delivering, but one can pass it forth to the MDA/LDA, e.g.:
sensible-mda $g $u $h ${client_addr}
Here, the "$h" passes forth the detail (without the '+'). However, one can configure sendmail to keep the "+detail" part when invoking the MDA.
Sendmail uses the detail itself, e.g. when doing alias expansion or parsing the .forward files.
I would assume this should become an option for the dovecot-lda.
Bye,
-- Steffen Kaiser
Tomi Hakala wrote:
Now you can find some at http://wiki.dovecot.org/moin.cgi/LDA
Looks very nice, thanks.
But some questions remain: The LDA seems to need /var/run/dovecot/auth-master, which isn't provided by default by dovecot. Do I need to change my dovecot.conf so that I have a "socket listen { master ... client }" part? Is this going into the "auth default" I already have or into a new auth section? dovecot-auth is running chrooted, will this interfere with the master/client concept, so I have to change the socket path to be in the chrooted directory?
And I wonder if this LDA is really a good way to go. I dumped maildrop to save the overhead of fork/exec for every message delivery, but deliver (after strip) is about double the size of maildrop. AFAIK, Cyrus uses LMTP for delivery, which does not have this downside.
On Wed, 2005-08-17 at 03:04 +0200, Jakob Hirsch wrote:
Tomi Hakala wrote:
Now you can find some at http://wiki.dovecot.org/moin.cgi/LDA
Looks very nice, thanks.
But some questions remain: The LDA seems to need /var/run/dovecot/auth-master, which isn't provided by default by dovecot. Do I need to change my dovecot.conf so that I have a "socket listen { master ... client }" part?
Only the master socket.
Is this going into the "auth default" I already have or into a new auth section?
Inside auth default.
dovecot-auth is running chrooted, will this interfere with the master/client concept, so I have to change the socket path to be in the chrooted directory?
The socket is created before chrooting (I'm pretty sure anyway :)
And I wonder if this LDA is really a good way to go. I dumped maildrop to save the overhead of fork/exec for every message delivery, but deliver (after strip) is about double the size of maildrop. AFAIK, Cyrus uses LMTP for delivery, which does not have this downside.
That works only as long as all (or "most", with more code) users use the same system UIDs. LMTP server is in my TODO list, but not before v1.0..
Anyway I think the benefit of having the mail immediately indexed is overall greater than a bit of forking/initialization overhead.
Timo Sirainen wrote:
have a "socket listen { master ... client }" part? Only the master socket. Inside auth default.
Thanks. I see this is now in the wiki (or was before and I overlooked it).
As I understand, Sieve is only in CVS, right? I want to use it, but it failed to build:
# ./autogen.sh
configure.in: installing ./install-sh' configure.in: installing
./missing'
src/Makefile.am: installing ./depcomp' src/libsieve/Makefile.am:3:
CFLAGS' is a user variable, you should not
override it;
src/libsieve/Makefile.am:3: use AM_CFLAGS' instead. Makefile.am: installing
./INSTALL'
configure.in:4: required file `lda-config.h.in' not found
Running it again looks better:
# ./autogen.sh
src/libsieve/Makefile.am:3: CFLAGS' is a user variable, you should not override it; src/libsieve/Makefile.am:3: use
AM_CFLAGS' instead.
# ./configure --with-dovecot=../dovecot (../dovecot is dovecot-1.0-test80)
but the make fails:
gcc -std=gnu99 -g -O2 -Wall -W -Wmissing-prototypes
-Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2
-Wbad-function-cast -I/usr/kerberos/include -o deliver deliver.o
duplicate.o imparse.o mail-send.o map.o sieve-cmu.o smtpclient.o
-Wl,--export-dynamic libsieve/libsieve.a
/root/sw/dovecot/lda/dovecot/src/lib-storage/register/libstorage-register.a
/root/sw/dovecot/lda/dovecot/src/lib-storage/index/maildir/libstorage_maildir.a
/root/sw/dovecot/lda/dovecot/src/lib-storage/index/libstorage_index.a
/root/sw/dovecot/lda/dovecot/src/lib-index/libindex.a
/root/sw/dovecot/lda/dovecot/src/lib-storage/libstorage.a
/root/sw/dovecot/lda/dovecot/src/lib-storage/subscription-file/libstorage_subscription_file.a
/root/sw/dovecot/lda/dovecot/src/lib-imap/libimap.a
/root/sw/dovecot/lda/dovecot/src/lib-mail/libmail.a
/root/sw/dovecot/lda/dovecot/src/lib-charset/libcharset.a
/root/sw/dovecot/lda/dovecot/src/lib/liblib.a -ldl
deliver.o(.text+0xa60): In function main': /root/sw/dovecot/lda/dovecot-lda/src/deliver.c:364: undefined reference to
mbox_from_create'
collect2: ld returned 1 exit status
make[3]: *** [deliver] Error 1
make[3]: Leaving directory /root/sw/dovecot/lda/dovecot-lda/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory
/root/sw/dovecot/lda/dovecot-lda/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/sw/dovecot/lda/dovecot-lda'
make: *** [all] Error 2
seems that the lda doesn't like "--with-storages=maildir" on the configure of dovecot itself (I use no mbox), after running dovecot's configure and make without this made me a working deliver binary with sieve.
dovecot-auth is running chrooted, will this interfere with the master/client concept, so I have to change the socket path to be in the chrooted directory? The socket is created before chrooting (I'm pretty sure anyway :)
Seems you are right. :)
Only one little problem arised: deliver wants to use /var/run/dovecot/auth-master as a default, but /var/run/dovecot is owned by root with 0700 permissions (set by dovecot at startup). but deliver never runs as root, so this fails. No big thing, I changed the path (-a /another/path), but the default makes little sense, then. Is there an option to set the path in dovecot-deliver.conf?
deliver (after strip) is about double the size of maildrop. AFAIK, Cyrus uses LMTP for delivery, which does not have this downside. That works only as long as all (or "most", with more code) users use the same system UIDs.
Isn't that depending on how it's done? If implemented as an additional protocol handled directly by dovecot, it should work. Anyway, I configured every virtual setup with only one UID.
LMTP server is in my TODO list, but not before v1.0..
That's fine with me.
Anyway I think the benefit of having the mail immediately indexed is overall greater than a bit of forking/initialization overhead.
I'll trust you on this. :)
Timo Sirainen wrote:
...
Ok, converted my Exim filter file to Sieve (which I probably should have used with Exim anyway) and everything seems to work fine.
Only that ... deliver creates an empty directory "mail" in the virtual user's home. I have only "mail = maildir:%h/Maildir" (same as default_mail_env in dovecot.conf). Harmless, but a little disturbing.
... is there a way to get reasonable logging? "use_syslog" is a little strange: Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 16 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 104 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 116 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 200 [...]
Something like "message <$MSGID> for $USER: $action" where $action is a list of performed actions: fileinto some.folder, fileinto another.folder, redirect who@ever, discard, keep, implicit keep. I'd understand if this might be not very high on your priority list, though...
On Thu, 2005-08-18 at 01:13 +0200, Jakob Hirsch wrote:
Timo Sirainen wrote:
...
Ok, converted my Exim filter file to Sieve (which I probably should have used with Exim anyway) and everything seems to work fine.
Only that ... deliver creates an empty directory "mail" in the virtual user's home. I have only "mail = maildir:%h/Maildir" (same as default_mail_env in dovecot.conf). Harmless, but a little disturbing.
But it still delivers mails to maildir? There are no hardcoded "mail" directories in LDA code, so it sounds like it's not using the mail setting at all..
... is there a way to get reasonable logging? "use_syslog" is a little strange: Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 16 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 104 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 116 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 200 [...]
These are some debug things that the original libsieve code sends. I have no idea what they mean. Maybe I should just comment them out.
Something like "message <$MSGID> for $USER: $action" where $action is a list of performed actions: fileinto some.folder, fileinto another.folder, redirect who@ever, discard, keep, implicit keep. I'd understand if this might be not very high on your priority list, though...
I guess that'd be useful.. I'll add in TODO.
Timo Sirainen wrote:
... deliver creates an empty directory "mail" in the virtual user's home. I have only "mail = maildir:%h/Maildir" (same as default_mail_env in dovecot.conf). Harmless, but a little disturbing. But it still delivers mails to maildir? There are no hardcoded "mail" directories in LDA code, so it sounds like it's not using the mail setting at all..
Mail is perfectly delivered into the Maildir folders. Don't know, what's going on, here is an strace:
chdir("/var/spool/vmail/jh") = 0 lstat64("/var/spool/vmail/jh/Maildir/cur", {st_mode=S_IFDIR|0700, st_size=1744, ...}) = 0 lstat64("/var/spool/vmail/jh/Maildir/new", {st_mode=S_IFDIR|0700, st_size=48, ...}) = 0 lstat64("/var/spool/vmail/jh/Maildir/tmp", {st_mode=S_IFDIR|0700, st_size=264, ...}) = 0 access("/var/spool/vmail/jh/mail", R_OK|W_OK|X_OK) = -1 ENOENT (No such file or directory) access("/var/spool/vmail/jh/Mail", R_OK|W_OK|X_OK) = -1 ENOENT (No such file or directory) stat64("/.imap", 0xbffa6a7c) = -1 ENOENT (No such file or directory) stat64("/inbox", 0xbffa69ec) = -1 ENOENT (No such file or directory) stat64("/mbox", 0xbffa69ec) = -1 ENOENT (No such file or directory) mkdir("/var/spool/vmail/jh/mail", 0770) = 0 access("/var/mail/vmail", R_OK|W_OK) = -1 ENOENT (No such file or directory) access("/var/spool/mail/vmail", R_OK|W_OK) = -1 ENOENT (No such file or directory) fcntl64(0, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE)
For some reason, the lda looks for directories/files that have nothing to do with Maildir, I think. My "auth default" section uses the static userdb with "args uid=103 gid=104 home=/var/spool/vmail/%Lu", so I only set home, not mail.
btw, I just saw that the current lda (from CVS) compiles .dovecot.sievec everytime (.dovecot.sieve didn't change, of course).
Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 16 Aug 18 00:30:09 ymmv deliver: entered bc_action_emit with filelen: 104 These are some debug things that the original libsieve code sends. I have no idea what they mean. Maybe I should just comment them out.
Probably they are thrown out while the message is read, to show progress. But it's surely only useful for (heavy?) debugging, not for normal operation, so commenting out is a good idea, I think.
And sorry :), I have more things:
cosmetic: dovecot complains at every startup "auth(default): bind(/var/spool/vmail/auth-master) failed: Address already in use". The message seems to be harmless, only a little confusing. btw, most programs delete sockets at termination, AFAIK.
Is it possibly to install the lda so that every system user can use it? Even SETUID root didn't work.
participants (9)
-
Chris Wakelin
-
Jakob Hirsch
-
Kjetil Torgrim Homme
-
Marc Perkel
-
Mark E. Mallett
-
Steffen Kaiser
-
Timo Sirainen
-
Tomi Hakala
-
Zach Bagnall