From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche Newsgroups: gmane.emacs.help Subject: [22] problem configuring smtpmail for gmail.com Date: Sat, 18 Jul 2009 00:46:22 -0400 (EDT) Message-ID: <20090718044623.01C6A14084B3B@cedar.isis.unc.edu> Reply-To: Tom Roche NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1247892566 14640 80.91.229.12 (18 Jul 2009 04:49:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jul 2009 04:49:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 18 06:49:19 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MS1rK-0001hg-UV for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 06:49:19 +0200 Original-Received: from localhost ([127.0.0.1]:48826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS1rK-0005c6-FJ for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 00:49:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MS1q6-0005OE-Ap for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 00:48:02 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MS1q1-0005MD-Mw for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 00:48:01 -0400 Original-Received: from [199.232.76.173] (port=57744 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS1q1-0005M7-Cx for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 00:47:57 -0400 Original-Received: from cedar.isis.unc.edu ([152.2.3.72]:6198) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MS1q0-0002bY-WE for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 00:47:57 -0400 Original-Received: by cedar.isis.unc.edu (Postfix, from userid 155088) id 01C6A14084B3B; Sat, 18 Jul 2009 00:46:22 -0400 (EDT) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:66190 Archived-At: I'd appreciate help {fix, debug}ing a problem mailing to smtp.gmail.com (and other TLS-using mail hosts) using smtpmail. Apologies if this should go to bug-gnu-emacs (but it's probably a configuration problem) or if it's a FAQ (but my searches haven't found that). (Note that, while searching, I've read http://www.gnu.org/software/emacs/manual/html_node/smtpmail/index.html http://www.gnu.org/software/emacs/windows/Network-access.html http://justinsboringpage.blogspot.com/2009/02/sending-email-via-gmail-in-emacs.html http://obfuscatedcode.wordpress.com/2007/04/26/configuring-emacs-for-gmails-smtp/ http://josefsson.org/emacs-smtp-starttls.html and several list and newsgroup posts.) Please let me know if this forum is in/appropriate, and feel free to reply directly to me as well as to the list. I'm running GNU Emacs 22.2.1, as installed by ubuntu package= emacs22-gtk, on xubuntu 9.04, which is patched up-to-date. I'd like to enable mail sending directly from emacs, since that's where I actually compose mail. I don't currently want to use emacs to read/store mail, since gmail seems to work pretty well for that. Hence I'd like to keep the MUA simple, and smtpmail.el seems to be the simplest emacs MUA. (Am I missing something?) My emacs seems to be pretty well setup for that, since * M-x load-library starttls.el finds it in /usr/share/emacs/22.2/lisp/gnus/starttls.el.gz * M-x load-library smtpmail.el finds it in /usr/share/emacs/22.2/lisp/mail/smtpmail.el.gz I have also installed package=gnutls-bin, and can tlroche@tlrZ61t:~$ gnutls-cli -s -p 587 smtp.gmail.com > Resolving 'smtp.gmail.com'... > Connecting to '72.14.247.109:587'... > > - Simple Client Mode: > > 220 mx.google.com ESMTP 30sm668279agc.59 > ^C I have also made tlroche@tlrZ61t:~$ cat ~/.authinfo > machine smtp.pobox.com login password > machine smtp.gmail.com login password In my init.el I have > ;; debugging==t > (setq smtpmail-debug-info t) > (setq smtpmail-debug-verb t) > ;; "must be set before the SMTP library is loaded"? > (setq smtpmail-default-smtp-server "smtp.gmail.com") > (setq user-full-name "Tom Roche") > ;; use the default MUA > (setq send-mail-function 'smtpmail-send-it) > (setq message-send-mail-function 'smtpmail-send-it) > (setq smtpmail-auth-credentials (expand-file-name "~/.authinfo")) > (setq user-mail-address "tlroche@gmail.com") > (setq smtpmail-smtp-server "smtp.gmail.com") > (setq smtpmail-smtp-service 587) > ;; Use STARTTLS without authentication against the server. > (setq smtpmail-starttls-credentials > '((smtpmail-smtp-server smtpmail-smtp-service nil nil)) > ) > (setq starttls-use-gnutls t) > (setq starttls-program "gnutls-cli") ; from ubuntu package=gnutls-bin > (require 'smtpmail) > (require 'starttls) and I've verified that those vars get loaded. But when I try to send a simple message via C-x m twiddle buffer C-c C-c I get *trace of SMTP session to smtp.gmail.com* > Process SMTP deleted > 220 mx.google.com ESMTP 7sm1834314agb.41 > EHLO tlrZ61t.ubuntu-domain > 250-mx.google.com at your service, [69.134.240.67] > 250-SIZE 35651584 > 250-8BITMIME > 250-STARTTLS > 250-ENHANCEDSTATUSCODES > 250 PIPELINING > MAIL FROM: SIZE=289 > 530 5.7.0 Must issue a STARTTLS command first. 7sm1834314agb.41 > QUIT > 221 2.0.0 closing connection 7sm1834314agb.41 So apparently I need to configure myself to utter a STARTTLS command when sending mail. If so, how to do that? If not, what am I missing? Your suggestions regarding * how to debug this problem * how to fix this problem * how to avoid this problem (i.e. better ways to approach this task, given that I'd like to keep it simple) * better places to seek help are appreciated. TIA, Tom Roche