在sendmail中loggingauth信息

问题:sendmail的默认日志loggingconfiguration不logging每个消息 auth信息,我neeed(即我想知道哪个用户/ authmethod用于某个消息ID )。 从这个入口的小费,我结束了以下cf线:

LOCAL_CONFIG Klog syslog # This works HSubject: $>+LogSubject # this does not HX-Authost: ${mail_host} HX-Authost: $>+LogAuthAuthor LOCAL_RULESETS SLogSubject R$* $: $(log Subject: $1 authenticated-by: $&{auth_type}, $&{auth_authen}, $&{auth_ssf}, $&{auth_author}, $&{mail_mailer}, $&{mail_host}, $&{mail_addr} $) $1 SLogAuthAuthor R$* $: $(log Authenticated-by: $1 $&{auth_type}, $&{auth_authen}, $&{auth_ssf}, $&{auth_author}, $&{mail_mailer}, $&{mail_host}, $&{mail_addr} $) $1 

第一个产生(在maillog):

 sendmail[10814]: r2DEJl9P010814: Subject:the Subject.authenticated by:PLAIN,auser,0,,esmtp,example.com.,[email protected] 

第二:

 sendmail[10814]: r2DEJl9P010814: Authenticated-by:example.com.,,,,esmtp,example.com.,[email protected] 

因此,当第二个规则触发时,{auth_xxxx}macros是空的,但是它们不是。 事实上,如果我把它们放在H行上,我可以login它们:

 HX-Authost: ${mail_host} ${auth_type} ${auth_authen} ${auth_ssf} ${auth_author} HX-Authost: $>+LogAuthAuthor1 

除了我不想这样做,因为我会发送auth信息,我只想logging它。 事实上,整个解决scheme是土狼丑陋的,更不用说可怕的kludgey了,我会欢迎更好的(不是以“改变MTA”开始的 – 我对sendmail非常满意)

请注意,将LogLevel提高到10以上(如上所述)似乎并不会削减它,因为auth信息每个会话logging一次(即在login时),而我想要的是在消息上下文中。

干杯,阿尔夫

您可以在check_eoh (标check_data )或check_data规则集(在smtp数据命令之后)创build您想要的日志条目。

 LOCAL_RULESETS Scheck_data R$* $: $(log Authenticated-by: $&{auth_type}, $&{auth_authen}, $&{auth_ssf}, $&{auth_author}, $&{mail_mailer}, $&{mail_host}, $&{mail_addr} $) $1 

[在$之前应该有一个TAB:]
check_data获取作为inputnumber_of_recipients ,check_eoh获取作为inputnumber_of_headers $| total_headers_bytes number_of_headers $| total_headers_bytes

check_mail将是一个更好的地方,但FEATURE(delay_checks)使它更棘手。

更改LogLevel以适应您的需求,例如

 define(`confLOG_LEVEL', `14')dnl 

http://answers.google.com/answers/threadview?id=398644问:loggingsendmailauthentication的用户。

简而言之:将LogLevel提高到14


sendmail发行版中的RELEASE_NOTES文件状态:

 8.10.0/8.10.0 2000/03/01 [...] Log basic information about authenticated connections at LogLevel 10 or higher.