Re: smtpmail.el and logging
Kevin Rodgers <ihs_4664 <at> yahoo.com>
2005-07-01 17:00:14 GMT
Brendan Halpin wrote:
> I normally send mail directly from my machine using the MTA, and
> the access to the logs is handy from time to time.
> However, some of my correspondents are on sites which won't accept
> mail except from a machine with a valid MX record, which I don't
> have. Therefore I sometimes use smtpmail.el, but I miss the
> logging. Does smtpmail.el log at all? If so, how and where?
I don't understand why those sites would accept a direct SMTP connection
from your machine but not an SMTP connection via sendmail. In any case,
smtpmail logs each transaction in the *trace of SMTP session to foo*
buffer, where foo is smtpmail-smtp-server.
For example, I've been using this for years:
(defadvice smtpmail-send-it (around display-trace-buffer activate)
"If an error is signalled, display the process buffer."
(display-buffer (get-buffer (format "*trace of SMTP session to %s*"
(signal (car signals-data) (cdr signals-data)))))
You should be able to advise smtpmail-send-it to append the contents of
the trace buffer to a log file:
(defvar smtpmail-log-file nil
"If non-nil, the name of the SMTP log file.")