Subject: strip @domain from usernames

From: "Phil Smith" <[email-masked]>
Date: Mon, 11 Oct 2004 10:55:37 -0700 (PDT)

I'm attempting to transition my mail server from another POP server to the
POP server included in the UW IMAP distribution.

In order to do so, I need to be able to strip "@domain" from usernames. 
(My current POP server did this out of the box and, unfortunately, a
hundred or so users have set up their mail clients to do this)  In other
words, if a user's client sends "USER [email-masked]" I'd like them to
simply be authenticated as "user"  Is there a patch or some other simple
modification that can be made to achieve this?

Thanks,

Phil

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Jim Riggs <[email-masked]>
Date: Mon, 11 Oct 2004 14:01:17 -0500

> In other

Not very robust, but this should do what you want:

--- ipop3d.c~ Mon Jun 21 19:58:07 2004
+++ ipop3d.c Mon Oct 11 13:58:13 2004
@@ -268,6 +268,10 @@
         host = cpystr (t);/* copy host name */
         user = cpystr (s);/* copy user name */
       }
+     else if (s = strchr (t,'@')) {
+       *s = '\0'; /* tie off user name */
+       user = cpystr (t);/* copy user name */
+     }
       /* local user name */
       else user = cpystr (t);
       PSOUT ("+OK User name accepted, password please\015\012");

---

From: Phil <[email-masked]>
Date: Mon, 11 Oct 2004 13:32:34 -0700

> Not very robust, but this should do what you want:

Thanks, I'll give this a try.  Out of curiosity, what makes this "not 
very robust?"

Phil

---

From: Jim Riggs <[email-masked]>
Date: Mon, 11 Oct 2004 15:51:24 -0500

> Thanks, I'll give this a try.  Out of curiosity, what makes this "not 

It's just fairly stupid.  ;-)  All it looks for is an '@' in the 
username.  It doesn't check for a valid domain name or anything like 
that...just the '@'.  It should be fine for what you are trying to do, 
though.

- Jim