summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-19 14:41:31 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-19 14:41:31 +0000
commita96603a0e5a7283a9275fb090dac95a42e05a423 (patch)
treee1aa6ce1a15a0a23e58d86e0aec05273751f9c0c
parentaa6dc51334206deff2ec80bfcbcf543714efe6d6 (diff)
Add -Mvc option.
-rw-r--r--doc/doc-txt/ChangeLog4
-rw-r--r--doc/doc-txt/NewStuff6
-rw-r--r--src/src/exim.c9
-rw-r--r--src/src/macros.h7
-rw-r--r--src/src/queue.c17
-rw-r--r--test/confs/056015
-rw-r--r--test/log/05601
-rw-r--r--test/scripts/0000-Basic/056012
-rw-r--r--test/stdout/056013
9 files changed, 73 insertions, 11 deletions
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index 76ab6e7a1..28b98cfbe 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.514 2007/06/19 13:32:05 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.515 2007/06/19 14:41:31 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -60,6 +60,8 @@ PH/06 Added the client_condition to authenticators so that some can be skipped
PH/07 The error message for a badly-placed control=no_multiline_responses left
"_responses" off the end of the name.
+PH/08 Added -Mvc to output a copy of a message in RFC 2822 format.
+
Exim version 4.67
-----------------
diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff
index 7e0c472ec..70da9ace2 100644
--- a/doc/doc-txt/NewStuff
+++ b/doc/doc-txt/NewStuff
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.149 2007/06/18 13:57:49 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.150 2007/06/19 14:41:31 ph10 Exp $
New Features in Exim
--------------------
@@ -43,6 +43,10 @@ Version 4.68
contains the cipher used for the delivery. The same is true for
$tls_peerdn.
+ 4. There is now a -Mvc <message-id> option, which outputs a copy of the
+ message to the standard output, in RFC 2822 format. The option can be used
+ only by an admin user.
+
Version 4.67
------------
diff --git a/src/src/exim.c b/src/src/exim.c
index 49830c0de..3a89d8b91 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/exim.c,v 1.55 2007/01/30 15:10:59 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim.c,v 1.56 2007/06/19 14:41:31 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -2283,6 +2283,7 @@ for (i = 1; i < argc; i++)
-Mes edit sender
-Mset load a message for use with -be
-Mvb show body
+ -Mvc show copy (of whole message, in RFC 2822 format)
-Mvh show header
-Mvl show log
*/
@@ -2330,6 +2331,11 @@ for (i = 1; i < argc; i++)
msg_action = MSG_SHOW_BODY;
one_msg_action = TRUE;
}
+ else if (Ustrcmp(argrest, "vc") == 0)
+ {
+ msg_action = MSG_SHOW_COPY;
+ one_msg_action = TRUE;
+ }
else if (Ustrcmp(argrest, "vh") == 0)
{
msg_action = MSG_SHOW_HEADER;
@@ -3474,7 +3480,6 @@ if (real_uid == root_uid || real_uid == exim_uid || real_gid == exim_gid)
else
{
int i, j;
-
for (i = 0; i < group_count; i++)
{
if (group_list[i] == exim_gid) admin_user = TRUE;
diff --git a/src/src/macros.h b/src/src/macros.h
index f6aca465c..00f9f8eb2 100644
--- a/src/src/macros.h
+++ b/src/src/macros.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/macros.h,v 1.33 2007/03/13 15:32:48 ph10 Exp $ */
+/* $Cambridge: exim/src/src/macros.h,v 1.34 2007/06/19 14:41:31 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -732,7 +732,10 @@ enum {
enum { MSG_DELIVER, MSG_FREEZE, MSG_REMOVE, MSG_THAW, MSG_ADD_RECIPIENT,
MSG_MARK_ALL_DELIVERED, MSG_MARK_DELIVERED, MSG_EDIT_SENDER,
- MSG_SHOW_BODY, MSG_SHOW_HEADER, MSG_SHOW_LOG, MSG_LOAD };
+ MSG_SHOW_COPY, MSG_LOAD,
+ /* These ones must be last: a test for >= MSG_SHOW_BODY is used
+ to test for actions that list individual spool files. */
+ MSG_SHOW_BODY, MSG_SHOW_HEADER, MSG_SHOW_LOG };
/* Returns from the spool_read_header() function */
diff --git a/src/src/queue.c b/src/src/queue.c
index 441f1d5d4..84f957c0f 100644
--- a/src/src/queue.c
+++ b/src/src/queue.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/queue.c,v 1.11 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/queue.c,v 1.12 2007/06/19 14:41:31 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -936,9 +936,9 @@ for (; f != NULL; f = f->next)
* Act on a specific message *
*************************************************/
-/* Actions that require a list of addresses make use of
-argv/argc/recipients_arg. Other actions do not. This function does its
-own authority checking.
+/* Actions that require a list of addresses make use of argv/argc/
+recipients_arg. Other actions do not. This function does its own
+authority checking.
Arguments:
id id of the message to work on
@@ -1093,10 +1093,17 @@ username = (pw != NULL)?
/* Take the necessary action. */
-printf("Message %s ", id);
+if (action != MSG_SHOW_COPY) printf("Message %s ", id);
switch(action)
{
+ case MSG_SHOW_COPY:
+ deliver_in_buffer = store_malloc(DELIVER_IN_BUFFER_SIZE);
+ deliver_out_buffer = store_malloc(DELIVER_OUT_BUFFER_SIZE);
+ transport_write_message(NULL, 1, 0, 0, NULL, NULL, NULL, NULL, NULL, 0);
+ break;
+
+
case MSG_FREEZE:
if (deliver_freeze)
{
diff --git a/test/confs/0560 b/test/confs/0560
new file mode 100644
index 000000000..d5f538461
--- /dev/null
+++ b/test/confs/0560
@@ -0,0 +1,15 @@
+# Exim test configuration 0560
+
+exim_path = EXIM_PATH
+host_lookup_order = bydns
+primary_hostname = myhost.test.ex
+rfc1413_query_timeout = 0s
+spool_directory = DIR/spool
+log_file_path = DIR/spool/log/%slog
+gecos_pattern = ""
+gecos_name = CALLER_NAME
+
+# ----- Main settings -----
+
+
+# End
diff --git a/test/log/0560 b/test/log/0560
new file mode 100644
index 000000000..f59faf8b9
--- /dev/null
+++ b/test/log/0560
@@ -0,0 +1 @@
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
diff --git a/test/scripts/0000-Basic/0560 b/test/scripts/0000-Basic/0560
new file mode 100644
index 000000000..1e20cc8e7
--- /dev/null
+++ b/test/scripts/0000-Basic/0560
@@ -0,0 +1,12 @@
+# -Mvc
+exim -odq userx@test.ex
+From: Somebody <abcd@x.y.z>
+To: first@test.ex
+ another@another.ex
+Subject: Testing -Mvc
+
+This is a test message of no great importance.
+****
+exim -Mvc $msg1
+****
+no_msglog_check
diff --git a/test/stdout/0560 b/test/stdout/0560
new file mode 100644
index 000000000..45a84cf13
--- /dev/null
+++ b/test/stdout/0560
@@ -0,0 +1,13 @@
+Received: from CALLER by myhost.test.ex with local (Exim x.yz)
+ (envelope-from <CALLER@myhost.test.ex>)
+ id 10HmaX-0005vi-00
+ for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000
+From: Somebody <abcd@x.y.z>
+To: first@test.ex
+ another@another.ex
+Subject: Testing -Mvc
+Message-Id: <E10HmaX-0005vi-00@myhost.test.ex>
+Sender: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+This is a test message of no great importance.