[Dovecot] Re: Stripping of domain name

Timo Sirainen tss at iki.fi
Wed Jul 23 23:47:10 EEST 2003


On Wed, 2003-07-23 at 20:10, SIMflex Internet Support wrote:
> Dear sir,
>  
> Can you please tell me how to make dovecot stipoff or ingore a
> @domain.com in a username?  Currently, we are only using one domain
> (more may be needed in the future), and some of our clients have
> incorrectly configured mail clients with the @domain.com in the user
> name.  We migrated from qpopper and teapop to use Maildirs (we are
> building a LVS cluster) and could not use mboxes anymore.  In short,
> what I need is

Well .. What password/user databases do you use? One way is to set
default_realm and set the @domain for all users in passdb/userdb.

Another way is to patch the code. Below is a patch for plaintext
authentication.

Or maybe I should make option that if given realm is default_realm, it
would look up the user without the realm. I'm not sure if it's worth
doing though.

BTW. Your mail to dovecot-list got stuck at spamassassin. I raised the
spam points a bit and lowered HTML mail's points a bit. Better would be
if I could update SA's whitelist automatically when people subscribe.
But I'm not really sure how to do that with mailman.

RCS file: /home/cvs/dovecot/src/auth/mech-plain.c,v
retrieving revision 1.13
diff -u -r1.13 mech-plain.c
--- mech-plain.c        8 May 2003 03:18:43 -0000       1.13
+++ mech-plain.c        23 Jul 2003 19:31:13 -0000
@@ -48,14 +48,8 @@
                mech_auth_finish(auth_request, NULL, 0, FALSE);
        } else {
                /* split and save user/realm */
-               if (strchr(authenid, '@') == NULL && default_realm != NULL) {
-                       auth_request->user = p_strconcat(auth_request->pool,
-                                                        authenid, "@",
-                                                        default_realm, NULL);
-               } else {
-                       auth_request->user = p_strdup(auth_request->pool,
-                                                     authenid);
-               }
+               auth_request->user = p_strdup(auth_request->pool,
+                                             t_strcut(authenid, '@'));
 
                if (!mech_is_valid_username(auth_request->user)) {
                        /* invalid username */





More information about the dovecot mailing list