diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/src/exim.c | 23 | ||||
-rw-r--r-- | src/src/globals.c | 1 | ||||
-rw-r--r-- | src/src/globals.h | 1 | ||||
-rw-r--r-- | src/src/receive.c | 3 | ||||
-rw-r--r-- | src/src/smtp_in.c | 2 |
5 files changed, 25 insertions, 5 deletions
diff --git a/src/src/exim.c b/src/src/exim.c index 8eb602245..f50cc0814 100644 --- a/src/src/exim.c +++ b/src/src/exim.c @@ -1434,6 +1434,7 @@ BOOL checking = FALSE; BOOL count_queue = FALSE; BOOL expansion_test = FALSE; BOOL extract_recipients = FALSE; +BOOL flag_G = FALSE; BOOL flag_n = FALSE; BOOL forced_delivery = FALSE; BOOL f_end_dot = FALSE; @@ -2507,11 +2508,12 @@ for (i = 1; i < argc; i++) break; /* -G: sendmail invocation to specify that it's a gateway submission and - sendmail may complain about problems instead of fixing them. We might use - it to disable submission mode fixups for command-line? Currently we just - ignore it. */ + sendmail may complain about problems instead of fixing them. + We make it equivalent to an ACL "control = suppress_local_fixups" and do + not at this time complain about problems. */ case 'G': + flag_G = TRUE; break; /* -h: Set the hop count for an incoming message. Exim does not currently @@ -4055,6 +4057,21 @@ else interface_port = check_port(interface_address); } +/* If the caller is trusted, then they can use -G to suppress_local_fixups. */ +if (flag_G) + { + if (trusted_caller) + { + suppress_local_fixups = suppress_local_fixups_default = TRUE; + DEBUG(D_acl) debug_printf("suppress_local_fixups forced on by -G\n"); + } + else + { + fprintf(stderr, "exim: permission denied (-G requires a trusted user)\n"); + return EXIT_FAILURE; + } + } + /* If an SMTP message is being received check to see if the standard input is a TCP/IP socket. If it is, we assume that Exim was called from inetd if the caller is root or the Exim user, or if the port is a privileged one. Otherwise, diff --git a/src/src/globals.c b/src/src/globals.c index d5cb6c15f..fa7416ed7 100644 --- a/src/src/globals.c +++ b/src/src/globals.c @@ -1187,6 +1187,7 @@ uschar *submission_domain = NULL; BOOL submission_mode = FALSE; uschar *submission_name = NULL; BOOL suppress_local_fixups = FALSE; +BOOL suppress_local_fixups_default = FALSE; BOOL synchronous_delivery = FALSE; BOOL syslog_duplication = TRUE; int syslog_facility = LOG_MAIL; diff --git a/src/src/globals.h b/src/src/globals.h index c61158e6d..98b9a1950 100644 --- a/src/src/globals.h +++ b/src/src/globals.h @@ -771,6 +771,7 @@ extern uschar *submission_domain; /* Domain for submission mode */ extern BOOL submission_mode; /* Can be forced from ACL */ extern uschar *submission_name; /* User name set from ACL */ extern BOOL suppress_local_fixups; /* Can be forced from ACL */ +extern BOOL suppress_local_fixups_default; /* former is reset to this; override with -G */ extern BOOL synchronous_delivery; /* TRUE if -odi is set */ extern BOOL syslog_duplication; /* FALSE => no duplicate logging */ extern int syslog_facility; /* As defined by Syslog.h */ diff --git a/src/src/receive.c b/src/src/receive.c index 378bb8f3a..2c1b38499 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -1206,7 +1206,8 @@ Either a non-null list of recipients, or the extract flag will be true, or both. The flag sender_local is true for locally generated messages. The flag submission_mode is true if an ACL has obeyed "control = submission". The flag suppress_local_fixups is true if an ACL has obeyed "control = -suppress_local_fixups". The flag smtp_input is true if the message is to be +suppress_local_fixups" or -G was passed on the command-line. +The flag smtp_input is true if the message is to be handled using SMTP conventions about termination and lines starting with dots. For non-SMTP messages, dot_ends is true for dot-terminated messages. diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 2b5cc26d3..9e7f04b85 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1032,7 +1032,7 @@ fake_response = OK; /* Can be set by ACL */ no_mbox_unspool = FALSE; /* Can be set by ACL */ #endif submission_mode = FALSE; /* Can be set by ACL */ -suppress_local_fixups = FALSE; /* Can be set by ACL */ +suppress_local_fixups = suppress_local_fixups_default; /* Can be set by ACL */ active_local_from_check = local_from_check; /* Can be set by ACL */ active_local_sender_retain = local_sender_retain; /* Can be set by ACL */ sender_address = NULL; |