Bug 1454: Option -oMm for message reference
[exim.git] / src / src / exim.c
index c5053ba7cecf6317ca4d8fb2c748cd4ff50cc823..fa0cf4940d8420c04484f72d107f583170333e4b 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2012 */
+/* Copyright (c) University of Cambridge 1995 - 2014 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -526,7 +526,7 @@ close_unwanted(void)
 if (smtp_input)
   {
   #ifdef SUPPORT_TLS
-  tls_close(FALSE, FALSE);      /* Shut down the TLS library */
+  tls_close(TRUE, FALSE);      /* Shut down the TLS library */
   #endif
   (void)close(fileno(smtp_in));
   (void)close(fileno(smtp_out));
@@ -825,9 +825,15 @@ fprintf(f, "Support for:");
 #ifdef EXPERIMENTAL_PRDR
   fprintf(f, " Experimental_PRDR");
 #endif
+#ifdef EXPERIMENTAL_PROXY
+  fprintf(f, " Experimental_Proxy");
+#endif
 #ifdef EXPERIMENTAL_TPDA
   fprintf(f, " Experimental_TPDA");
 #endif
+#ifdef EXPERIMENTAL_REDIS
+  fprintf(f, " Experimental_Redis");
+#endif
 fprintf(f, "\n");
 
 fprintf(f, "Lookups (built-in):");
@@ -2983,6 +2989,23 @@ for (i = 1; i < argc; i++)
 
       else if (Ustrcmp(argrest, "Mi") == 0) interface_address = argv[++i];
 
+      /* -oMm: Message reference */
+
+      else if (Ustrcmp(argrest, "Mm") == 0)
+        {
+        if (!mac_ismsgid(argv[i+1]))
+          {
+            fprintf(stderr,"-oMm must be a valid message ID\n");
+            exit(EXIT_FAILURE);
+          }
+        if (!trusted_config)
+          {
+            fprintf(stderr,"-oMm must be called by a trusted user/config\n");
+            exit(EXIT_FAILURE);
+          }
+          message_reference = argv[++i];
+        }
+
       /* -oMr: Received protocol */
 
       else if (Ustrcmp(argrest, "Mr") == 0) received_protocol = argv[++i];