diff -u orig/Makefile smtp-after-imap/Makefile --- orig/Makefile Thu Aug 2 16:30:02 2001 +++ smtp-after-imap/Makefile Fri Aug 3 15:09:13 2001 @@ -6,7 +6,7 @@ # -DQLDAP_CLUSTER for enabling cluster support # to use cleartext passwords (a bad idea on production systems) add # -DCLEARTEXTPASSWD to the LDAPFLAGS -#LDAPFLAGS=-DQLDAP_CLUSTER +LDAPFLAGS=-DQLDAP_CLUSTER -DSMTP_AFTER_IMAP # Perhaps you have different ldap libraries, change them here LDAPLIBS=-L/usr/local/lib -lldap -llber Only in smtp-after-imap/: Makefile~ diff -u orig/auth_imap.c smtp-after-imap/auth_imap.c --- orig/auth_imap.c Thu Aug 2 16:30:02 2001 +++ smtp-after-imap/auth_imap.c Fri Aug 3 15:06:49 2001 @@ -23,6 +23,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 */ @@ -225,7 +233,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();