Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Thu, 10 Apr 2008 17:34:47 +0300
Subject: patch: discarding domain if no virtual domains


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
It seems to work OK. I also include the same patch below.



*** 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>
  #include <syslog.h>
+ #include <stdlib.h>
  #include "misc.h"
  #include "params.h"
*** 26,35 ****
--- 27,46 ----
  static int pop_auth_user(char *params)
  	char *user;
+ 	size_t at_offset;
+ #endif
  	user = pop_get_param(&params);
  	if (!user || pop_user || params) return POP_ERROR;
  	if (!(pop_user = strdup(user))) return POP_CRASH_SERVER;
+ #else
+ 	at_offset = strcspn(user, "@+:%");
+ 	if (!(pop_user = malloc(at_offset+1))) return POP_CRASH_SERVER;
+ 	strncpy(pop_user, user, at_offset);
+ 	pop_user[at_offset] = '\0';
+ #endif
  	return POP_OK;

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.