--- ../qmail-1.03/auth_pop.c Thu Jan 4 15:32:46 2001 +++ auth_pop.c Wed Dec 13 10:55:07 2000 @@ -15,8 +15,15 @@ #ifdef AUTOHOMEDIRMAKE #include "qldap-mdm.h" #endif +#include +#include + unsigned int auth_port; + int child; + int wstat; + char *opensmtp = "/usr/local/bin/pop3-record"; + void auth_init(int argc, char **argv, stralloc *login, stralloc *authdata) /* this function should return the 0-terminated string login and authdata @@ -111,7 +118,9 @@ debug(16, "gid=%u, home=%s, maildir=%s, aliasempty=%s, hdm=%s\n", gid, home, md, argv[2], homedirmake ); - /* check the uid and the gid */ + + + /* check the uid and the gid */ if ( UID_MIN > uid || uid > UID_MAX ) { debug(2, "warning: auth_success: uid (%u) is to big or small (%u < uid < %u)\n", uid, UID_MIN, UID_MAX); @@ -125,6 +134,19 @@ qldap_errno = AUTH_ERROR; auth_error(); } + + if (!env_put2("AUTHUSER",login)) { + qldap_errno = ERRNO; + auth_error(); + } + + switch(child = fork()) + { + case -1: _exit(111); break; + case 0: execl(opensmtp, opensmtp, 0); _exit(111); break; + } + waitpid(child, &wstat, 0); + if (!WIFEXITED(wstat)) _exit(111); /* first set the group id */ if (prot_gid(gid) == -1) {