woah, that was quick... ;)

a  small fix that was found by one of my co-workers on the Mail-drip
patch...
moral, never rely on other's variables :-P


--- vpopmail-4.9.8-1/AUTHORS    Tue Dec 12 14:38:34 2000
+++ vpopmail-4.9.8-1.patched/AUTHORS    Fri Mar 16 02:53:18 2001
@@ -51,3 +51,5 @@
 Sean Truman <[EMAIL PROTECTED]>
     mysql code to set a time stamp when a user authenticates

+Javier Frias <[EMAIL PROTECTED]>
+       Mail Drip Code.
--- vpopmail-4.9.8-1/acconfig.h Mon Oct 30 19:06:06 2000
+++ vpopmail-4.9.8-1.patched/acconfig.h Fri Mar  2 01:08:12 2001
@@ -28,6 +28,8 @@

 #undef USE_DELIVER_FILTER

+#undef MAIL_DRIP
+
 #undef UCSPI_DIR

 #undef ENABLE_LOGGING
--- vpopmail-4.9.8-1/configure.in       Tue Jan  2 15:50:33 2001
+++ vpopmail-4.9.8-1.patched/configure.in       Fri Mar  2 00:34:44 2001

@@ -466,6 +466,21 @@
         ;;
 esac

+AC_ARG_ENABLE(mail-drip,
+        [  --enable-mail-drip=n|y   Ability to make unmatched emails be
routed to external mail server via qmail-remote. works by opening a
.smtp-route file placed in domain home, and using first
line as the external mail server., default is no],

+        MAIL_DRIP=$enableval,
+               [
+                       MAIL_DRIP=no
+               ])
+case $MAIL_DRIP in
+1*|y*|Y*)
+               MAIL_DRIP=1
+               AC_DEFINE_UNQUOTED(MAIL_DRIP,$MAIL_DRIP)
+               ;;
+*)
+               ;;
+esac
+

 AC_ARG_ENABLE(ip-alias-domains,
         [  --enable-ip-alias-domains=y|n   enable virutal domain lookup
via reverse ip address lookup for virtual domains. ],

--- vpopmail-4.9.8-1/vdelivermail.c     Tue Jan  2 16:22:08 2001
+++ vpopmail-4.9.8-1.patched/vdelivermail.c     Fri Mar 16 01:07:48 2001

@@ -63,6 +63,10 @@

 char TheUser[MAX_BUFF];
 char TheDomain[MAX_BUFF];
+#ifdef MAIL_DRIP
+char TheSender[MAX_BUFF];
+char TheRealDomain[MAX_BUFF];
+#endif
 int CurrentQuotaSizeFd;

 #ifdef USE_DELIVER_FILTER
@@ -830,6 +834,10 @@
  char bounce[1024];
  char prefix[1024];
  char *tmpstr;
+#ifdef MAIL_DRIP
+ char smtproute[1024];
+ int l;
+#endif

        if (argc > 3) {
                failtemp ("Syntax: %s [prefix
[bounceable_mail]]\n",argv[0]);
@@ -847,8 +855,16 @@

        scopy(TheUser, getenv("EXT"), MAX_BUFF);
        scopy(TheDomain, getenv("HOST"), MAX_BUFF);
+#ifdef MAIL_DRIP
+       scopy(TheSender,getenv("SENDER"), MAX_BUFF);
+       scopy(TheRealDomain,getenv("HOST"), MAX_BUFF);
+#endif
        lowerit(TheUser);
        lowerit(TheDomain);
+#ifdef MAIL_DRIP
+       lowerit(TheSender);
+       lowerit(TheRealDomain);
+#endif
        vget_real_domain(TheDomain,MAX_BUFF);

        pw_data=pop_user_exist(TheUser,TheDomain,prefix,bounce);
@@ -878,6 +894,19 @@
                                printf("%s", bounce);
                        }
                        fclose(fs);
+#ifdef MAIL_DRIP
+               } else if ((fs=fopen(".smtp-route", "r"))!= NULL){
+                       if (fgets( smtproute, 1024, fs) != NULL){
+                                l=strlen(smtproute);
+                                smtproute[l - 1]='\0';
+
+                               sprintf(tmp_buf, "/bin/cat |
%s/bin/qmail-remote \"%s\" \"%s\" \"%s@%s\"",QMAILDIR, smtproute,
TheSender, TheUser, TheRealDomain);

+                               system(tmp_buf);
+                               fclose(fs);
+                               exit(0);
+                       }
+#endif
+
                } else {
                        printf(
                   "Sorry, no mailbox here by that name. vpopmail
(#5.1.1)\n");

drip.patch.fixed.gz

Reply via email to