diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1996-11-09 21:57:15 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1996-11-09 21:57:15 +0000 |
commit | 63e95dfd487fcf373edff8df36d906b50f5c19c7 (patch) | |
tree | 9ca70ee8fe05947750b7d1e926038d5cf6c4f9ae | |
parent | 30041d963fb87fee22d9e13dad96e9699d33d4e3 (diff) | |
download | fetchmail-63e95dfd487fcf373edff8df36d906b50f5c19c7.tar.gz fetchmail-63e95dfd487fcf373edff8df36d906b50f5c19c7.tar.bz2 fetchmail-63e95dfd487fcf373edff8df36d906b50f5c19c7.zip |
Correct generation of X-Fetchmail-Warning header.
svn path=/trunk/; revision=526
-rw-r--r-- | driver.c | 38 | ||||
-rw-r--r-- | fetchmail.h | 2 | ||||
-rw-r--r-- | uid.c | 4 |
3 files changed, 26 insertions, 18 deletions
@@ -509,13 +509,15 @@ struct query *ctl; /* query control record */ /* write error notifications */ #ifdef HAVE_RES_SEARCH if (no_local_matches || bad_addresses) -#endif /* HAVE_RES_SEARCH */ +#else if (bad_addresses) +#endif /* HAVE_RES_SEARCH */ { int errlen = 0; char errhd[USERNAMELEN + POPBUFSIZE], *errmsg; - (void) strcpy(errmsg, "X-Fetchmail-Error: "); + errmsg = errhd; + (void) strcpy(errhd, "X-Fetchmail-Error: "); #ifdef HAVE_RES_SEARCH if (no_local_matches) { @@ -524,21 +526,25 @@ struct query *ctl; /* query control record */ strcat(errhd, "; "); } #endif /* HAVE_RES_SEARCH */ - strcat(errhd, "SMTP listener rejected recipient addresses: "); - errlen = strlen(errhd); - for (idp = xmit_names; idp; idp = idp->next) - if (!idp->val.num) - errlen += strlen(idp->id) + 2; - errmsg = alloca(errlen+1); - (void) strcpy(errmsg, errhd); - for (idp = xmit_names; idp; idp = idp->next) - if (!idp->val.num) - { - strcat(errmsg, idp->id); - if (idp->next) - strcat(errmsg, ", "); - } + if (bad_addresses) + { + strcat(errhd, "SMTP listener rejected local recipient addresses: "); + errlen = strlen(errhd); + for (idp = xmit_names; idp; idp = idp->next) + if (!idp->val.num) + errlen += strlen(idp->id) + 2; + + errmsg = alloca(errlen+3); + (void) strcpy(errmsg, errhd); + for (idp = xmit_names; idp; idp = idp->next) + if (!idp->val.num) + { + strcat(errmsg, idp->id); + if (idp->next) + strcat(errmsg, ", "); + } + } strcat(errmsg, "\n"); diff --git a/fetchmail.h b/fetchmail.h index 6dd5f115..93ec9131 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -172,7 +172,7 @@ void reply_hack(char *, const char *); char *nxtaddr(const char *); void initialize_saved_lists(struct query *, char *); -void save_uid(struct idlist **, int, char *); +struct idlist *save_uid(struct idlist **, int, char *); void free_uid_list(struct idlist **); void save_id_pair(struct idlist **, char *, char *); void free_idpair_list(struct idlist **); @@ -99,7 +99,7 @@ void initialize_saved_lists(struct query *hostlist, char *idfile) } } -void save_uid(struct idlist **idl, int num, char *str) +struct idlist *save_uid(struct idlist **idl, int num, char *str) /* save a number/UID pair on the given UID list */ { struct idlist *new; @@ -109,6 +109,8 @@ void save_uid(struct idlist **idl, int num, char *str) new->id = xstrdup(str); new->next = *idl; *idl = new; + + return(new); } void free_uid_list(struct idlist **idl) |