.option accept_8bitmime main boolean true
.cindex "8BITMIME"
.cindex "8-bit characters"
+.cindex "log" "selectors"
This option causes Exim to send 8BITMIME in its response to an SMTP
EHLO command, and to accept the BODY= parameter on MAIL commands.
However, though Exim is 8-bit clean, it is not a protocol converter, and it
&url(http://cr.yp.to/smtp/8bitmime.html)
.endd
+To log received 8BITMIME status use
+.code
+log_selector = +8bitmime
+.endd
+
.option acl_not_smtp main string&!! unset
.cindex "&ACL;" "for non-SMTP messages"
.cindex "non-SMTP messages" "ACLs for"
The list of optional log items is in the following table, with the default
selection marked by asterisks:
.display
+&` 8bitmime `& received 8BITMIME status
&`*acl_warn_skipped `& skipped &%warn%& statement in ACL
&` address_rewrite `& address rewriting
&` all_parents `& all parents in => lines
add_header (but not yet added to the message). Bugzilla 199.
+JH/10 Add 8bitmime log_selector, for 8bitmime status on the received line.
+ Pulled from Bugzilla 817 by Wolfgang Breyha.
+
+
Exim version 4.80
-----------------
14. New expansion variable $headers_added with content from ACL add_header
modifier (but not yet added to messsage).
+15. New 8bitmime status logging option for received messages.
+
Version 4.80
------------
Mike Bethune Help with debugging an elusive ALRM signal bug
Ard Biesheuvel Lookup code for accessing an Interbase database
Richard Birkett Fix for empty -f address crash
+Wolfgang Breyha Logging of 8bitmime reception
Dean Brooks Fix for ratelimit per_rcpt in acl_not_smtp.
Nick Burrett Patch for CONFIGURE_FILE_USE_EUID in exicyclog
Matthew Byng-Maddick Patch for qualify_domain in redirect router
BOOL active_local_from_check = FALSE;
BOOL active_local_sender_retain = FALSE;
+int body_8bitmime = 0;
BOOL accept_8bitmime = TRUE; /* deliberately not RFC compliant */
address_item *addr_duplicate = NULL;
/* Note that this list must be in alphabetical order. */
bit_table log_options[] = {
+ { US"8bitmime", LX_8bitmime },
{ US"acl_warn_skipped", LX_acl_warn_skipped },
{ US"address_rewrite", L_address_rewrite },
{ US"all", L_all },
/* General global variables */
extern BOOL accept_8bitmime; /* Allow *BITMIME incoming */
+extern int body_8bitmime; /* sender declared BODY= ; 7=7BIT, 8=8BITMIME */
extern header_line *acl_added_headers; /* Headers added by an ACL */
extern tree_node *acl_anchor; /* Tree of named ACLs */
extern uschar *acl_arg[9]; /* Argument to ACL call */
#define LX_tls_peerdn 0x80400000
#define LX_tls_sni 0x80800000
#define LX_unknown_in_list 0x81000000
+#define LX_8bitmime 0x82000000
#define L_default (L_connection_reject | \
L_delay_delivery | \
sprintf(CS big_buffer, "%d", msg_size);
s = string_append(s, &size, &sptr, 2, US" S=", big_buffer);
+/* log 8BITMIME mode announced in MAIL_FROM
+ 0 ... no BODY= used
+ 7 ... 7BIT
+ 8 ... 8BITMIME */
+if (log_extra_selector & LX_8bitmime) {
+ sprintf(CS big_buffer, "%d", body_8bitmime);
+ s = string_append(s, &size, &sptr, 2, US" M8S=", big_buffer);
+}
+
/* If an addr-spec in a message-id contains a quoted string, it can contain
any characters except " \ and CR and so in particular it can contain NL!
Therefore, make sure we use a printing-characters only version for the log.
some sites want the action that is provided. We recognize both "8BITMIME"
and "7BIT" as body types, but take no action. */
case ENV_MAIL_OPT_BODY:
- if (accept_8bitmime &&
- (strcmpic(value, US"8BITMIME") == 0 ||
- strcmpic(value, US"7BIT") == 0) )
- break;
+ if (accept_8bitmime) {
+ if (strcmpic(value, US"8BITMIME") == 0) {
+ body_8bitmime = 8;
+ } else if (strcmpic(value, US"7BIT") == 0) {
+ body_8bitmime = 7;
+ } else {
+ body_8bitmime = 0;
+ done = synprot_error(L_smtp_syntax_error, 501, NULL,
+ US"invalid data for BODY");
+ goto COMMAND_LOOP;
+ }
+ DEBUG(D_receive) debug_printf("8BITMIME: %d\n", body_8bitmime);
+ break;
+ }
arg_error = TRUE;
break;
-# Exim test configuration 0028
+# Exim test configuration 0566
exim_path = EXIM_PATH
host_lookup_order = bydns
rfc1413_query_timeout = 0s
spool_directory = DIR/spool
log_file_path = DIR/spool/log/%slog
+log_selector = +8bitmime
gecos_pattern = ""
gecos_name = CALLER_NAME
1999-03-02 09:44:33 ignoring AUTH=x@y from U=CALLER (client not authenticated)
1999-03-02 09:44:33 U=CALLER F=<x@y> rejected RCPT <userx@test.ex>: SIZE value too big
1999-03-02 09:44:33 U=CALLER F=<x@y> rejected RCPT <userx@test.ex>: SIZE value too big
+1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss M8S=0
+1999-03-02 09:44:33 10HmaX-0005vi-00 => userx <userx@test.ex> R=r2 T=local_delivery
+1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss M8S=7
+1999-03-02 09:44:33 10HmaY-0005vi-00 => userx <userx@test.ex> R=r2 T=local_delivery
+1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
+1999-03-02 09:44:33 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss M8S=8
+1999-03-02 09:44:33 10HmaZ-0005vi-00 => userx <userx@test.ex> R=r2 T=local_delivery
+1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
+1999-03-02 09:44:33 SMTP call from CALLER dropped: too many syntax or protocol errors (last command was "foo")
--- /dev/null
+From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999
+Received: from CALLER (helo=Testing)
+ by myhost.test.ex with local-esmtp (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
+Subject: test
+Message-Id: <E10HmaX-0005vi-00@myhost.test.ex>
+From: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+foo
+
+From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999
+Received: from CALLER (helo=Testing)
+ by myhost.test.ex with local-esmtp (Exim x.yz)
+ (envelope-from <CALLER@myhost.test.ex>)
+ id 10HmaY-0005vi-00
+ for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test
+Message-Id: <E10HmaY-0005vi-00@myhost.test.ex>
+From: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+foo
+
+From CALLER@myhost.test.ex Tue Mar 02 09:44:33 1999
+Received: from CALLER (helo=Testing)
+ by myhost.test.ex with local-esmtp (Exim x.yz)
+ (envelope-from <CALLER@myhost.test.ex>)
+ id 10HmaZ-0005vi-00
+ for userx@test.ex; Tue, 2 Mar 1999 09:44:33 +0000
+Subject: test
+Message-Id: <E10HmaZ-0005vi-00@myhost.test.ex>
+From: CALLER_NAME <CALLER@myhost.test.ex>
+Date: Tue, 2 Mar 1999 09:44:33 +0000
+
+foo
+
1999-03-02 09:44:33 U=CALLER F=<x@y> rejected RCPT <userx@test.ex>: SIZE value too big
1999-03-02 09:44:33 U=CALLER F=<x@y> rejected RCPT <userx@test.ex>: SIZE value too big
+1999-03-02 09:44:33 SMTP call from CALLER dropped: too many syntax or protocol errors (last command was "foo")
rcpt to:<userx@test.ex>
quit
****
+# no BODY, data
+exim -bs
+ehlo Testing
+mail from:<x@y>
+rcpt to:<userx@test.ex>
+data
+Subject: test
+
+foo
+.
+quit
+****
+sleep 1
+# 7bit BODY, data
+exim -bs
+ehlo Testing
+mail from:<x@y> BODY=7BIT
+rcpt to:<userx@test.ex>
+data
+Subject: test
+
+foo
+.
+quit
+****
+sleep 1
+# 8bit BODY, data
+exim -bs
+ehlo Testing
+mail from:<x@y> BODY=8BITMIME
+rcpt to:<userx@test.ex>
+data
+Subject: test
+
+foo
+.
+quit
+****
+sleep 1
+# bad BODY, data
+# should fail
+1
+exim -bs
+ehlo Testing
+mail from:<x@y> BODY=wrong
+rcpt to:<userx@test.ex>
+data
+Subject: test
+
+foo
+.
+quit
+****
no_msglog_check
250 OK\r
550 SIZE value too big\r
221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at Testing\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaX-0005vi-00\r
+221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at Testing\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaY-0005vi-00\r
+221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at Testing\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+250 OK\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaZ-0005vi-00\r
+221 myhost.test.ex closing connection\r
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250-myhost.test.ex Hello CALLER at Testing\r
+250-SIZE 52428800\r
+250-8BITMIME\r
+250-PIPELINING\r
+250 HELP\r
+501 invalid data for BODY\r
+503 sender not yet given\r
+503-All RCPT commands were rejected with this error:\r
+503-503 sender not yet given\r
+503 Valid RCPT command must precede DATA\r
+500 unrecognized command\r
+500 unrecognized command\r
+500-unrecognized command\r
+500 Too many syntax or protocol errors\r