Lena | 10 Apr 16:32
Picon
Favicon

patch: discarding domain if no virtual domains

Hi,

I'm moving from shared web-hosting to VPS where I'm setting up popa3d.
I want to make the move as seamless for mail users as possible.
The shared hosting uses cPanel software with builtin POP3 server,
there full email address serves as POP3 login, there is also a note:

| If your e-mail client has trouble using a @ sign in the login,
| you can use +, :, or % sign instead.

The users have different localparts of POPable mailboxes, so I needn't
virtual domains in popa3d. It's more convenient without virtual domains
because of the KISS principle and because users can change their passwords
if I specify /usr/bin/passwd as login shell. I want users to be able
to continie to use full email addresses as POP3 logins,
popa3d to just ignore domains in logins and to use localpart as the username.
I wrote and tested a patch http://lena.kiev.ua/popa3d-1.0.2-nonvirtual.diff
It seems to work OK. I also include the same patch below.

Lena

-----

*** pop_auth.c.old	Mon Sep  9 14:07:48 2002
--- pop_auth.c	Thu Apr 10 00:16:05 2008
***************
*** 6,11 ****
--- 6,12 ----
  #include <unistd.h>
  #include <string.h>
(Continue reading)

Solar Designer | 21 Apr 02:13

Re: patch: discarding domain if no virtual domains

On Thu, Apr 10, 2008 at 05:34:47PM +0300, Lena@... wrote:
> ...  I want users to be able
> to continie to use full email addresses as POP3 logins,
> popa3d to just ignore domains in logins and to use localpart as the username.
> I wrote and tested a patch http://lena.kiev.ua/popa3d-1.0.2-nonvirtual.diff
> It seems to work OK. I also include the same patch below.

Thank you for contributing the patch.  I've placed it in here (with a
link to this message added as a comment before the actual patch):

ftp://ftp.openwall.com/pub/projects/popa3d/contrib/patches/

I think that this is a bit too much of a special case to link to the
patch from the popa3d homepage, and the patch is trivial.

> + 	strncpy(pop_user, user, at_offset);

This is fine, but I'd use memcpy() here.  strncpy() is almost never the
right choice because of its weird semantics - NUL padding (which is
slow), but no guaranteed NUL termination.  Most of the time, when I
write portable code, I use strncat() instead (not forgetting to set the
first character of the target buffer to NUL and to subtract 1 from the
buffer size).

Thanks again,

Alexander


Gmane