the first patch used to eat the first digit of an 'extended smtp errors'
reponse ( eg: "554 5.7.1 ..." ). this fixes that problem.



- Davide





diff -Nru ecartis-1.0.0/src/modules/bouncer/bouncer.c 
ecartis-1.0.0-xmail/src/modules/bouncer/bouncer.c
--- ecartis-1.0.0/src/modules/bouncer/bouncer.c Wed May  8 23:45:14 2002
+++ ecartis-1.0.0-xmail/src/modules/bouncer/bouncer.c   Mon May 13 17:13:12 2002
@@ -706,6 +706,11 @@
                           parse_sendmail_bounce(infile,outfile,outfilename,&errors);
                           done = 1;
                   }
+                  else if (strncmp(buf, "[<00>] XMail bounce:", 20) == 0) {
+                          /* We're XMail */
+                          parse_xmail_bounce(infile,outfile,outfilename,buf,&errors);
+                          done = 1;
+                  }
                   else if (strncmp(buf, "------- Failure Reasons  --------", 33) == 
0) {
                           /* We're Lotus */
                           parse_lotus_bounce(infile,outfile,outfilename,&errors);
diff -Nru ecartis-1.0.0/src/modules/bouncer/bouncer.h 
ecartis-1.0.0-xmail/src/modules/bouncer/bouncer.h
--- ecartis-1.0.0/src/modules/bouncer/bouncer.h Wed May  8 23:45:14 2002
+++ ecartis-1.0.0-xmail/src/modules/bouncer/bouncer.h   Mon May 13 17:13:12 2002
@@ -12,4 +12,5 @@
 extern void parse_lotus_bounce(FILE *, FILE *, const char *, int *);
 extern void parse_yahoo_bounce(FILE *, FILE *, const char *, int *);
 extern void parse_mms_relay_bounce(FILE *, FILE *, const char *, int *);
+extern int parse_xmail_bounce(FILE *, FILE *, const char *, char *, int *);

diff -Nru ecartis-1.0.0/src/modules/bouncer/custom.c 
ecartis-1.0.0-xmail/src/modules/bouncer/custom.c
--- ecartis-1.0.0/src/modules/bouncer/custom.c  Wed May  8 23:45:14 2002
+++ ecartis-1.0.0-xmail/src/modules/bouncer/custom.c    Mon May 13 17:15:08 2002
@@ -394,3 +394,45 @@

 }

+int parse_xmail_bounce(FILE *infile, FILE *outfile, const char *outfilename,
+                                               char *bstr, int *errors)
+{
+       int ssize, errcode;
+       char *pbase, *pend, *errstr;
+       char const *prcpt = "Rcpt=[", *perr = "Error=[";
+       char useraddy[256], errorstr[256];
+
+       if (!(pbase = strstr(bstr, prcpt)))
+               return 0;
+       pbase += strlen(prcpt);
+       if (!(pend = strchr(pbase, ']')))
+               return 0;
+       ssize = (int) (pend - pbase) < sizeof(useraddy) ? (int) (pend - pbase): 
+sizeof(useraddy) - 1;
+       strncpy(useraddy, pbase, ssize);
+       useraddy[ssize] = '\0';
+
+       if (!(pbase = strstr(bstr, perr)))
+               return 0;
+       pbase += strlen(perr);
+       if (!(pend = strrchr(pbase, ']')))
+               return 0;
+       ssize = (int) (pend - pbase) < sizeof(errorstr) ? (int) (pend - pbase): 
+sizeof(errorstr) - 1;
+       strncpy(errorstr, pbase, ssize);
+       errorstr[ssize] = '\0';
+
+       if (!isdigit(errorstr[0])) {
+               handle_error(550, useraddy, errorstr, outfilename);
+               LMAPI->write_file(outfile, "User: %s:\n      (%d) %s\n\n",
+                                                 useraddy, 550, errorstr);
+       } else {
+               errcode = atoi(errorstr);
+               for (errstr = errorstr; *errstr && isdigit(*errstr); errstr++);
+               if (*errstr) ++errstr;
+               handle_error(errcode, useraddy, errstr, outfilename);
+               LMAPI->write_file(outfile, "User: %s:\n      (%d) %s\n\n",
+                                                 useraddy, errcode, errstr);
+       }
+       (*errors)++;
+       return 1;
+}
+


-
To unsubscribe from this list: send the line "unsubscribe xmail" in
the body of a message to [EMAIL PROTECTED]
For general help: send the line "help" in the body of a message to
[EMAIL PROTECTED]

Reply via email to