[Dovecot] Case sensitive oddity when mail delivered.
Currently running Postfix/Dovecot1.1.8 with mysql storing the user data and delivering to folders as determined by dovecot using dovecot's "deliver" as defined in postfix's master.cf
Mail location is determined by mail_location = maildir:/var/spool/mail/%d/%n/Maildir
If I have an account user1@example.com it works just fine. However, when mail is sent to USER1@EXAMPLE.COM it also delivers, but ends up creating a new file structure so I end up with /var/spool/mail/example.com/user1 (with lower case mail in it) and /var/spool/mail/EXAMPLE.COM/USER1 (with uppercase mail in it)
which is decidedly not good.
Looks to me like wherever %d and %n are pulled from is pulled out of the email, but not lower-cased.
Any ideas where I would look to change this value before the email is delivered to the mailbox?
Thx.
rick
Rick Steeves http://www.sinister.net
"Life is like a sausage: The more you pack into it, the longer it gets"
On 04/30/2009 10:12 PM dovecot@corwyn.net wrote:
Mail location is determined by mail_location = maildir:/var/spool/mail/%d/%n/Maildir
If I have an account user1@example.com it works just fine. However, when mail is sent to USER1@EXAMPLE.COM it also delivers, but ends up creating a new file structure so I end up with /var/spool/mail/example.com/user1 (with lower case mail in it) and /var/spool/mail/EXAMPLE.COM/USER1 (with uppercase mail in it)
which is decidedly not good.
That's the correct behavior, as configured.
Try: mail_location = maildir:/var/spool/mail/%Ld/%Ln/Maildir ^ ^ See also http://wiki.dovecot.org/Variables
Regards, Pascal
The trapper recommends today: face1e55.0912022@localdomain.org
At 04:37 PM 4/30/2009, Pascal Volk wrote:
That's the correct behavior, as configured.
Try: mail_location = maildir:/var/spool/mail/%Ld/%Ln/Maildir ^ ^ See also http://wiki.dovecot.org/Variables
Thanks I'll definitely give that a try. The problem I see is that in my development (preproduction/test environment) is also set to mail_location = maildir:/var/spool/mail/%d/%n/Maildir
and it doesn't exhibit this behavior. Is there anywhere else case is / could be set for %d and %n ? I don't like rolling something to production that doesn't match my dev environment (tho clearly something is different between the two right now).
Rick
Regards, Pascal
The trapper recommends today: face1e55.0912022@localdomain.org
On 04/30/2009 10:47 PM dovecot@corwyn.net wrote:
At 04:37 PM 4/30/2009, Pascal Volk wrote:
Try: mail_location = maildir:/var/spool/mail/%Ld/%Ln/Maildir ^ ^ See also http://wiki.dovecot.org/Variables
Thanks I'll definitely give that a try. The problem I see is that in my development (preproduction/test environment) is also set to mail_location = maildir:/var/spool/mail/%d/%n/Maildir
and it doesn't exhibit this behavior. Is there anywhere else case is / could be set for %d and %n ? I don't like rolling something to production that doesn't match my dev environment (tho clearly something is different between the two right now).
If your user_query also provides a home and/or mail field (see http://wiki.dovecot.org/UserDatabase), you could configure: mail_location = maildir:~/Maildir
Regards, Pascal
The trapper recommends today: face1e55.0912022@localdomain.org
On Thu, 2009-04-30 at 16:47 -0400, dovecot@corwyn.net wrote:
At 04:37 PM 4/30/2009, Pascal Volk wrote:
That's the correct behavior, as configured.
Try: mail_location = maildir:/var/spool/mail/%Ld/%Ln/Maildir ^ ^ See also http://wiki.dovecot.org/Variables
Thanks I'll definitely give that a try. The problem I see is that in my development (preproduction/test environment) is also set to mail_location = maildir:/var/spool/mail/%d/%n/Maildir
and it doesn't exhibit this behavior. Is there anywhere else case is / could be set for %d and %n ?
The best place to do this would be in passdb query to have it return a standardized case of the username. The easiest change would be auth_username_format = %Lu
On Thu, 2009-04-30 at 17:05 -0400, Timo Sirainen wrote:
On Thu, 2009-04-30 at 16:47 -0400, dovecot@corwyn.net wrote:
At 04:37 PM 4/30/2009, Pascal Volk wrote:
That's the correct behavior, as configured.
Try: mail_location = maildir:/var/spool/mail/%Ld/%Ln/Maildir ^ ^ See also http://wiki.dovecot.org/Variables
Thanks I'll definitely give that a try. The problem I see is that in my development (preproduction/test environment) is also set to mail_location = maildir:/var/spool/mail/%d/%n/Maildir
and it doesn't exhibit this behavior. Is there anywhere else case is / could be set for %d and %n ?
The best place to do this would be in passdb query
Oh, actually both passdb and userdb query. passdb for imap/pop and userdb for deliver.
to have it return a standardized case of the username. The easiest change would be auth_username_format = %Lu
This would work with both of them anyway.
At 05:11 PM 4/30/2009, Timo Sirainen wrote:
Oh, actually both passdb and userdb query. passdb for imap/pop and userdb for deliver.
to have it return a standardized case of the username. The easiest change would be auth_username_format = %Lu
This would work with both of them anyway.
Since my dovecot-sql.conf files (which I believe contain my userdb and passdb sql queries) between my dev and prod environments are identical, then the difference between production and dev must be somewhere else.
The above should provide me with a fix, so thanks! But for the moment I can't test the fix in a preproduction environment until I can figure out where in that environment it's broken, since it's not failing in preproduction.
Again thanks. Maybe it's in my postfix config somewhere. . .
rick
At 04:47 PM 4/30/2009, dovecot@corwyn.net wrote:
At 04:37 PM 4/30/2009, Pascal Volk wrote: and it doesn't exhibit this behavior. Is there anywhere else case is / could be set for %d and %n ? I don't like rolling something to production that doesn't match my dev environment (tho clearly something is different between the two right now).
Looks like the difference is first apparent in Apr 30 17:02:47 prodmail deliver(TEST222@PROD.EXAMPLE.COM): msgid=<E265AC6DA349994F9EF439E2F724439F099D3079@NOFEXCHANGE.example.com>: saved mail to INBOX
and Apr 30 17:01:49 devmail deliver(test222@dev.example.com): msgid=<E265AC6DA349994F9EF439E2F724439F099D3079@NOFEXCHANGE.example.com>: saved mail to INBOX
Before that in the logs it's upper case, and then that log entry is different between the two and changes it to lower case in my dev environment.
participants (3)
-
dovecot@corwyn.net
-
Pascal Volk
-
Timo Sirainen