aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--driver.c30
-rw-r--r--fetchmail.h2
-rw-r--r--sink.c21
3 files changed, 27 insertions, 26 deletions
diff --git a/driver.c b/driver.c
index 64784774..a001d54e 100644
--- a/driver.c
+++ b/driver.c
@@ -743,13 +743,13 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
}
/* cons up a list of local recipients */
- msg.xmit_names = (struct idlist *)NULL;
+ msg.recipients = (struct idlist *)NULL;
accept_count = reject_count = 0;
/* is this a multidrop box? */
if (MULTIDROP(ctl))
{
if (env_offs > -1) /* We have the actual envelope addressee */
- find_server_names(msg.headers + env_offs, ctl, &msg.xmit_names);
+ find_server_names(msg.headers + env_offs, ctl, &msg.recipients);
else if (received_for)
/*
* We have the Received for addressee.
@@ -758,11 +758,11 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
* We use find_server_names() to let local
* hostnames go through.
*/
- find_server_names(received_for, ctl, &msg.xmit_names);
+ find_server_names(received_for, ctl, &msg.recipients);
#ifdef SDPS_ENABLE
else if (sdps_envto)
{
- find_server_names(sdps_envto, ctl, &msg.xmit_names);
+ find_server_names(sdps_envto, ctl, &msg.recipients);
free(sdps_envto);
}
#endif /* SDPS_ENABLE */
@@ -789,7 +789,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
}
/* now look for remaining adresses */
while (to_addrchain) {
- find_server_names(msg.headers+to_addrchain->offset, ctl, &msg.xmit_names);
+ find_server_names(msg.headers+to_addrchain->offset, ctl, &msg.recipients);
nextptr = to_addrchain->next;
free(to_addrchain);
to_addrchain = nextptr;
@@ -798,7 +798,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
if (!accept_count)
{
no_local_matches = TRUE;
- save_str(&msg.xmit_names, run.postmaster, XMIT_ACCEPT);
+ save_str(&msg.recipients, run.postmaster, XMIT_ACCEPT);
if (outlevel >= O_DEBUG)
error(0, 0,
"no local matches, forwarding to %s",
@@ -806,7 +806,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
}
}
else /* it's a single-drop box, use first localname */
- save_str(&msg.xmit_names, ctl->localnames->id, XMIT_ACCEPT);
+ save_str(&msg.recipients, ctl->localnames->id, XMIT_ACCEPT);
/*
@@ -817,7 +817,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
if (outlevel >= O_DEBUG)
error(0,0, "forwarding and deletion suppressed due to DNS errors");
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(PS_TRANSIENT);
}
else
@@ -827,7 +827,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
&good_addresses, &bad_addresses)) != PS_SUCCESS)
{
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(n);
}
}
@@ -878,7 +878,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
}
else if (good_addresses == 1)
{
- for (idp = msg.xmit_names; idp; idp = idp->next)
+ for (idp = msg.recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
break; /* only report first address */
if (strchr(idp->id, '@'))
@@ -906,7 +906,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
error(0, errno, "writing RFC822 msg.headers");
release_sink(ctl);
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(PS_IOERR);
}
else if (!run.use_syslog && outlevel >= O_VERBOSE)
@@ -926,7 +926,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
strcat(errhd, "no recipient addresses matched declared local names");
else
{
- for (idp = msg.xmit_names; idp; idp = idp->next)
+ for (idp = msg.recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_REJECT)
break;
sprintf(errhd+strlen(errhd), "recipient address %s didn't match any local name", idp->id);
@@ -946,13 +946,13 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
strcat(errhd, "; ");
strcat(errhd, "SMTP listener rejected local recipient addresses: ");
errlen = strlen(errhd);
- for (idp = msg.xmit_names; idp; idp = idp->next)
+ for (idp = msg.recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ANTISPAM)
errlen += strlen(idp->id) + 2;
xalloca(errmsg, char *, errlen+3);
(void) strcpy(errmsg, errhd);
- for (idp = msg.xmit_names; idp; idp = idp->next)
+ for (idp = msg.recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ANTISPAM)
{
strcat(errmsg, idp->id);
@@ -976,7 +976,7 @@ static int readheaders(int sock, long fetchlen, long reallen, struct query *ctl,
stuffline(ctl, buf);
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(headers_ok ? PS_SUCCESS : PS_TRUNCATED);
}
diff --git a/fetchmail.h b/fetchmail.h
index 64aee240..26bf4c26 100644
--- a/fetchmail.h
+++ b/fetchmail.h
@@ -275,7 +275,7 @@ struct query
struct msgblk /* message header parsed for open_sink() */
{
char *headers; /* raw message headers */
- struct idlist *xmit_names; /* addressees */
+ struct idlist *recipients; /* addressees */
char return_path[HOSTLEN + USERNAMELEN + 4];
int reallen;
};
diff --git a/sink.c b/sink.c
index e2c26ac7..7146b214 100644
--- a/sink.c
+++ b/sink.c
@@ -285,7 +285,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
ctl->destaddr = ctl->smtpaddress ? ctl->smtpaddress : "localhost";
*bad_addresses = 0;
- for (idp = msg->xmit_names; idp; idp = idp->next)
+ for (idp = msg->recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
{
if (strchr(idp->id, '@'))
@@ -312,7 +312,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
ctl->destaddr = "localhost";
- for (idp = msg->xmit_names; idp; idp = idp->next)
+ for (idp = msg->recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
(*good_addresses)++;
@@ -327,7 +327,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
* long lists of users and (re)implement %s.
*/
nameslen = 0;
- for (idp = msg->xmit_names; idp; idp = idp->next)
+ for (idp = msg->recipients; idp; idp = idp->next)
if ((idp->val.status.mark == XMIT_ACCEPT))
nameslen += (strlen(idp->id) + 1); /* string + ' ' */
if ((*good_addresses == 0))
@@ -339,7 +339,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
else
{
names[0] = '\0';
- for (idp = msg->xmit_names; idp; idp = idp->next)
+ for (idp = msg->recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
{
strcat(names, idp->id);
@@ -588,7 +588,7 @@ int open_sink(struct query *ctl, struct msgblk *msg,
/*
* Now list the recipient addressees
*/
- for (idp = msg->xmit_names; idp; idp = idp->next)
+ for (idp = msg->recipients; idp; idp = idp->next)
if (idp->val.status.mark == XMIT_ACCEPT)
{
if (strchr(idp->id, '@'))
@@ -835,14 +835,15 @@ int open_warning_by_mail(struct query *ctl)
/* set up output sink for a mailed warning to calling user */
{
int good, bad;
- static struct msgblk msg = {NULL, NULL, "FETCHMAIL-DAEMON", 0};
/*
- * We give a null address list as arg 4 because we actually *want*
- * this message to go to run.postmaster. The zero length arg 5 means
- * we won't pass a SIZE option to ESMTP; the message length would
- * be more trouble than it's worth to compute.
+ * We give a null address list as the recipients member because we
+ * actually *want* this message to go to run.postmaster. The zero
+ * length arg 5 means we won't pass a SIZE option to ESMTP; the
+ * message length would be more trouble than it's worth to compute.
*/
+ static struct msgblk msg = {NULL, NULL, "FETCHMAIL-DAEMON", 0};
+
return(open_sink(ctl, &msg, &good, &bad));
}