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

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

[h-e-w] Gnus,Gmail and sending email...success!


From: sivaram.neelakandan
Subject: [h-e-w] Gnus,Gmail and sending email...success!
Date: Sat, 20 Aug 2005 22:39:17 +0530


Hello,

I finally got GNUS to send emails on ntemacs via Gmail.  I assume
there is a need for this as I was not able to find any references on
how to get GNUS, GNUTLS and Gmail working on the win32 platform.  In
the hope that someone might find it useful, I'm posting details here.

1 GNU Emacs 22.0.50.2 (i386-mingw-nt5.1.2600) of 2005-04-17 on LAPTOP
2 Gnus v5.11
3 Win XP PRO SP2
4 Cygwin installed

I use fetchmail coupled with ssl on cygwin to fetch my email with the
following setup

--8<---------------cut here---------------start------------->8---
#File : .fetchmailrc
# set postmaster "sivaram"

# poll pop.gmail.com with proto POP3 and options no dns
# user 'address@hidden' is 'sivaram' here options ssl
poll gmail
         proto pop3
         via pop.gmail.com
         user 'address@hidden'
         pass 'xxxxxxx'
         is 'sivaram'
         keep
         fetchall
         ssl
         mda "/usr/bin/procmail -d %T"
--8<---------------cut here---------------end--------------->8---

and in .gnus.el

--8<---------------cut here---------------start------------->8---
(setq gnus-select-method '(nnnil "")) 
(add-to-list 'gnus-secondary-select-methods '(nnfolder ""))
(eval-after-load "mail-source"
  '(add-to-list 'mail-sources '(file :path    
  "/var/spool/mail/sivaram")))     
(eval-after-load "mail-source" '(require 'pop3))
--8<---------------cut here---------------end--------------->8---

This gets me my mail from my Gmail account into Gnus.  This has been
working for a few months now.

To get Gnus to send emails

1  Down-load msmtp-1.4.4-win32.zip from http://msmtp.sourceforge.net/
2  Extract it to some directory say c:\msmtp
3  create a msmtprc.txt file with the following details(replace with
your details where appropriate)

--8<---------------cut here---------------start------------->8---
  account default
  host smtp.gmail.com
  from address@hidden
  port 587
  auth on
  user address@hidden
  password YOUR_PASSWORD
  tls on
  # use this for debugging output
  logfile c:\msmtplog.txt
--8<---------------cut here---------------end--------------->8---

and put it in the same directory as the msmtp binary.

4 create a file testmail.txt with a simple email body.
--8<---------------cut here---------------start------------->8---
Subject: Test

test email
--8<---------------cut here---------------end--------------->8---

5 From the command line, issue this
msmtp --file=c:\msmtp\msmtprc.txt < c:\testmail.txt address@hidden

There should be an email in your Gmail account(replace address@hidden
 with yours of course).  If it's not there,
umm... the rest of the email is of no use to you. :-)

This worked OOTB for me, so I really can't offer any advice but ask
you to check the msmtp log file to see what the error is and fix it.[1]

6 If msmtp worked in the previous step, then plug the following into
.gnus.el

(setq sendmail-program "/usr/bin/msmtp.exe")

and nothing else.  I commented out the following

send-mail-function
message-send-mail-function
smtpmail-default-smtp-server
smtpmail-local-domain
smtpmail-sendto-domain
smtpmail-starttls-credentials
smtpmail-auth-credentials
smtpmail-smtp-service

7 Going back to the command line, issue
  msmtp --version

It  should tell you where it looks for the msmtprc.txt file;  The
output from my run is given below.

System configuration file name: C:\Documents and Settings\All Users\Application
Data\msmtprc.txt
User configuration file name: C:\Documents and Settings\siv\Application Data
\msmtprc.txt

Copy the msmtprc.txt to BOTH the locations

8  Now launch gnus and send an email to yourself, it should work.  If
it doesn't, examine the msmtp log file to see what the problem is, as
well as the Emacs Message buffer to see what went wrong.  It didn't
work for quite some time for me as gnus continued to use the default
SMTP functions defined in the general case in the .gnus.el file.

9  For additional customisation of the msmtp config file read the
manual which comes with the binary.

I suspect, for those without cygwin, there might be issues with ^M
characters and the like while sending, though I haven't tried.  I
should also thank Martin Lambers <marlam (at) marlam.de> for his
patient help with msmtp, who BTW is the author of the tool. 

I might post this to gnu.emacs.gnus or gnus.ding if help-emacs-windows
useful considers this useful for further dissemination.

regards,
Sivaram


Footnotes:
[1]  You can contact the author of the package msmtp, Martin Lambers
regarding any issues with the stand alone msmtp email sending.


reply via email to

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