From: mouss on
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
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