VM (View Mail) for Emacs

stunnel on Windows

Asked by usr345 on 2010-04-24

Hi everyone.
I tried to install vm on Windows, but when I tried to get the mail from gmail using ssl, an error emerges, emacs hanges-up. Here is the code from .emacs:

(add-to-list 'load-path
             (expand-file-name "~/vm/lisp"))
(add-to-list 'Info-default-directory-list
             (expand-file-name "~/vm/info"))
(require 'vm-autoloads)

(setq vm-primary-inbox "~/mail/inbox.mbox")
(setq vm-crash-box "~/mail/inbox.crash.mbox")
(setq vm-spool-files `((,vm-primary-inbox
                            "pop-ssl:pop.gmail.com:995:pass:usr345:PASSWORD"
                            ,vm-crash-box)))
(setq vm-stunnel-program "g:/program files/stunnel/stunnel.exe")

So, the questions:
1. How to configure pop-ssl on Windows?
2. How to configure smtp for gmail?
3. How can I use several mail accounts? I have some accounts on mail.ru, they use ordinary pop without encryption, and I could get the mail from them, but don't know how to sent with smtp.

thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
VM Edit question
Assignee:
No assignee Edit question
Solved by:
Andy Hong
Solved:
2011-09-26
Last query:
2011-09-26
Last reply:
2011-09-26
Uday Reddy (reddyuday) said : #1

Hi, thanks for posting your question here. However, the newsgroup gnu.emacs.vm.info is a better forum for getting answers to such questions because it is read by most users. You can also cross-post to gnu.emacs.help or comp.emacs.

From what I can tell, your stunnel program is not successful in connecting to gmail. Some things to check:

- if you type C-g (perhaps a few times), does Emacs recover control?

- what is in the buffer "trace of POP ..."?

- Can you connect to any other SSL connection with your stunnel program? Where did you get this program from?

Regarding your other questions:

- As far as I know, there is nothing special to be done to configure stunnel on windows. But you need to check the documentation of your stunnel program. I found this on the web, for instance:

http://spampal.sanesecurity.com/manual_eng/servers/stunnel/stunnel.htm#sconfig21

- Setting up smtp for gmail is known to be complicated. The EmacsWiki page on Gnus Gmail setup has some useful info:

http://www.emacswiki.org/emacs/GnusGmail

If you can't get this to work, then you need to check gnu.emacs.help and comp.emacs newsgroups on Google Groups.

- If you want to use several email accounts, then you need to first decide whether you want to download all their messages into a single INBOX or whether you want to keep them separate.

In either case, all you need to do is to add separate entries for each POP account in the vm-spool-files list. I have never tried to download mail from multiple accounts into the same INBOX and feel a bit nervous about doing that. I think you would be better off creating separate INBOX folders for different accounts.

Uday Reddy

Uday Reddy (reddyuday) said : #2

The stunnel program in the Cygwin distribution worked for gmail out of the box. No configuration was necessary.

usr345 (usr345) said : #3

I installed stunnel from cygwin. emacs stopped hanging, but vm doesn't get any mail, though I sent a test email and "the bat" could get it. Here is my new config:

(add-to-list 'load-path
             (expand-file-name "~/vm/lisp"))
(add-to-list 'Info-default-directory-list
             (expand-file-name "~/vm/info"))
(require 'vm-autoloads)

(setq vm-primary-inbox "~/mail/inbox.mbox")
(setq vm-crash-box "~/mail/inbox.crash.mbox")
(setq vm-spool-files `((,vm-primary-inbox
                            "pop-ssl:pop.gmail.com:995:pass:usr345:PASSWORD"
                            ,vm-crash-box)))
(setq vm-stunnel-program "g:/www/cygwin/bin/stunnel.exe")

usr345 (usr345) said : #4

I could get the mail, using the configs, that the guy wrote in:
http://groups.google.com/group/gnu.emacs.vm.info/browse_thread/thread/74d86acbdeca80c9?pli=1

I enabled IMAP in gmail and used this:
(setq vm-imap-folder-cache-directory (substitute-in-file-name
      "~/mail/"))

(setq vm-imap-account-alist '(
       ("imap-ssl:imap.gmail.com:993:*:login:<email address hidden>:PASSWORD"
       "gmail") ))

(setq vm-primary-inbox
      "imap-ssl:imap.gmail.com:993:inbox:login:<email address hidden>:PASSWORD")

(setq vm-auto-get-new-mail t)

(setq vm-send-using-mime t)
(setq vm-stunnel-program
      "g:/www/cygwin/bin/stunnel.exe")

(setq send-mail-function 'smtpmail-send-it
      message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))
      smtpmail-default-smtp-server "smtp.gmail.com" smtpmail-smtp-server
      "smtp.gmail.com" smtpmail-smtp-service 587 smtpmail-debug-info t)
(require 'smtpmail)

But when I try to send the mail, it says: SMTP protocol error

Is there a way to config pop?

Uday Reddy (reddyuday) said : #5

Ok, congratulations on getting the mail downloaded!

Please note that there is an important difference between your earlier
method and this one. You were originally trying to use "local
folders" but now you are using "server folders". The new method is
actually better. So, well done!

For sending mail, you are going to be using Emacs's sendmail
functionality, with smtpmail package. (These things are not part of
VM, but rather of Emacs.)

gmail wants you to use a security protocol program called starttls,
which is part of the gnutls package in Cygwin. Please check to see if
you have installed it and whether it is on your exec-path.

Assuming all of these set up, please look up the gnu.emacs.help group
for keys like "gmail smtp" or "gmail starttls". It is pretty to hard
to debug this stuff, unfortunately.

Cheers,
Uday

Uday Reddy (reddyuday) said : #6

There is apparently a problem with the starttls.el file (which should
be under your Emacs lisp/gnus directory) on MS Windows.

A solution posted in gmane.emacs.windows newsgroup (rob.davenport,
2006-08-07) is as follows. Please try it and see if it works for you.

---

I did not exactly attempt the procedure you describe below. But I did
the following instead:

I looked at the code of the "original" starttls.el, and used it to
make the following modifications to a recent version (from Emacs
22.0.50 CVS) of starttls.el.

1. Added:
(defcustom starttls-kill-program "c:\\cygwin\\bin\\kill"
  "External kill command to send SIGALRM to starttls."
  :group 'starttls)

2. Replaced all three instances of:
(signal-process (process-id process) 'SIGALRM)
with
(call-process starttls-kill-program nil nil nil
                                   "-ALRM" (format "%d" (process-id process)))

With these modifications, the most recent version of starttls.el
worked fine with Cygwin and gnutls-cli 1.0.25. (I am using
Wanderlust, but I assume that this would also work for gnus.)
Thank you very much for your help.
Hans

---

usr345 (usr345) said : #7

1. I installed Cygwins gnutls.
2. In .emacs wrote:

(setq send-mail-function 'smtpmail-send-it
      message-send-mail-function 'smtpmail-send-it
      smtpmail-starttls-credentials
      '(("smtp.gmail.com" 587 nil nil))
      smtpmail-auth-credentials
      (expand-file-name "~/.authinfo")
      smtpmail-default-smtp-server "smtp.gmail.com"
      smtpmail-smtp-server "smtp.gmail.com"
      smtpmail-smtp-service 587
      smtpmail-debug-info t)

(require 'starttls)
(setq starttls-use-gnutls t)
(setq smtpmail-debug-info t)
(setq smtpmail-debug-verb t)
(require 'smtpmail)

I created "~/.authinfo" file with gmail credentials.

3. I removed starttls.elc, so the compiled version won't be loaded by emacs.
4. I replaced

(signal-process (process-id process) 'SIGALRM)

to

(call-process "g:\\www\\cygwin\\bin\\kill.exe" nil nil nil
"-ALRM" (format "%d" (process-id
process)))

I used the description from:
http://obfuscatedcode.wordpress.com/2007/04/26/configuring-emacs-for-gmails-smtp/

5. When I try to send the mail, it says in minibuffer: "Sending failed SMTP error"

In the debug buffer I get an error:

'Process SMTP exited abnormally with code 53'

that doesn't tell me anything useful.

Uday Reddy (reddyuday) said : #8

Hi, it is not a problem with the configuration. I think Windows is
not respecting a lot of the kill requests that work in the Unix world.
I will try out msmtp later tonight or tomorrow and let you know if it
works.

Uday Reddy (reddyuday) said : #9

I think the msmtp program is a better bet for gmail. Please try it
out based on the instructions in this message:

http://<email address hidden>/msg00222.html

See the section titled "To get Gnus to send emails". (Don't use any
of the reading email part.)

There are also slightly updated guidelines on Emacswiki:

  http://www.emacswiki.org/cgi-bin/wiki/GnusMSMTP

Best Andy Hong (bj7-andy) said : #10

If anyone is still struggling on Windows with Emacs, VM, Cygwin, Gmail, gnutls, stunnel, etc -- I'd suggest the following:

1. Download and install the Windows binary of stunnel: http://stunnel.org/

2. Edit your stunnel.conf file so that it includes the following:

    [gmail-imap]
    client = yes
    accept = 127.0.0.1:143
    connect = imap.gmail.com:993

    [gmail-smtp]
    client = yes
    accept = 127.0.0.1:587
    connect = smtp.gmail.com:465

3. Run stunnel.

2. Instead of using imap-ssl, use regular old imap to access your gmail mailboxes, but use the port that you created with stunnel:

    (setq
       vm-primary-inbox "imap:127.0.0.1:143:INBOX:login:<email address hidden>:your-gmail-password")

3. Instead of using starttls or gnutls, use regular old smtp to access gmail's smtp servers, but again, use the stunnel port:

    {setq
        send-mail-function 'smtpmail-send-it
        message-send-mail-function 'smtpmail-send-it
        smtpmail-local-domain nil
        smtpmail-sendto-domain nil
        smtpmail-smtp-server "127.0.0.1"
        smtpmail-default-smtp-server "127.0.0.1"
        smtpmail-smtp-service 587
        smtpmail-auth-credentials
        '(("127.0.0.1" 587 "<email address hidden>" "your-gmail-password")))

Last year, I spent countless hours getting an earlier version of Emacs and VM working with Gmail. Then recently, I upgraded to Emacs 23.3 and VM 8.2.0a, and my access to gmail broke. An unfruitful half-day later, I gave up trying to debug and fix my previously working configuration, and instead, went the route explained above with the Windows binary of stunnel. MUCH easier -- it pretty much worked out of the box.

usr345 (usr345) said : #11

"I spent countless hours getting an earlier version of Emacs and VM"

Thank you, sir. I gave up and switched back to the Bat. But this explanation is very helpful for everybody!

Alan Wehmann (alan-wehmann) said : #12

I only became aware of this discussion as of the last two entries, since I didn't subscribe to the mailing list until after the July 19, 2011 announcement that use of gnu.emacs.vm.info was deprecated. And it is only now that I read the earlier entries.

Unaware of this discussion I attempted to use "gnutls" (http://www.gnu.org/software/gnutls/download.html and http://homes.esat.kuleuven.be/~nikos/gnutls-win32/) and the Emacs SMTP Library code (GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO) to send some test emails via smtp.gmail.com. After changing line "(set-buffer-process-coding-system 'raw-text-unix 'raw-text-unix)" to read "(set-buffer-process-coding-system 'raw-text-dos 'raw-text-dos)" in function "smtpmail-via-smtp" in file "smtpmail.el", and changing line "(smtpmail-send-command process (format "STARTTLS"))" to read "(smtpmail-send-command process (format "STARTTLS\n"))", I got to line "(starttls-negotiate process)" and learned about the inability of MS Windows to send alarm 'SIGALRM to begin the TLS negotiation. Had I read the discussion here, I would have saved myself some time.

Along the way I tried using "gnutls-cli-debug" in a shell buffer (using bash) as "gnutls-cli-debug -V -p 587 smtp.gmail.com" and got output that said that TLS wasn't supported. But use of "gnutls-cli -s smtp.gmail.com -p 587 -V" got me the following trace:

Resolving 'smtp.gmail.com'...
Connecting to '209.85.225.109:587'...

- Simple Client Mode:

- Received[45]: 220 mx.google.com ESMTP mk10sm12619292igc.4
EHLO DELLLAPTOP
- Sent: 16 bytes
- Received[125]: 250-mx.google.com at your service, [108.89.145.141]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250 ENHANCEDSTATUSCODES
STARTTLS
- Sent: 9 bytes
- Received[30]: 220 2.0.0 Ready to start TLS

Upon entering an EOF character I got more output, indicating the TLS negotiation was underway.

I eventually gave up on using TLS and gnutls (with Emacs). I considered using "starttls" at "http://www.opaopa.org/pub/elisp/" or Cygwin's "msmtp", but decided instead to use "stunnel" from Cygwin in the same manner that VM uses it to connect to e.g. a POP server. I modified function "smtpmail-via-smtp" in "smtpmail.el" so that it used "stunnel" in this manner and was successful in sending test mails via "smtp.gmail.com:465".

I am still curious as to the meaning of

INTERNAL ERROR: Bad magic at /home/ASchulma/dev/cygwin/stunnel/stunnel-4.49-1/s 6 [sig] stunnel 3920 open_stackdumpfile: Dumping stack trace to stunnel.exe.stackdump

that appears in the trace buffer after the QUIT is issued and accepted (to end the server session). I checked that and this same error message also occurs with VM reading email with pop.gmail.com:995--via stunnel.

Alan Wehmann (alan-wehmann) said : #13

The last sentence in my entry--Answer #12--was garbled. It should have read:

"I checked that this same error message also occurs with VM reading email with pop.gmail.com:995--via stunnel."

I have since explored the suggestion in Answer #6, of using "gnutls-cli" from Cygwin, and signalling the TLS handshake to start via the "kill" program from Cygwin.

As before, I am using GNU Emacs 23.3.1 (i386-mingw-nt5.1.2600) of 2011-03-10 on 3249CTO (on a Dell Latitude D531 laptop running Windows XP Home).

One additional change that I had to make (not mentioned in Answer #6) was in function "smtpmail-read-response". Present there was the line:

 (while (not (search-forward "\r\n" nil t))

which I changed to:

 (while (not (search-forward "\n" nil t))

This was necessary because the initial response from smtp.gmail.com:587 was:

220 mx.google.com ESMTP hy6sm7021189igc.12

which did not have at the end the two characters CRLF that were expected by the unmodified "smtpmail-read-response".

The full output of the trace buffer is shown below. I have added a comment, that starts and ends with "!!!". (I have also changed the CR character that appeared at the end of many lines, to ^M, so that they remain visible and obvious when I insert this text into the the Launchpad "Message" window.)

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

220 mx.google.com ESMTP hy6sm7021189igc.12
!!! this next line was inserted after the QUIT signal was given & is out of order!!!
Process SMTP exited abnormally with code 1
EHLO DELLLAPTOP^M
250-mx.google.com at your service, [108.89.145.141]^M
250-SIZE 35882577^M
250-8BITMIME^M
250-STARTTLS^M
250 ENHANCEDSTATUSCODES^M
STARTTLS^M
220 2.0.0 Ready to start TLS^M
EHLO DELLLAPTOP^M
250-mx.google.com at your service, [108.89.145.141]^M
250-SIZE 35882577^M
250-8BITMIME^M
250-AUTH LOGIN PLAIN XOAUTH^M
250 ENHANCEDSTATUSCODES^M
AUTH PLAIN AEFsYW4uV2VobWFubkBnbWFpbC5jb20AY2FiZXphcGVycm85^M
235 2.7.0 Accepted^M
MAIL FROM:<email address hidden> SIZE=485^M
250 2.1.0 OK hy6sm7021189igc.12^M
RCPT TO:<email address hidden>^M
250 2.1.5 OK hy6sm7021189igc.12^M
DATA^M
354 Go ahead hy6sm7021189igc.12^M
From: Alan Wehmann <email address hidden>^M
MIME-Version: 1.0^M
Content-Type: text/plain; charset=us-ascii^M
Content-Transfer-Encoding: 7bit^M
Message-ID: <email address hidden>^M
Date: Sat, 10 Mar 2012 05:48:32 -0600^M
To: <email address hidden> ^M
Subject: test #2 of using Cygwin gnutls-cli^M
X-Mailer: VM 8.2.0b under 23.3.1 (i386-mingw-nt5.1.2600)^M
Reply-To: <email address hidden>^M
^M
test #2 of using Cygwin gnutls-cli^M
-- ^M
Alan Wehmann^M
<email address hidden>^M
.^M
250 2.0.0 OK 1331483970 hy6sm7021189igc.12^M
QUIT^M
221 2.0.0 closing connection hy6sm7021189igc.12^M
*** Fatal error: A TLS packet with unexpected length was received.
*** Server has terminated the connection abnormally.

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

To understand better the out-of-order line insertion, I temporarily changed the process filter function (smtpmail-process-filter) and had it also insert all output from smtp.gmail.com:587 into a separate buffer. That buffer's contents are shown below:

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

250-mx.google.com at your service, [108.89.145.141]^M
250-SIZE 35882577^M
250-8BITMIME^M
250-STARTTLS^M
250 ENHANCEDSTATUSCODES^M
220 2.0.0 Ready to start TLS^M
*** Starting TLS handshake
- Certificate type: X.509
 - Got a certificate list of 2 certificates.
 - Certificate[0] info:
  - subject `C=US,ST=California,L=Mountain View,O=Google Inc,CN=smtp.gmail.com', issuer `C=US,O=Google Inc,CN=Google Internet Authority', RSA key 1024 bits, signed using RSA-SHA1, activated `2011-11-18 01:57:17 UTC', expires `2012-11-18 02:07:17 UTC', SHA-1 fingerprint `f392aeb428fe64036fe155ed719e5ff688905a57'
 - Certificate[1] info:
  - subject `C=US,O=Google Inc,CN=Google Internet Authority', issuer `C=US,O=Equifax,OU=Equifax Secure Certificate Authority', RSA key 1024 bits, signed using RSA-SHA1, activated `2009-06-08 20:43:27 UTC', expires `2013-06-07 19:43:27 UTC', SHA-1 fingerprint `dd7a7f131ddba33d3e8670179483e6fea6987d6a'
- The hostname in the certificate matches 'smtp.gmail.com'.
- Peer's certificate issuer is unknown
- Peer's certificate is NOT trusted
- Version: TLS1.0
- Key Exchange: RSA
- Cipher: ARCFOUR-128
- MAC: SHA1
- Compression: NULL
250-mx.google.com at your service, [108.89.145.141]^M
250-SIZE 35882577^M
250-8BITMIME^M
250-AUTH LOGIN PLAIN XOAUTH^M
250 ENHANCEDSTATUSCODES^M
235 2.7.0 Accepted^M
250 2.1.0 OK hy6sm7021189igc.12^M
250 2.1.5 OK hy6sm7021189igc.12^M
354 Go ahead hy6sm7021189igc.12^M
250 2.0.0 OK 1331483970 hy6sm7021189igc.12^M
221 2.0.0 closing connection hy6sm7021189igc.12^M
*** Fatal error: A TLS packet with unexpected length was received.
*** Server has terminated the connection abnormally.

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

From this it can be seen that the out-of-order line is not inserted by using the filter function smtpmail-process-filter. It can also be seen that the trace buffer is receiving the lines that show the TLS handshake.

Character CR (^M) is visible at the end of many lines, because the buffers have coding set for unix line endings (LF--line feed) and the SMTP RFC says to send CRLF at the end of each line.

The out-of-order line insertion is apparently being done in the "process.c" code, in the routine "status_notify".

Alan Wehmann (alan-wehmann) said : #14

Once again I didn't notice a mistake. In answer #13 there is the sentence:

"It can also be seen that the trace buffer is receiving the lines that show the TLS handshake."

It should have read:

It can also be seen that the trace buffer is not receiving the lines that show the TLS handshake.

usr345 (usr345) said : #15

Hi, sir. Thank you for answering my question. But I asked it long ago, when I wanted to switch to Emacs email client from "the bat!". But after facing many hardships I gave up and switched back to "the bat!". Do you think it's worth to try Emacs again?

Uday Reddy (reddyuday) said : #16

usr345 writes:

> Hi, sir. Thank you for answering my question. But I asked it long ago,
> when I wanted to switch to Emacs email client from "the bat!".

Dear user, if you recall, I mentioned that you need ask the question in the
VM users newsgroup in order to reach all the VM users. As it happens, the
people who might have been able to answer your question didn't see your
question.

> But after facing many hardships I gave up and switched back to "the
> bat!". Do you think it's worth to try Emacs again?

If you see the benefit in using Emacs VM, I encourage you to persist. But
please make sure that you subscribe to the mailing list or use the newsgroup
on the web. I also notice that your question was asked and answered on the
Stackoverflow web site:

  http://stackoverflow.com/questions/6008917/setup-for-gmail-in-emacs-vm

I suggest that any further discussion of this issue be taken to the
stackoverflow web site, because it is much better than Launchpad for
complicated issues.

Andy and Alan, you might want to copy your answers to stackoverflow as
well. I intend to shut down the Launchpad answers site at some point and
make stackoverflow the official answers site.

Cheers,
Uday

Alan Wehmann (alan-wehmann) said : #17

I took a look at

http://stackoverflow.com/questions/6008917/setup-for-gmail-in-emacs-vm

and see nothing there that is specific to using SMTP on Windows with Emacs, which is one of the subjects of usr345's question. An answer for Unix (or Linux) doesn't deal with the peculiarities of MS Windows. What did I miss?

For example "http://bc.tech.coop/blog/061023.html" or "http://tkj.freeshell.org/emacs/reading-and-sending-email/" would appear to be helpful, but they are not directly applicable to MS Windows.

I did a search at Stackoverflow on "emacs smtp" and saw nothing very pertinent on the first few web pages that were offered.

Uday Reddy (reddyuday) said : #18

Alan Wehmann writes:

> I took a look at
>
> http://stackoverflow.com/questions/6008917/setup-for-gmail-in-emacs-vm
>
> and see nothing there that is specific to using SMTP on Windows with
> Emacs, which is one of the subjects of usr345's question. An answer for
> Unix (or Linux) doesn't deal with the peculiarities of MS Windows. What
> did I miss?

Then the user can ask the question there about how to get it to work on
Windows. The question can be tagged with "Windows", "Emacs", "gmail",
"starttls", "smtp" etc. and the people that monitor those tags will be able
to give better answers than we can.

More generally, stackoverflow has a much better infrastructure for questions
& answers than Launchpad does. So, I would like us to move there for
questions & answers.

Cheers,
Uday

Alan Wehmann (alan-wehmann) said : #19

I tried to move this discussion to Stackoverflow and kept getting the error message:

"Oops! Your edit couldn't be submitted because:

    Your post appears to contain code that is not properly formatted as code. Please indent all code by 4 spaces using the code toolbar button or the CTRL+K keyboard shortcut. For more editing help, click the [?] toolbar icon."

Even dividing my submission into pieces, I couldn't get everything in--without running into this error message. And it isn't obvious what is triggering this message.

In addition, I wasn't allowed to have more than two links in what was submitted.

In my view, Stackoverflow has too many constraints on what can be submitted!

I ended up deleting all that I had entered at Stackoverflow (first piece, then edit to put in second piece, then edit to put in third piece, etc.)

Uday Reddy (reddyuday) said : #20

Well, in my opinion, the constraints are what make the Stackoverflow a good web site for questions & answers. They force you to be succinct and to-the-point. You can also post an initial answer and refine it later by editing it.

I myself haven't posted on stackoverflow all that much. But I have used some of its sister sites within the StackExchange family. They work quite brilliantly.

Or, you can just post your answer to viewmail-info if you wish, and I can edit it and add it to stackoverflow.

Cheers,
Uday

usr345 (usr345) said : #21

Stackoverflow is not for discussions. It's just for 1 question - several answers.

Uday Reddy (reddyuday) said : #22

usr345 writes:

> Stackoverflow is not for discussions. It's just for 1 question - several
> answers.

People can also add comments (to both the question and the answers). But
the comments have constraints too so that they don't go off on big tangents.

When they want a new refined question, people open a new question and link
it to the old one.

Alan Wehmann (alan-wehmann) said : #23

I think that I now understand why I was getting the error message shown in Answer #19. Since Stackoverflow likes a question, answers and comments, I thought to start off with the original question, and so I created:

http://stackoverflow.com/questions/9694912/reading-and-writing-email-from-emacs-using-a-secure-server-gmail

I then thought to add "answers" and "comments" to make this appear "kosher" to Stackoverflow, but I got told I couldn't answer my "own question" for 8 hours--because I am a newbie. So, for the next eight hours I'll be dormant. Other participants in this discussion can jump in during that period, if they so desire (in that case, ignore the bold text at the end of my "question").

Alan Wehmann (alan-wehmann) said : #24

The link to the Stackoverflow "question" might more properly be:

http://stackoverflow.com/q/9694912/1264870

usr345 (usr345) said : #25

I don't think, it's reasonable to move the discussion to stackoverflow from here. Because anybody, who needs the info can google and read it from here. No need to duplicate the info in 2 places.

Another reason, why I moved from VM, cause sometimes it freezed emacs, when checking email. I think, I can describe all the difficulties I faced. If we could overcome them - VM would be a good email client.

Uday Reddy (reddyuday) said : #26

usr345 writes:

> Another reason, why I moved from VM, cause sometimes it freezed emacs,
> when checking email. I think, I can describe all the difficulties I
> faced. If we could overcome them - VM would be a good email client.

You can file bug reports by using M-x vm-submit-bug-report, and we can look
into those issues.

Uday Reddy (reddyuday) said : #27

Thanks very much for doing this, Alan. I feel that it would be better to
file separate questions for each of the issues faced. Getting email and
sending email are different issues, which are handled by different programs
both from the Emacs end and the protocols and servers.

Moreover, I didn't see a real problem with getting email. user345 was using
some unspecified stunnel program initially. But when he used Cygwin
stunnel, things worked fine.

So, if you don't mind, I will edit the question to focus on sending mail.
And, that is a question that has nothing to do with VM. It is Emacs and
gnutls that are at issue.

Uday Reddy (reddyuday) said : #28

Uday Reddy writes:

> So, if you don't mind, I will edit the question to focus on sending mail.
> And, that is a question that has nothing to do with VM. It is Emacs and
> gnutls that are at issue.

On second thoughts, I kept Alan's original question for "getting mail" and
opened a new question for "sending mail". The URL is:

http://stackoverflow.com/questions/9699256/how-to-configure-emacs-smtp-for-using-a-secure-server-gmail