* smtpmail.el and logging
@ 2005-07-01 16:04 Brendan Halpin
2005-07-01 17:00 ` Kevin Rodgers
[not found] ` <mailman.1862.1120237690.2857.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 3+ messages in thread
From: Brendan Halpin @ 2005-07-01 16:04 UTC (permalink / raw)
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?
Brendan
--
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie http://www.ul.ie/sociology/brendan.halpin.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: smtpmail.el and logging
2005-07-01 16:04 smtpmail.el and logging Brendan Halpin
@ 2005-07-01 17:00 ` Kevin Rodgers
[not found] ` <mailman.1862.1120237690.2857.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2005-07-01 17:00 UTC (permalink / raw)
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."
(condition-case signals-data
ad-do-it
(error (shrink-window-if-larger-than-buffer
(display-buffer (get-buffer (format "*trace of SMTP session to %s*"
smtpmail-smtp-server))))
(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.")
(defadvice smtpmail-send-it (after smtpmail-log-file activate)
"If `smtpmail-log-file' is non-nil, append the contents of the trace
buffer."
(when smtpmail-log-file
(with-current-buffer (get-buffer
(format "*trace of SMTP session to %s*"
smtpmail-smtp-server))
(append-to-file (point-min) (point-max) smtpmail-log-file))))
--
Kevin Rodgers
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: smtpmail.el and logging
[not found] ` <mailman.1862.1120237690.2857.help-gnu-emacs@gnu.org>
@ 2005-07-02 15:38 ` Brendan Halpin
0 siblings, 0 replies; 3+ messages in thread
From: Brendan Halpin @ 2005-07-02 15:38 UTC (permalink / raw)
Kevin Rodgers <ihs_4664@yahoo.com> writes:
> I don't understand why those sites would accept a direct SMTP connection
> from your machine but not an SMTP connection via sendmail.
Good point! I suppose I use it as a way of cheaply switching to an
alternative MTA pointed at an outgoing mailserver, and leaving the
main MTA in its original configuration bypassing the server.
> In any case,
> smtpmail logs each transaction in the *trace of SMTP session to foo*
> buffer, where foo is smtpmail-smtp-server.
That is the kernel of information I needed, for which thanks. Also
thanks for the defadvice examples -- should prompt me to finally
get to grips with advice; I've known about it for years but never
used it.
Brendan
--
Brendan Halpin, Department of Sociology, University of Limerick, Ireland
Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147
mailto:brendan.halpin@ul.ie http://www.ul.ie/sociology/brendan.halpin.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-02 15:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-01 16:04 smtpmail.el and logging Brendan Halpin
2005-07-01 17:00 ` Kevin Rodgers
[not found] ` <mailman.1862.1120237690.2857.help-gnu-emacs@gnu.org>
2005-07-02 15:38 ` Brendan Halpin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).