MBF Knowledge Base

How do I setup Dovecot (IMAP) and Exim4 (SMTP) to allow username@company.com as the login instead of just username?

In order to accomplish this, you must create users in the complete form of user@domain.tld then set up login autocompletion by @hostname if domain part is omitted, before dovecot-auth invocation.

Please note that if you already have user names set up without the @domain.tld, you can change your SQL query to use only the first part before the @ sign by using the substring_index() function. Conveniently, this string search query will return the whole string if there is no @ sign. This means that if the customer enters "user@domain.com", it will use the correct value (just the "local_part"), and if the customer enters just "user", it will return the whole string.