Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Configuring gnus for gmail

11 views
Skip to first unread message

Rodolfo Medina

unread,
Jan 31, 2006, 10:34:00 AM1/31/06
to
Hi.

I've tried to follow the indications at:

http://mail.google.com/support/bin/answer.py?answer=13287

in order to configure gnus to fetch and send mail from and to
gmail, but it doesn't work: gnus sticks when opened.
In my .gnus.el I put the following stuff:


--------------------------------------------------------
(setq user-mail-address "rodolfo...@gmail.com")
(setq user-full-name "Rodolfo Medina")

(setq mail-sources '((pop :server "pop.gmail.com"
:user "rodolfo...@gmail.com"
)))

(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-default-smtp-server "smtp.gmail.com")
---------------------------------------------------------


. Is anybody there who has a direct experience in the matter?

Any help highly appreciated,
Rodolfo

Tim McNamara

unread,
Jan 31, 2006, 1:27:08 PM1/31/06
to
"Rodolfo Medina" <romeo...@libero.it> writes:

Hmmm. I don't but maybe this will help. Try plugging in your values
to this (for mail client backend, username, passwsord, etc). This
would also allow you to specify several mail servers, I believe, if
you use them, by adding them under "add-to-list 'mail-sources ..."

(add-to-list 'gnus-secondary-select-methods '(nnml ""))
(eval-after-load "mail-source"
'(add-to-list 'mail-sources '(pop :server "pop.gmail.com"
:user "rodolfo...@gmail.com"
:password "insertyourpassword")))


(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)

(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-auth-credentials
'(("smtp.gmail.com" 25 "rodolfo...@gmail.com" "insertyourpassword")))


Hope this helps!

Rodolfo Medina

unread,
Feb 2, 2006, 12:06:41 PM2/2/06
to
Thanks,

I tried it but it doesn't seem to work:
gnus sticks immediately.
I googled around but apparently there's not much on this matter,
maybe because gmail is quite new-born.
There's a detailed howto at:

http://www.pvv.ntnu.no/~terjeros/wiki/GnusGmail

. The author recommends to use both emacs and gnus taken from cvs
repositories.
But I wonder: emacs cvs already includes gnus. Wouldn't it be enough
just to
build emacs from cvs? Or should one *first* fetch and install
emacs cvs and then *also* fetch and install gnus cvs?
In the latter case, wouldn't the two versions of gnus conflict?

I've written to the author but haven't got any reply yet.
What do you people of gnu.emacs.gnus think?

Thanks,
Rodolfo

Adam Sjøgren

unread,
Feb 2, 2006, 2:34:36 PM2/2/06
to
On 31 Jan 2006 07:34:00 -0800, Rodolfo wrote:

> http://mail.google.com/support/bin/answer.py?answer=13287

Note that gmail *requires* the use of SSL for pop3 and TLS for smtp.
This is unlike many ISPs etc.

> (setq mail-sources '((pop :server "pop.gmail.com"
> :user "rodolfo...@gmail.com"
> )))

I think you need to configure use of SSL here, somehow.

> (setq send-mail-function 'smtpmail-send-it)
> (setq message-send-mail-function 'smtpmail-send-it)
> (setq smtpmail-default-smtp-server "smtp.gmail.com")

Here you should configure the use of TLS, I guess.

I've only tried using SSL with imap and nntp in Gnus and I always use
a local MTA, so I can't related direct experience with pop3s and
smtp+tls.


Best regards,

--
"You know, if the sun was an oboe, what would you do?" Adam Sjøgren
as...@koldfront.dk

Rodolfo Medina

unread,
Feb 6, 2006, 12:25:59 PM2/6/06
to
In order to fetch and send mail with gnus and gmail,
I've been following the steps described at:

http://www.pvv.ntnu.no/~terjeros/wiki/GnusGmail

, but gnus sticks down after asking for my gmail password.
I did everything (I hope) as described at that site:


I downloaded emacs cvs (see 'http://savannah.gnu.org/cvs/?group=emacs')
and installed it into my system: emacs 22.0.50.2 including gnus 5.11;

from
ftp://ftp.gnupg.org/gcrypt/libgpg-error
I downloaded libgpg-error-1.1.tar.gz and installed it;

from
ftp://ftp.gnupg.org/gcrypt/libgcrypt/
I downloaded libgcrypt-1.2.2.tar.gz and installed it;

from
http://www.gnu.org/software/gnutls/
I downloaded gnutls-1.2.9.tar.bz2 and installed it;

from
http://cvs.m17n.org/viewcvs/*checkout*/root/gnus/lisp/pop3.el?only_with_tag=t-gnus-6_17-quimby&rev=1.6.30.21.4.16
I fetched the file pop3.el and put it in my system at
'usr/local/share/emacs/22.0.50/lisp/gnus';

I created ~/.gnus.el and filled it with:


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; The following line is needed when using pop3.el from T-gnus
(m17n.org).
(eval-after-load "mail-source" '(require 'pop3))


(setq gnus-select-method '(nnml ""))

(setq gnus-posting-styles
'((".*"
(name "Rodolfo Medina")
(address "rodolfo...@libero.it"))
("^nnml.*gmail"
(address "rodolfo...@gmail.com"))))


(setq mail-sources
'((file :path "/var/spool/mail/rodolfo.medina")
(pop :server "pop.gmail.com"
:port 995
:user "rodolfo.medina"
:connection ssl
:leave t)))


(defun fs-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(let ((from
(save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))))
(message "From is `%s', setting `smtpmail-smtp-server' to `%s'"
from
(cond
((string-match "rodolfo...@gmail.com" from)
;; Use stmp-auth
(message "Using smtp-auth")
;; Sending mail
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-starttls-credentials
'(("smtp.gmail.com" 587 nil nil)))
(setq smtpmail-auth-credentials '(("smtp.gmail.com"
587 "rodolfo.medina" nil)))
(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 587))
((string-match "rodolfo...@libero.it" from)
;; Use local sendmail
(message "Using local sendmail")
(setq message-send-mail-function
`message-send-mail-with-sendmail))
(t
(error
(concat "Don't know which mail server to use for "
from))))))))

(add-hook 'message-setup-hook 'fs-change-smtp)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

. Does anybody have any suggestion about what should the failure be?
Thanks in advance,
Rodolfo

rodolfo...@gmail.com

unread,
Feb 10, 2006, 7:20:52 AM2/10/06
to
I tried again, using gnus cvs this time, and it seems that I can
retrieve mail from
my gmail account. See previous message for the complete configuration.
But there are still problems with sending mail. Here's the output of
messages buffer
wen I try to send a mail:

Sending...
Sending via mail...
Loading mailalias...done
Opening STARTTLS connection to `smtp.gmail.com'...done
220 mx.gmail.com ESMTP e19sm464363qba
250-mx.gmail.com at your service
250-SIZE 20971520
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
220 2.0.0 Ready to start TLS
250-mx.gmail.com at your service
250-SIZE 20971520
250-8BITMIME
250-AUTH LOGIN PLAIN
250 ENHANCEDSTATUSCODES
SMTP password for smtp.gmail.com:587:
SMTP password for smtp.gmail.com:587: .
SMTP password for smtp.gmail.com:587: ..
SMTP password for smtp.gmail.com:587: ........
334 VXNlcm5hbWU6
334 UGFzc3dvcmQ6
235 2.7.0 Accepted
byte-code: Wrong type argument: consp, nil


Can anybody provide help about what the problem could be and how to
work it out?
Thanks in advance for any help,
Rodolfo

rodolfo...@gmail.com

unread,
Feb 10, 2006, 9:17:12 AM2/10/06
to
Sorry, my mistake: the output of Messages buffer is the following:

Sending...
Sending via mail...
message-send-mail-with-sendmail: Sending...failed to sendmail: warning:
My hostname localhost is not a fully qualified name - set myhostname or
mydomain in /etc/postfix/main.cf; postdrop: warning: My hostname
localhost is not a fully qualified name - set myhostname or mydomain in
/etc/postfix/main.cf;


Rodolfo

Tim McNamara

unread,
Feb 10, 2006, 12:23:15 PM2/10/06
to
rodolfo...@gmail.com writes:

Have you configured Gnus to send mail from your local system using
sendmail, which is not part of Emacs/Gnus but instead a part of your
operating system? It looks like sendmail is complaining that your
computer does not have a fully qualified domain name. "localhost" is
not a FQDN, but is the default name for your computer until you have
configured the FQDN. An FQDN for your computer would look like
mycomputer.myisp.com (just as smtp.gmail.com is the FQDN for their
server).

Can you configure Gnus to use smtpmail-send-it instead of sendmail?

(setq send-mail-function 'smtpmail-send-it)
(setq message-send-mail-function 'smtpmail-send-it)

(setq smtpmail-smtp-server "smtp.server")
(setq smtpmail-auth-credentials
'(("smtp.server" portnumber "username" "password")))

You'd need to fill in the appropriate values for gmail's SMTP server,
the port (25 is the standard port, but a secure server may use a
different port),

Rodolfo Medina

unread,
Feb 11, 2006, 6:51:39 PM2/11/06
to
... Now I can fetch and send mail through gnus and my gmail account,
but with a problem left: if I send a mail to myself, using gnus,
gnus does not manage to fetch it from gmail. Instead, if I send a mail
to myself without using gnus (directly through gmail account), then
gnus fetches it.
Can anybody tell why this happens and how to work it out?
I'm reporting my .gnus.el.
I'm using emacs cvs and gnus cvs, the gnutls package and pop3.el
from T-gnus (m17n.org):

http://cvs.m17n.org/viewcvs/*checkout*/root/gnus/lisp/pop3.el?only_with_tag=t-gnus-6_17-quimby&rev=1.6.30.21.4.16

;;;;;;;;;;;;;.gnus.el;;;;;;;;;;;;;;;;;;;;;;


;; The following line is needed when using pop3.el from T-gnus
(m17n.org).
(eval-after-load "mail-source" '(require 'pop3))


(setq gnus-select-method '(nnml ""))


(setq user-full-name "Rodolfo Medina")

(setq user-mail-address "rodolfo...@gmail.com")


(setq mail-sources
'(;(file :path "/var/spool/mail/rodolfo.medina")


(pop :server "pop.gmail.com"
:port 995
:user "rodolfo.medina"
:connection ssl
:leave t)))

;; Sending mail


(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))
(setq smtpmail-auth-credentials '(("smtp.gmail.com" 587
"rodolfo.medina" nil)))
(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 587)

;;;;;;;;;;;;;;;;;;;;;;end of .gnus.el;;;;;;;;;;;;;;;;;;;;;;;;;;


Thanks,
Rodolfo

Rodolfo Medina

unread,
Aug 4, 2006, 10:35:57 AM8/4/06
to
"Rodolfo Medina" <romeo...@libero.it> writes:

> I've tried to follow the indications at:
>
> http://mail.google.com/support/bin/answer.py?answer=13287
>
> in order to configure gnus to fetch and send mail from and to
> gmail, but it doesn't work: gnus sticks when opened.
>

> [...]


>
> Is anybody there who has a direct experience in the matter?


That's the way:

..............................

I downloaded and installed emacs cvs (see:

http://forums.debian.net/viewtopic.php?t=8004

);

I downloaded and installed gnus cvs (see:

http://groups.google.com/group/gnu.emacs.gnus/tree/browse_frm/thread/09c171f0fc7182a8/adff32b02f135708?hl=en&rnum=11&lnk=nl

);

from
ftp://ftp.gnupg.org/gcrypt/libgpg-error
I downloaded libgpg-error-1.1.tar.gz and installed it the usual way;

from
ftp://ftp.gnupg.org/gcrypt/libgcrypt/
I downloaded libgcrypt-1.2.2.tar.gz and installed it the usual way;

from
http://www.gnu.org/software/gnutls/
I downloaded gnutls-1.2.9.tar.bz2 and installed it the usual way;

from
http://cvs.m17n.org/viewcvs/*checkout*/root/gnus/lisp/pop3.el?only_with_tag=t-gnus-6_17-quimby&rev=1.6.30.21.4.16
I fetched the file pop3.el, put it in '~/' and did:
$ cd ~/gnus/lisp
$ mv pop3.el pop3.el-original
$ cp ~/pop3.el pop3.el
;

I removed `~/tmp/libgpg-error-1.1.tar.gz', `~/tmp/libgpg-error-1.1',
`~/tmp/libgcrypt-1.2.2.tar.gz', `~/tmp/libgcrypt-1.2.2',
`~/tmp/gnutls-1.2.9.tar.bz2', `~/tmp/gnutls-1.2.9',
`~/tmp/pop3.el'.
In .gnus.el I put the following stuff:


------------------------------------------------------------------------


; The following line is needed when using pop3.el from T-gnus (m17n.org).
(eval-after-load "mail-source" '(require 'pop3))

(setq user-full-name "Rodolfo Medina")
(setq user-mail-address "rodolfo...@gmail.com")

(setq mail-sources '((pop :server "pop.gmail.com"

:port 995
:user "rodolfo.medina"
:connection ssl
:leave t)))

; Sending mail
(setq message-send-mail-function 'smtpmail-send-it)
(setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil)))

(setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "rodolfo...@gmail.com" nil)))


(setq smtpmail-default-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-server "smtp.gmail.com")
(setq smtpmail-smtp-service 587)

-------------------------------------------------------------------------

Rodolfo Medina

unread,
Aug 4, 2006, 10:36:23 AM8/4/06
to
"Rodolfo Medina" <romeo...@libero.it> writes:

> ... Now I can fetch and send mail through gnus and my gmail account,
> but with a problem left: if I send a mail to myself, using gnus,
> gnus does not manage to fetch it from gmail. Instead, if I send a mail
> to myself without using gnus (directly through gmail account), then
> gnus fetches it.
> Can anybody tell why this happens and how to work it out?

I turned the question to the Gmail support and that's what they replied:

-----------------------------------------------------------------------
If you've enabled POP, Gmail will download a copy of every message you
send or receive, except for messages in 'Spam' and 'Trash.' Messages
already available in your mail client will not be downloaded again.

In order to avoid duplicates, Gmail doesn't download copies of messages
sent from within your mail client.
-----------------------------------------------------------------------

Bye,
Rodolfo

Hadron Quark

unread,
Aug 4, 2006, 11:25:54 AM8/4/06
to
Rodolfo Medina <rodolfo...@gmail.com> writes:

> "Rodolfo Medina" <romeo...@libero.it> writes:
>
>> I've tried to follow the indications at:
>>
>> http://mail.google.com/support/bin/answer.py?answer=13287
>>
>> in order to configure gnus to fetch and send mail from and to
>> gmail, but it doesn't work: gnus sticks when opened.
>>
>> [...]
>>
>> Is anybody there who has a direct experience in the matter?
>
>
> That's the way:

When I compile emacs following the instructions I get a white emacs
which says it cant load ~/.gnus

--

Rodolfo Medina

unread,
Aug 4, 2006, 1:58:19 PM8/4/06
to
Hadron Quark <hadro...@gmail.com> writes:

> Rodolfo Medina <rodolfo...@gmail.com> writes:
>
>> "Rodolfo Medina" <romeo...@libero.it> writes:
>>
>>> I've tried to follow the indications at:
>>>
>>> http://mail.google.com/support/bin/answer.py?answer=13287
>>>
>>> in order to configure gnus to fetch and send mail from and to
>>> gmail, but it doesn't work: gnus sticks when opened.
>>>
>>> [...]
>>>
>>> Is anybody there who has a direct experience in the matter?
>>
>>
>> That's the way:
>
> When I compile emacs following the instructions I get a white emacs
> which says it cant load ~/.gnus

What instructions do you mean? Can you report the steps you did?

Rodolfo

0 new messages