It is possible to configure Mailman to log the IP address of the sender of each message?
It appears the correct configuration directive (from Defaults.py) is SMTP_LOG_SUCCESS. It logs to /var/log/mailman/post:
SMTP_LOG_SUCCESS = (
'post',
'post to %(listname)s from %(sender)s, size=%(size)d, message-id=%(msg_message-id)s, success')
I copied this directive to mm_cfg.py, tried adding %(ip) and %(remote) (just guesses), and restarted Mailman, but it didn't work.
The dictionary of available variables appears to be in Mailman/Handlers/SMTPDirect.py, lines 173-180. However, I don't know Python well enough to make the message sender's IP address available as a variable here.
d = MsgSafeDict(msg, {'time' : t1-t0,
# BAW: Urg. This seems inefficient.
'size' : len(msg.as_string()),
'#recips' : len(recips),
'#refused': len(refused),
'listname': mlist.internal_name(),
'sender' : origsender,
})