No(ish)

June 17th, 2008 by michael

The problem with PHP webmail (or with my mail server, depending on your point of view) is that is uses the login name as the sender email address, usually. My logins are mailbox names, not email addresses. Lots of email addresses resolve down to a single mailbox….    At first I saw this as a fault with the web mail software, but came to realize that it was more a limitation of the mail server, as I had configured it. A mailbox id currently is maildir@account, which does look like an email, i’ll give you that…   So, I am going to change it firstly so that the mailbox format is maildir%account, but also so that people CAN authenticate with any valid email address that maps to that mailbox.

More on this soon.

(edit)

Dovecot allows multiple authentication mechanisms, querying them sequentially until it gets a positive response. I have replaced the current mechanism with three sections like so:

passdb sql { args = /vhosts/etc/dovecot.mysql }
passdb sql { args = /vhosts/etc/dovecot.mysql2 }
passdb sql { args = /vhosts/etc/dovecot.mysql3 }

The first performs the original maildir@account style authentication (yep, didn’t do the %). The second does email authentication against explicit email mappings, so if the user has ‘myname@mydomain.com’ mapped to a maildir, the second authenticator will catch it. The third authenticates against wildcard domains, so for example the user can have ‘@mydomain.com’ which catches everything for that domain.

The first is the normal mechanism used all over the web. The second and third mirror the resolving abilities of the postfix mail server, so that any email address entered will resolve to the correct maildir.

For more info on the format of these files I refer you to the dovecot docs here http://wiki.dovecot.org/AuthDatabase/SQL.

Share/Save/Bookmark

Leave a Reply