From a3c0741bbb32d02e35320f7e5884d27cac205e3a Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 24 Dec 2009 07:58:29 +0000 Subject: Make force_mda in the esmtprc to work with the -t option (based on patch by Sourav K. Mandal). force_mda in the esmtprc does not work with the -t option passed to esmtp, because rcfile_parse is called after message_parse_headers is called in the -t handling. Of course, message_parse_headers relies on the esmtprc to have been parsed already in order to denote all recipients as local when force_mda is specified. --- main.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 87d16ad..9c4f414 100644 --- a/main.c +++ b/main.c @@ -334,11 +334,6 @@ int main (int argc, char **argv) case 't': /* Read recipients from message */ - if(!message_parse_headers(message)) - { - fprintf(stderr, "No recipients found\n"); - exit(EX_DATAERR); - } parse_headers = 1; break; @@ -377,6 +372,16 @@ int main (int argc, char **argv) */ rcfile_parse(rcfile); + /* Read recipients from message */ + if (parse_headers) + { + if (!message_parse_headers(message)) + { + fprintf(stderr, "No recipients found\n"); + exit(EX_DATAERR); + } + } + /* Add remaining program arguments as message recipients. */ while (optind < argc) message_add_recipient(message, argv[optind++]); -- cgit v1.2.3-54-g00ecf