From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: smtpmail.el and logging Date: Fri, 01 Jul 2005 11:00:14 -0600 Message-ID: References: <87fyuy4ioe.fsf@wivenhoe.staff8.ul.ie> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1120237204 9666 80.91.229.2 (1 Jul 2005 17:00:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2005 17:00:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 01 19:00:00 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DoOrc-00080o-N4 for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jul 2005 18:59:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DoP07-0002hj-0Y for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Jul 2005 13:08:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DoOzm-0002dc-RM for help-gnu-emacs@gnu.org; Fri, 01 Jul 2005 13:08:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DoOzj-0002c2-9a for help-gnu-emacs@gnu.org; Fri, 01 Jul 2005 13:08:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DoOzi-0002ab-RK for help-gnu-emacs@gnu.org; Fri, 01 Jul 2005 13:08:02 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DoP04-00037O-9y for help-gnu-emacs@gnu.org; Fri, 01 Jul 2005 13:08:24 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DoOm0-0007Ia-QL for help-gnu-emacs@gnu.org; Fri, 01 Jul 2005 18:53:53 +0200 Original-Received: from 207.167.42.60 ([207.167.42.60]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2005 18:53:52 +0200 Original-Received: from ihs_4664 by 207.167.42.60 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Jul 2005 18:53:52 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: help-gnu-emacs@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 207.167.42.60 User-Agent: Mozilla Thunderbird 0.9 (X11/20041105) X-Accept-Language: en-us, en In-Reply-To: <87fyuy4ioe.fsf@wivenhoe.staff8.ul.ie> X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:27766 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:27766 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