Logging of messages with format strings and long SMTP dialog message lines
2013-08-09 by Jim Klimov
In the milter's syslog entries I see the format strings represented as original escape characters (somewhat reasonable as this is a quote from the ACL table). In this particular case I have much of the other data available from other fields in the debug entry. Still, i.e. if I disable the debug, is it possible to log the same response string as was posted to the SMTP dialog (with expanded format escape-strings)? Also, I believe the strings are somehow capped at 255 bytes (by milter API, or by milter-greylist, or by SMTP protocol - dunno). Is there any good way to send multi-line responses to describe the failure to any potential valid senders (as seen in the example below - which does not always fit well and gets truncated)? Aug 9 15:43:57 ucs milter-greylist: [ID 471652 mail.debug] Incoming connection from host '[2.185.61.190]' Aug 9 15:43:57 ucs milter-greylist: [ID 308029 mail.debug] Got an unresolved host name [2.185.61.190], will try to resolve Aug 9 15:43:57 ucs milter-greylist: [ID 682236 mail.debug] Requesting PTR entry for 190.61.185.2.in-addr.arpa. Aug 9 15:43:57 ucs milter-greylist: [ID 356585 mail.debug] res_nquery failed: Error 0 Aug 9 15:43:57 ucs milter-greylist: [ID 254819 mail.debug] SPF return code 5 Aug 9 15:43:57 ucs milter-greylist: [ID 859003 mail.debug] SPF lookup performed in 0.012939s Aug 9 15:43:59 ucs milter-greylist: [ID 703198 mail.debug] 0MR900BGWHX6IT20: addr = [2.185.61.190][2.185.61.190], from = <>, rcpt = <mail@...> Aug 9 15:43:59 ucs milter-greylist: [ID 704525 mail.info] 0MR900BGWHX6IT20: addr 2.185.61.190 flushed, removed 1 grey and autowhite (ACL 1431) Aug 9 15:43:59 ucs milter-greylist: [ID 561399 mail.debug] Mail from=<>, rcpt=<mail@...>, addr=[2.185.61.190][2.185.61.190] is matched by entry racl 1431 greylist domain_re /^\[[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\]$/ [delay 60] [flushaddr] [msg "(CONNECT) DNS PTR could not be resolved. Please try again later or re-post through an SMTP server properly registered in DNS. IP:'%i' DOMAIN:'%d' HELO:'%h' FROM:'%f' RCPT:'%r'"] [maxpeek -1] Aug 9 15:43:59 ucs milter-greylist: [ID 556459 mail.debug] created: 2.185.61.190 from <> to <mail@...> delayed for 00:01:00 Aug 9 15:43:59 ucs milter-greylist: [ID 751384 mail.info] 0MR900BGWHX6IT20: addr [2.185.61.190][2.185.61.190] from <> to <mail@...> delayed for 00:01:00 (ACL 1431) Thanks, //Jim