help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[22] problem configuring smtpmail for gmail.com


From: Tom Roche
Subject: [22] problem configuring smtpmail for gmail.com
Date: Sat, 18 Jul 2009 00:46:22 -0400 (EDT)

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 <id omitted/> password <pw omitted/>
> machine smtp.gmail.com login <id omitted/> password <pw omitted/>

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:<tlroche@gmail.com> 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 <Tom_Roche@pobox.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]