--- qmail-1.03-patch20010301-orig/auth_imap.c Thu Mar 1 23:33:39 2001 +++ qmail-1.03-patch20010301/auth_imap.c Mon Mar 12 15:53:43 2001 @@ -22,6 +22,14 @@ #ifdef AUTOHOMEDIRMAKE #include "qldap-mdm.h" #endif +#ifdef SMTP_AFTER_IMAP +#include +#include + +int child; +int wstat; +char *opensmtp = "/usr/local/bin/pop3-record"; +#endif unsigned int auth_port; /* those are global defined so that auth_fail can use them */ @@ -224,7 +232,21 @@ auth_error(); } - /* first set the group id */ +#ifdef SMTP_AFTER_IMAP + 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); +#endif + + /* first set the group id */ if (prot_gid(gid) == -1) { qldap_errno = AUTH_ERROR; auth_error();