space removed. Following the introduction of &$smtp_command$&, this variable is
somewhat redundant, but is retained for backwards compatibility.
+.new
+.vitem &$smtp_command_history$&
+.cindex SMTP "command history"
+.vindex "&$smtp_command_history$&"
+A comma-separated list (with no whitespace) of the most-recent SMTP commands
+received, in time-order left to right. Only a limited number of commands
+are remembered.
+.wen
+
.vitem &$smtp_count_at_connection_start$&
.vindex "&$smtp_count_at_connection_start$&"
This variable is set greater than zero only in processes spawned by the Exim
9. New option modifier "no_check" for quota and quota_filecount
appendfile transport.
+10. Variable $smtp_command_history returning a comma-sep list of recent
+ SMTP commands.
+
Version 4.89
------------
{ "smtp_active_hostname", vtype_stringptr, &smtp_active_hostname },
{ "smtp_command", vtype_stringptr, &smtp_cmd_buffer },
{ "smtp_command_argument", vtype_stringptr, &smtp_cmd_argument },
+ { "smtp_command_history", vtype_string_func, &smtp_cmd_hist },
{ "smtp_count_at_connection_start", vtype_int, &smtp_accept_count },
{ "smtp_notquit_reason", vtype_stringptr, &smtp_notquit_reason },
{ "sn0", vtype_filter_int, &filter_sn[0] },
extern void sigalrm_handler(int);
extern BOOL smtp_buffered(void);
extern void smtp_closedown(uschar *);
+extern uschar *smtp_cmd_hist(void);
extern int smtp_connect(host_item *, int, uschar *, int,
transport_instance *);
extern int smtp_sock_connect(host_item *, int, int, uschar *,
sep = US",";
}
-if (s != NULL) s[ptr] = 0; else s = US"";
+if (s) s[ptr] = 0; else s = US"";
log_write(0, LOG_MAIN, "no MAIL in SMTP connection from %s D=%s%s",
host_and_ident(FALSE),
readconf_printtime( (int) ((long)time(NULL) - (long)smtp_connection_start)),
}
+/* Return list of recent smtp commands */
+
+uschar *
+smtp_cmd_hist(void)
+{
+uschar * list = NULL;
+int size = 0, len = 0, i;
+
+for (i = smtp_ch_index; i < SMTP_HBUFF_SIZE; i++)
+ if (smtp_connection_had[i] != SCH_NONE)
+ list = string_append_listele(list, &size, &len, ',',
+ smtp_names[smtp_connection_had[i]]);
+for (i = 0; i < smtp_ch_index; i++)
+ list = string_append_listele(list, &size, &len, ',',
+ smtp_names[smtp_connection_had[i]]);
+return list ? list : US"";
+}
+
+
+
/*************************************************
* Check HELO line and set sender_helo_name *
rcpt:
accept senders = +ok_senders
sender_domains = +ok_sender_domains
- logwrite = :panic: rcpt accepted
+ logwrite = :panic: rcpt accepted C=$smtp_command_history
# ----- Routers -----
-1999-03-02 09:44:33 rcpt accepted
-1999-03-02 09:44:33 rcpt accepted
+1999-03-02 09:44:33 rcpt accepted C=MAIL,MAIL,RCPT
+1999-03-02 09:44:33 rcpt accepted C=MAIL,MAIL,RCPT,RCPT
1999-03-02 09:44:33 ACL "warn" with "message" setting found in a non-message (EHLO or HELO) ACL: cannot specify header lines here: message ignored
-1999-03-02 09:44:33 rcpt accepted
+1999-03-02 09:44:33 rcpt accepted C=MAIL,RCPT
1999-03-02 09:44:33 ACL "warn" with "message" setting found in a non-message (EHLO or HELO) ACL: cannot specify header lines here: message ignored
-1999-03-02 09:44:33 rcpt accepted
+1999-03-02 09:44:33 rcpt accepted C=EHLO,MAIL,RCPT
check sender_domains = +ok_sender_domains
test1 in "somewhere : test1 : test3"? yes (matched "test1")
test1 in "+ok_sender_domains"? yes (matched "+ok_sender_domains")
-check logwrite = :panic: rcpt accepted
+check logwrite = :panic: rcpt accepted C=$smtp_command_history
+ = :panic: rcpt accepted C=MAIL,MAIL,RCPT
LOG: PANIC
- rcpt accepted
+ rcpt accepted C=MAIL,MAIL,RCPT
accept: condition test succeeded in ACL "rcpt"
end of ACL "rcpt": ACCEPT
using ACL "rcpt"
check sender_domains = +ok_sender_domains
cached yes match for +ok_sender_domains
test1 in "+ok_sender_domains"? yes (matched "+ok_sender_domains" - cached)
-check logwrite = :panic: rcpt accepted
+check logwrite = :panic: rcpt accepted C=$smtp_command_history
+ = :panic: rcpt accepted C=MAIL,MAIL,RCPT,RCPT
LOG: PANIC
- rcpt accepted
+ rcpt accepted C=MAIL,MAIL,RCPT,RCPT
accept: condition test succeeded in ACL "rcpt"
end of ACL "rcpt": ACCEPT
LOG: smtp_connection MAIN
check sender_domains = +ok_sender_domains
test3 in "somewhere : test1 : test3"? yes (matched "test3")
test3 in "+ok_sender_domains"? yes (matched "+ok_sender_domains")
-check logwrite = :panic: rcpt accepted
+check logwrite = :panic: rcpt accepted C=$smtp_command_history
+ = :panic: rcpt accepted C=MAIL,RCPT
LOG: PANIC
- rcpt accepted
+ rcpt accepted C=MAIL,RCPT
accept: condition test succeeded in ACL "rcpt"
end of ACL "rcpt": ACCEPT
>>Headers added by MAIL or RCPT ACL:
SMTP connection from CALLER closed by QUIT
>>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>>
1999-03-02 09:44:33 ACL "warn" with "message" setting found in a non-message (EHLO or HELO) ACL: cannot specify header lines here: message ignored
-1999-03-02 09:44:33 rcpt accepted
+1999-03-02 09:44:33 rcpt accepted C=EHLO,MAIL,RCPT