From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: [22] problem configuring smtpmail for gmail.com Date: Sat, 18 Jul 2009 07:23:31 +0200 Organization: ThierryVolpiatto Message-ID: <874otaa7jg.fsf@tux.homenetwork> References: <20090718044623.01C6A14084B3B@cedar.isis.unc.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1247895052 18998 80.91.229.12 (18 Jul 2009 05:30:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 18 Jul 2009 05:30:52 +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 07:30:45 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 1MS2VO-000423-AI for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 07:30:42 +0200 Original-Received: from localhost ([127.0.0.1]:45276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS2VN-0004Nj-KP for geh-help-gnu-emacs@m.gmane.org; Sat, 18 Jul 2009 01:30:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MS2Uz-0004Mr-Tr for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 01:30:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MS2Uv-0004L9-9k for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 01:30:17 -0400 Original-Received: from [199.232.76.173] (port=46593 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MS2Uv-0004L4-7Q for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 01:30:13 -0400 Original-Received: from main.gmane.org ([80.91.229.2]:50996 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MS2Uu-0000ok-Jq for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 01:30:12 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MS2Up-0005RG-Ud for help-gnu-emacs@gnu.org; Sat, 18 Jul 2009 05:30:07 +0000 Original-Received: from 194.77.197-77.rev.gaoland.net ([77.197.77.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Jul 2009 05:30:07 +0000 Original-Received: from thierry.volpiatto by 194.77.197-77.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 18 Jul 2009 05:30:07 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 155 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 194.77.197-77.rev.gaoland.net Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAElBMVEUHAwNfJRBVTESlTym0 RB/OwKFivhZqAAAACXBIWXMAAAsSAAALEgHS3X78AAAACXZwQWcAAAAwAAAAMADO7oxXAAABeElE QVQ4y3VTW47CMAyMwwUyTfYfUvG/wfC/ET4B0t7/KmsHurRgXFVVPRm/xglhsRj2+npW98G3+Amp tS5BXxl3SqzcXGRuEyf7n5lPA9jXetNPRhE7EJkzfz8YWnIgBSwW95TK4H79/t4GINKNADWj4PgA DiJX/ZxFDzDXeb4oYMw7kNUvyMzcaj3ioICG4hCKEShkPpwQ49Q05nnkGAQLDFDdExjm0qpowBYA Wi61bDlFU1GW0WbY2dSJYX5ZD2S0AiZL+rPyE19TpMzP2IvNWly+NkuWNgD4pO2oL73IQXoSyVX2 NHna7tgadWRXoCdvf2guqEcvGHqZwE520iRD0/QCYiiTE+U21w1Qxvg6iSp9fbIiDCnSAelDkCVF Vn+HekqXzRybwJ40xF4DMRG6SWGK9G1lYzHSxLYEm05GWbpJCB6A9tb9A3BGn2XdwJbS/WuInj74 4QNF8sVFdP3vl+5tgYp4Ev7fyrfFMkXgElDgV4uV/w8TWEeLCIGJ/AAAACV0RVh0Y3JlYXRlLWRh dGUAMjAwOC0wNS0zMVQyMjoxNDoyMiswMjowMM7uH/IAAAARdEVYdGpwZWc6Y29sb3JzcGFjZQAy LHVVnwAAACB0RVh0anBlZzpzYW1wbGluZy1mYWN0b3IAMngyLDF4MSwxeDFJ+qa0AAAAJXRFWHRt b2RpZnktZGF0ZQAyMDA3LTEwLTI4VDE3OjA4OjQ4KzAxOjAwhqNSRgAAAABJRU5ErkJggg== User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:jO/9J2XMflskX3qBWZ/SU2BzFJU= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:66191 Archived-At: Tom Roche writes: > 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 You have to give the port to gnus: ,----[ .authinfo ] | machine smtp.gmail.com port 587 login password `---- ,----[ My settings ] | ;; «config-pour-gmail» (to ".config-pour-gmail") | (setq user-mail-address "you@gmail.com" | user-full-name "you") | | ;; «config-gmail-avec-starttls» (to ".config-gmail-avec-starttls") | ; Sending mail | (setq message-send-mail-function 'smtpmail-send-it) | (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))) | | ;; «Now-my-password-are-in-.authinfo» (to ".Now-my-password-are-in-.authinfo") | | ;; Whithout authinfo: | ;; (setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 | ;; "my_email_as_login" "My_password"))) | | (setq smtpmail-default-smtp-server "smtp.gmail.com") | (setq smtpmail-smtp-server "smtp.gmail.com") | (setq smtpmail-smtp-service 587) `---- Hope that help. > 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 > > > -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France