summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-12-24 07:58:29 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-12-24 07:58:29 +0000
commita3c0741bbb32d02e35320f7e5884d27cac205e3a (patch)
treed132e80fd12488e07c5c2d55bd5cc1960e1f7a91
parent956f84a5eb0752b441df237dcf5d9f4a8cd2a3b7 (diff)
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.
-rw-r--r--main.c15
1 files 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++]);