X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fsrc%2Fsmtp_in.c;h=6296342672b238877e910064e1182ba0dca672ab;hb=d7571ac555518797c3553f6080f6aab3fda6ec58;hp=92dbac4cee8bebcfa2df72e5cbdc4bd6764b8b3e;hpb=e5de01f091f7569aeed877a26ce9909df3709d84;p=user%2Fhenk%2Fcode%2Fexim.git diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 92dbac4ce..629634267 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -1795,7 +1795,7 @@ for (i = 0; i < smtp_ch_index; i++) 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)), @@ -1803,6 +1803,26 @@ log_write(0, LOG_MAIN, "no MAIL in SMTP connection from %s D=%s%s", } +/* 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 *