From c9eddba714328a8965699b57429d31d8b0dd6814 Mon Sep 17 00:00:00 2001 From: Peter Simons Date: Fri, 19 Jan 2001 16:02:22 +0000 Subject: [PATCH] Petidomo used the mail's envelope to deliver the request for confirmation. I have changed this to either reply-to or from (if reply-to is unset), because sendmail will destroy the original envelope under obscure circumstances. --- hermes.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/hermes.c b/hermes.c index 5220bf1..35c37f1 100644 --- a/hermes.c +++ b/hermes.c @@ -179,16 +179,17 @@ hermes_main(char * incoming_mail, const char * listname) /* Every posting needs an acknowledgement. */ char* cookie; + char* originator = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; syslog(LOG_NOTICE, "\"%s\" tried to post to acknowledged list \"%s\"; posting " \ "has been deferred.", MailStruct->From, listname); cookie = queue_posting(MailStruct, listname); - fh = vOpenMailer(owner, MailStruct->Envelope, NULL); + fh = vOpenMailer(owner, originator, NULL); if (fh != NULL) { fprintf(fh, "From: petidomo-approve@%s (Petidomo Mailing List Server)\n", ListConfig->fqdn); - fprintf(fh, "To: %s\n", MailStruct->Envelope); + fprintf(fh, "To: %s\n", originator); fprintf(fh, "Subject: Petidomo: CONFIRM %s@%s: Your posting to list \"%s\"\n", listname, ListConfig->fqdn, listname); fprintf(fh, "Precedence: junk\n"); fprintf(fh, "Sender: %s\n", owner); @@ -227,9 +228,10 @@ hermes_main(char * incoming_mail, const char * listname) } else { + char* originator = (MailStruct->Reply_To) ? MailStruct->Reply_To : MailStruct->From; rc = is_address_on_list(ListConfig->ack_file, MailStruct->From); - if (rc == 0) - rc = is_address_on_list(ListConfig->ack_file, MailStruct->Envelope); + if (rc == 0 && MailStruct->Reply_To) + rc = is_address_on_list(ListConfig->ack_file, MailStruct->Reply_To); if (rc < 0) { syslog(LOG_ERR, "Can't verify whether address \"%s\" needs to be acknowledged or not.", MailStruct->From); @@ -243,11 +245,11 @@ hermes_main(char * incoming_mail, const char * listname) "for the first time; posting has been deferred.", MailStruct->From, listname); cookie = queue_posting(MailStruct, listname); - fh = vOpenMailer(owner, MailStruct->Envelope, NULL); + fh = vOpenMailer(owner, originator, NULL); if (fh != NULL) { fprintf(fh, "From: petidomo-approve@%s (Petidomo Mailing List Server)\n", ListConfig->fqdn); - fprintf(fh, "To: %s\n", MailStruct->Envelope); + fprintf(fh, "To: %s\n", originator); fprintf(fh, "Subject: Petidomo: CONFIRM %s@%s: Your posting to list \"%s\"\n", listname, ListConfig->fqdn, listname); fprintf(fh, "Precedence: junk\n");