[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bounces in zmailer
Hello,
as i have reported before (but I'm not sure if anybody received it?) there
is a problem in the scheduler of zmailer-27. Bounces from remote Systems
(Mail From:<>) will bounce if they are directed to unknown users. I have
fixed this with not setting an error-receiver for error-channel messages:
(sorry for not using diff, this is only a draftpatch :)
In scheduler.c/vtxprep() i have a new variable char * schannel:
case _CF_SENDER:
++cp;
while (*cp == ' ') ++cp;
schannel = cp;
while (*cp != 0 && *cp != ' ') ++cp; *cp++ = 0; while (*cp == ' ') ++cp;
while (*cp != 0 && *cp != ' ') ++cp; while (*cp == ' ') ++cp;
latest_sender = cp;
while (*cp != 0 && *cp != ' ') ++cp; *cp = 0; /* We assume: No spaces at the sender addr! */
if (!strcmp(schannel, "error")) /* PATCHed */
break;
if (cfp->erroraddr) free(cfp->erroraddr);
cfp->erroraddr = strsave(latest_sender);
break;
I don't know if this is the right solution, anyone?
In addition I have added a function squirrel() to msgerror.c to save those
kinds of bounces on bounces in the postman dir:
msgerror.c/reporterrs():
if (cfpi->erroraddr == NULL) {
squirrel(cfpi, "unable to bounce bounce"); /* Added */
return;
}
And squirrel() is:
void
squirrel(cfpi, text)
struct ctlfile *cfpi;
char *text;
{
char *path;
#ifndef USE_ALLOCA
path = emalloc(5+strlen(POSTMANDIR)+strlen(cfpi->mid));
#else
path = alloca(5+strlen(POSTMANDIR)+strlen(cfpi->mid));
#endif
sprintf(path, "../%s/%s", POSTMANDIR, cfpi->mid);
/* XX: We make a copy by link()ing file to two dirs, some
systems (Andrew-FS in mind) can't do it! Copying is
ok in their case.. */
if (elink(cfpi->mid, path) < 0) {
sprintf(path, "..%s", cfpi->mid);
elink(cfpi->mid, path);
}
fprintf(stderr, "squirrel: %s saved for inspection: %s\n",
cfpi->mid, text);
#ifdef LOG_ERR
syslog(LOG_ERR, "%s saved for inspection: %s\n",
cfpi->mid, text);
#endif /* LOG_ERR */
#ifndef USE_ALLOCA
free(path);
#endif
}
Any comments?!
Greetings
Bernd
--
ecki@fun.de