[Dovecot] Variable expansion in LDA vs POP/IMAP
Hello all,
I'm trying to understand when exactly the variable substitution happens in Dovecot, as I get different results in the LDA and in the POP/IMAP server.
Here's my general setup:
- Postfix MTA, delivers mail via Dovecot LDA
- users list sits in a database
- mail directory is stored in the database, but with Dovecot variables inside
Delivery works perfectly fine, Dovecot's deliver get a "mail" column from the database (that looks like this: /mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/ ) and expands variables, delivers the mail into the maildir's location.
Now if I try to access the mailbox through Dovecot's POP/IMAP server, it looks like it gets the right field from the database, but won't expand the variables:
May 24 18:31:14 mail1 dovecot: imap-login: Login: user=<XXXXX>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured May 24 18:31:14 mail1 dovecot: IMAP(XXXXX): Effective uid=1021, gid=304, home= May 24 18:31:14 mail1 dovecot: IMAP(XXXXX): maildir: data=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln/ May 24 18:31:14 mail1 dovecot: IMAP(XXXXX): maildir: root=/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln, index=/srv/mail/01/%2LMd /%2.2LMd/%LMd/mail/%Ln, control=, inbox= May 24 18:31:14 wmail1-v dovecot: IMAP(XXXXX): Disconnected
Am I missing something to get the pop/imap part expand those ?
-- Stephane Enten
Stephane Enten wrote:
Expansion happens before the query, you didn't include dovecot-sql.conf so I'm not sure where it's going wrong.
you should NOT be doing select concat('/mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln') as maildir
Those expansions work as:
mail_location = /mail/01/%2LMd/%2.2LMd/%LMd/mail/%Ln
On Sat, May 26, 2007 at 06:26:40PM +0300, Timo Sirainen wrote:
I understand that the only intended expanded string is the query one, not the answer.
But then something's weird cause it's actualy expanded by deliver (in my setup they share the same dovecot-auth process hence the same SQL query).
Thanks for your help, I'll go for mail_location instead.
-- Stephane Enten
On Sun, 2007-05-27 at 15:19 +0200, Stephane Enten wrote:
That's a bug then, because it should work identically with deliver. Fixed: http://hg.dovecot.org/dovecot-1.0/rev/2b462faf9867
Hopefully around Dovecot v2.0 I can finally get rid of this kind of special handling in deliver and just have one generic code that works the same everywhere..
participants (3)
-
Jason Godsey
-
Stephane Enten
-
Timo Sirainen