Prev: rate limiting by recipient domain
Next: calculate daily total email sent by postfix except for two or three local domains.
From: mouss on 22 Apr 2010 17:15 Charles Marcus a écrit : > On 2010-04-21 5:53 PM, mouss wrote: >> Charles Marcus a écrit : >>> I know this isn't exactly a postfix question, but I'm hoping someone >>> will have pity on me and answer anyway... >>> >>> I have a server using postfix+courier-imap+cyrus-sasl. Currently the >>> query in virtual_mailbox_maps is: >>> >>> query = SELECT maildir FROM mailbox WHERE username='%s' >>> >>> If I want to force the supplied username to lowercase, would I change it to: >>> >>> query = SELECT maildir FROM mailbox WHERE username=LOWER('%s') > >> yes. but, in mysql at least, the default is case insensitive. so you >> don't need that. > > Ok, well, I'm using postfixadmin, and it must not have set up the > username field as case-insensitive, because mixed case username auth > attempts fail. I'll go check with the postfixadmin list and see if there > is an even simpler way to do this (lowercase usernames, and append a > default domain if one isn't supplied)... > I doubt postfixadmin plays with case. you'll have to check your mysql directly. > Anyway, the server in question is using > courier-imap+courier-authlib/cyrus-sasl, so I was able to fix this in > authmysqlrc for now (I'll be converting them to dovecot soon)... >
From: Charles Marcus on 22 Apr 2010 09:21
On 2010-04-21 5:53 PM, mouss wrote: > Charles Marcus a écrit : >> I know this isn't exactly a postfix question, but I'm hoping someone >> will have pity on me and answer anyway... >> >> I have a server using postfix+courier-imap+cyrus-sasl. Currently the >> query in virtual_mailbox_maps is: >> >> query = SELECT maildir FROM mailbox WHERE username='%s' >> >> If I want to force the supplied username to lowercase, would I change it to: >> >> query = SELECT maildir FROM mailbox WHERE username=LOWER('%s') > yes. but, in mysql at least, the default is case insensitive. so you > don't need that. Ok, well, I'm using postfixadmin, and it must not have set up the username field as case-insensitive, because mixed case username auth attempts fail. I'll go check with the postfixadmin list and see if there is an even simpler way to do this (lowercase usernames, and append a default domain if one isn't supplied)... Anyway, the server in question is using courier-imap+courier-authlib/cyrus-sasl, so I was able to fix this in authmysqlrc for now (I'll be converting them to dovecot soon)... -- Best regards, Charles |