X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/328895cc07b8caf8c18003569431a02129989289..96c065cb7bcdfc0965fb111e1eab6e9180e9e186:/src/src/exim.c diff --git a/src/src/exim.c b/src/src/exim.c index 9cef9226b..60e5b5261 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/exim.c,v 1.46 2006/10/24 12:56:06 ph10 Exp $ */ +/* $Cambridge: exim/src/src/exim.c,v 1.50 2006/11/20 11:43:40 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1498,7 +1498,8 @@ regex_ismsgid = regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", FALSE, TRUE); /* Precompile the regular expression that is used for matching an SMTP error -code, possibly extended, at the start of an error message. */ +code, possibly extended, at the start of an error message. Note that the +terminating whitespace character is included. */ regex_smtp_code = regex_must_compile(US"^\\d\\d\\d\\s(?:\\d\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\s)?", @@ -2646,6 +2647,11 @@ for (i = 1; i < argc; i++) case 'q': receiving_message = FALSE; + if (queue_interval >= 0) + { + fprintf(stderr, "exim: -q specified more than once\n"); + exit(EXIT_FAILURE); + } /* -qq...: Do queue runs in a 2-stage manner */ @@ -2754,7 +2760,6 @@ for (i = 1; i < argc; i++) } } else deliver_selectstring = argrest; - if (queue_interval < 0) queue_interval = 0; break; @@ -2802,7 +2807,6 @@ for (i = 1; i < argc; i++) } } else deliver_selectstring_sender = argrest; - if (queue_interval < 0) queue_interval = 0; break; /* -Tqt is an option that is exclusively for use by the testing suite. @@ -2893,6 +2897,12 @@ for (i = 1; i < argc; i++) } +/* If -R or -S have been specified without -q, assume a single queue run. */ + +if ((deliver_selectstring != NULL || deliver_selectstring_sender != NULL) && + queue_interval < 0) queue_interval = 0; + + /* Arguments have been processed. Check for incompatibilities. */ END_ARG: @@ -4235,8 +4245,10 @@ if (expansion_test) filter_test = FTEST_USER; /* Fudge to make it look like filter test */ message_ended = END_NOTENDED; read_message_body(receive_msg(extract_recipients)); + message_linecount += body_linecount; (void)dup2(save_stdin, 0); (void)close(save_stdin); + clearerr(stdin); /* Required by Darwin */ } /* Allow $recipients for this testing */