}
int send_mail_many_fd(int sockfd, struct mail *mail, struct ml *ml, int subfd,
- const char *listaddr, const char *archivefilename)
+ const char *archivefilename)
{
int res, ret;
strlist stl = tll_init();
res = getaddrsfromfile(&stl, f, maxverprecips);
if(tll_length(stl) == maxverprecips) {
ret = send_mail_many_list(sockfd, mail, ml, &stl,
- listaddr, archivefilename);
+ archivefilename);
tll_free_and_free(stl, free);
if(ret < 0)
return ret;
fclose(f);
if(tll_length(stl)) {
- ret = send_mail_many_list(sockfd, mail, ml, &stl, listaddr,
+ ret = send_mail_many_list(sockfd, mail, ml, &stl,
archivefilename);
tll_free_and_free(stl, free);
return ret;
}
int send_mail_many_list(int sockfd, struct mail *mail, struct ml *ml, strlist *addrs,
- const char *listaddr, const char *archivefilename)
+ const char *archivefilename)
{
int res = 0, status, index;
char *bounceaddr, *addr;
free(addr);
continue;
}
- if(gotsigterm && listaddr && archivefilename) {
+ if(gotsigterm && archivefilename) {
/* we got SIGTERM, so save the addresses and bail */
log_error(LOG_ARGS, "TERM signal received, "
"shutting down.");
free(bounceaddr);
mail->from = NULL;
}
- if(res && listaddr && archivefilename) {
+ if(res && archivefilename) {
/* we failed, so save the addresses and bail */
index = get_index_from_filename(archivefilename);
status = requeuemail(ml->fd, index, addrs, addr);
initsmtp(&sockfd, relayhost, smtpport, smtphelo);
mail.from = bounceaddr;
mail.replyto = NULL;
- if(send_mail_many_fd(sockfd, &mail, &ml, subfd, NULL, NULL)) {
+ if(send_mail_many_fd(sockfd, &mail, &ml, subfd, NULL)) {
close(sockfd);
sockfd = -1;
} else {
initsmtp(&sockfd, relayhost, smtpport, smtphelo);
mail.from = NULL;
mail.replyto = NULL;
- if(send_mail_many_fd(sockfd, &mail, &ml, subfd, ml.addr, mailfilename)) {
+ if(send_mail_many_fd(sockfd, &mail, &ml, subfd, mailfilename)) {
close(sockfd);
sockfd = -1;
} else {
initsmtp(&sockfd, relayhost, smtpport, smtphelo);
mail.from = bounceaddr;
mail.replyto = NULL;
- if(send_mail_many_fd(sockfd, &mail, &ml, subfd, ml.addr, mailfilename)) {
+ if(send_mail_many_fd(sockfd, &mail, &ml, subfd, mailfilename)) {
close(sockfd);
sockfd = -1;
} else {
} else {
mail.from = NULL;
mail.replyto = NULL;
- sendres = send_mail_many_list( sockfd, &mail, &ml, &stl, ml.addr, archivefilename);
+ sendres = send_mail_many_list( sockfd, &mail, &ml, &stl, archivefilename);
}
if (sendres) {
close(sockfd);
} else {
mail.from = NULL;
mail.replyto = NULL;
- sendres = send_mail_many_list(sockfd, &mail, &ml, &stl, ml.addr, archivefilename);
+ sendres = send_mail_many_list(sockfd, &mail, &ml, &stl, archivefilename);
}
if (sendres) {
close(sockfd);