}
/* 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.
* 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 */
}
/* 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;
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",
}
}
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);
/*
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
&good_addresses, &bad_addresses)) != PS_SUCCESS)
{
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(n);
}
}
}
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, '@'))
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)
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);
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);
stuffline(ctl, buf);
free(msg.headers);
- free_str_list(&msg.xmit_names);
+ free_str_list(&msg.recipients);
return(headers_ok ? PS_SUCCESS : PS_TRUNCATED);
}
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, '@'))
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)++;
* 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))
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);
/*
* 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, '@'))
/* 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));
}