Re: [Dovecot] deliver to subfolder with dovecot's LDA
On Fri, March 16, 2007 8:12 pm, Tom Bombadil <grlists@gmail.com> said:
$ deliver --help Usage: deliver [-c <config file>] [-d <destination user>] [-m <mailbox>] [-f <envelope sender>]
So for the example above, you can call it like this:
$ deliver -d joe@abc.com -m spam
To do this from Postfix, /etc/postfix/master.cf:
dovecot unix - n n - - pipe flags=DRhu user=virtual argv=/usr/libexec/dovecot/deliver -d ${recipient} -f ${sender} -m ${extension}
However, I think LDA freaks out if you pass -m "". So this might not work when there is no "+folder".
Timo: Should -m treat empty string as if -m was not passed at all?
Bill
On Fri, 2007-03-16 at 22:41 -0400, Bill Boebel wrote:
OK, done:
- empty mailbox name is ignored
- added -n parameter to disable autocreating mailboxes
- if saving to specified mailbox fails, it fallbacks to saving to INBOX.
Op vr, 16-03-2007 te 22:41 -0400, schreef Bill Boebel:
I have this setup like that, although without the -f and -m options. Anyway, it seems that postfix first tries to run deliver with $recipient=joe+spam, and deliver happily creates a new mailbox 'joe +spam'. Any idea how to solve this?
The postfix documentation says it first tries to deliver to 'joe+spam', and then to 'joe'. I'm not sure why deliver just accepts the user+ext name, and creates a new folder.
Koen
Op zo, 18-03-2007 te 17:39 +0200, schreef Timo Sirainen:
A new folder with the name "joe+spam" into the virtual domains folder. I guess that's what you call a new user. The mail doesn't arrive in joe's mailbox, or anywhere in his maildir.
Thanks!
Koen
Op zo, 18-03-2007 te 23:13 +0200, schreef Timo Sirainen:
Yes, right on! Your remote debug-skills are amazing... Normally, postfix already does the user check, so if I send a mail to an non-existent user, postfix rejects it. Therefore, I never noticed this before.
Now, this behaviour of deliver isn't what I would expect. Any chance on a fix for this, or a notice in the config-file or the wiki about why this is happening?
Thanks!
Koen
On Sun, 2007-03-18 at 22:30 +0100, Koen Vermeer wrote:
So you are using static userdb? I'm not sure how this could be fixed. Especially if you're using passdb PAM + userdb static it could be impossible for Dovecot to verify if the user exists (I don't think PAM_USER_UNKNOWN reply can be relied on, plus it could do 2 second delays for each user "lookup" because the password is wrong). With other passdbs it would be possible, but that's again userdb static specific so I don't think I'll bother..
But yes, I could mention this in LDA's wiki page.
Yes. I'm using ldap passdb + static userdb.
I fixed this in exim: If the address is joe+spam@abc.com, I use exim's appendfile transport (and no indexing is done). If the address is joe@abc.com, I use dovecot's LDA.
This is probably even better as very few ppl need their other folders pre-indexed anyways... mainly the SPAM folder.
Thanks
Op ma, 19-03-2007 te 15:50 +0200, schreef Timo Sirainen:
Yes, my setup is like this:
passdb passwd-file { args = /var/mail/vhosts/vermeer.tv/shadow }
userdb static { args = uid=1002 gid=1002 home=/var/mail/vhosts/%d/homes/%n/ mail=maildir:/var/mail/vhosts/%d/%n/ }
The required data is there: The shadow-file contains a list of valid usernames. It would be nice to have something like an extra option for userdb static to tell it to have a look in this list and see if a user exists. Maybe a 'userlist = /var/mail/vhosts/vermeer.tv/shadow' entry or something like that. Running a database just for this purpose seems to be a bit too much...
Thanks!
Koen
On Mon, 2007-03-19 at 19:28 +0100, Koen Vermeer wrote:
Well... Fine: http://dovecot.org/list/dovecot-cvs/2007-March/008265.html http://dovecot.org/list/dovecot-cvs/2007-March/008266.html
Op wo, 21-03-2007 te 22:13 +0200, schreef Timo Sirainen:
Thanks! I patched the Debian rc27 package, and ran a quick test. The new folder isn't created anymore, which is good news! The bad news is that the message is now bounced ('user unknown'). I'm not sure where the problem is: postfix, dovecot, some mis-communication between those two, or just my config...
Koen
Op do, 22-03-2007 te 00:10 +0200, schreef Timo Sirainen:
The Postfix doc says that it will first try to deliver to "user +mailbox", then to "user". I don't know why an error on the first attempt doesn't result in trying the second method. I'll check with the postfix people.
Koen
Op do, 22-03-2007 te 00:10 +0200, schreef Timo Sirainen:
Just an update: It seems that postfix doesn't first try 'user +foo@domain' and then 'user@domain' when you use pipe. So, I'm trying indeed how to get the address rewritten to 'user@domain' when calling deliver. I'll report back on that later.
Koen
participants (4)
-
Bill Boebel
-
Koen Vermeer
-
Timo Sirainen
-
Tom Bombadil