Re: [VM] IMAP-SSL with Exchange Server

2012-06-22 Thread Lewis Perin
As far as I can tell, I’ve implemented all the suggestions received here
regarding my problem connecting to Microsoft Exchange Server via
imap-ssl from native Windows Emacs 23.1.1 using vm.  I’ve upgraded to vm
8.2.0b and convinced Cygwin to accept Windows filename conventions and
not complain to vm.  But still my password is rejected as “incorrect”.
As I’ve said before, my account on Exchange Server is accessible from my
iPhone, and my vm setup works fine with Gmail.

At this point, would it be appropriate to file a bug on the Launchpad
site?

I’ve appended my current .vm in case anyone wants to find a flaw I’ve
missed:

;; start of .vm

(setq vm-imap-account-alist
  '(
(imap-ssl:imap.gmail.com:993:*:login:m...@gmail.com:* Gmail)
(imap-ssl:owa.myschool.edu:993:*:login:m...@myschool.edu:* Cornell 
IMAP)
)
 )
(setq vm-primary-inbox
imap-ssl:owa.myschool.edu:993:inbox:login:m...@myschool.edu:*)
(setq vm-reply-subject-prefix Re: )
(setq vm-stunnel-program c:/cygwin/bin/stunnel.exe)

; Debugging only:
(setq vm-debug t)
(setq vm-imap-keep-trace-buffer t)
(setq vm-imap-log-sessions t)

; Stylistic:
(setq vm-preview-lines t) ; Show as much of message as possible

; Directories
(setq vm-folders-summary-directories '(c:/Mail/))
(setq vm-mime-all-attachments-directory c:/detached/)
(setq vm-mime-attachment-save-directory c:/detached/)
(setq vm-folder-directory c:/Mail/)
(setq vm-temp-file-directory c:/temp/)
(setq vm-imap-folder-cache-directory c:/temp/)

; Keys

(define-key vm-mail-mode-map \C-c\C-a 'mail-abbrev-insert-alias)

; Rendering

(setq vm-mime-text/html-handler nil) ; disable lynx til it's useful

;;; end of .vm

/Lew
---
Lew Perin / pe...@acm.org
http://babelcarp.org


Re: [VM] IMAP-SSL with Exchange Server

2012-06-22 Thread Uday Reddy
Lewis Perin writes:

 At this point, would it be appropriate to file a bug on the Launchpad
 site?

The best way to file bug reports is to use M-x vm-submit-bug-report.  But
the bug-report function normally doesn't include private information in
your settings, such as logins.  So, you might need to add them manually.

The only problem you seem to have at the moment is that the login didn't
work.  So, that is what you need to check.

 
 I’ve appended my current .vm in case anyone wants to find a flaw I’ve
 missed:
 
 ;; start of .vm
 
 (setq vm-imap-account-alist
   '(
 (imap-ssl:imap.gmail.com:993:*:login:m...@gmail.com:* Gmail)
 (imap-ssl:owa.myschool.edu:993:*:login:m...@myschool.edu:* Cornell 
 IMAP)
 )
  )

The login should be whatever your IMAP server wants you to use.  It seems to
unlikely that they want you to use something like m...@myschool.edu.  You
should check the documentation you have been given for your IMAP server.

Cheers,
Uday



Re: [VM] IMAP-SSL with Exchange Server

2012-06-22 Thread Lewis Perin
Uday Reddy usr.vm.ro...@gmail.com writes:

Lewis Perin writes:

 At this point, would it be appropriate to file a bug on the Launchpad
 site?

The best way to file bug reports is to use M-x vm-submit-bug-report.  But
the bug-report function normally doesn't include private information in
your settings, such as logins.  So, you might need to add them manually.

The only problem you seem to have at the moment is that the login didn't
work.  So, that is what you need to check.

 
 I’ve appended my current .vm in case anyone wants to find a flaw I’ve
 missed:
 
 ;; start of .vm
 
 (setq vm-imap-account-alist
   '(
 (imap-ssl:imap.gmail.com:993:*:login:m...@gmail.com:* Gmail)
 (imap-ssl:owa.myschool.edu:993:*:login:m...@myschool.edu:* 
 Cornell IMAP)
 )
  )

The login should be whatever your IMAP server wants you to use.  It seems to
unlikely that they want you to use something like m...@myschool.edu.  You
should check the documentation you have been given for your IMAP server.

Sorry, I should have made clear that “m...@myschool.edu” is a
de-identified version of the real thing.  The actual login in my .vm is
the same as the one I use when fetching mail from the same server via my
mobile phone.

/Lew
---
Lew Perin / pe...@acm.org
http://babelcarp.org


Re: [VM] IMAP-SSL with Exchange Server

2012-06-15 Thread Uday Reddy
Lewis Perin writes:

 So, where does it get into trouble?
 
 Immediately on login, I get “vm-imap-protocol-error: IMAP protocol
 error: unexpected char (10)”.  

Indeed, you said that.   But what is in the trace buffer at this point?  In
particular, is there a line without a CR character (^M)?

 And, as I noted earlier in this thread,
 when I tried setting vm-imap-tolerant-of-bad-imap to 1, emacs became
 unresponsive and eventually exhausted its memory.

Evidently, there is a problem with the server interaction.  So, setting this
flag doesn't help us.

Cheers,
Uday



Re: [VM] IMAP-SSL with Exchange Server

2012-06-15 Thread Lewis Perin
John Hein jz4rfcq...@snkmail.com writes:

Lewis Perin wrote at 10:50 -0400 on Jun 15, 2012:
  John Hein writes:
  Uday Reddy wrote at 00:01 +0100 on Jun 15, 2012:
Lewis Perin writes:
   
 By the way, the trace of my IMAP session does say this before I run
 into trouble:

 * OK The Microsoft Exchange IMAP4 service is ready.
   
If it gets this far, then stunnel is unlikely to be the problem.
   
So, where does it get into trouble?
  
  You can also skip vm  stunnel completely and use command
  line:
  
  openssl s_client -connect your.imapserver.com:993
  .. login youra...@yourdom.com yourpassword
  .. list  *
  
  Well, that was interesting!  The openssl command got me the “* OK The
  Microsoft Exchange IMAP4 service is ready.” response I expected, but the
  login request wasn’t even seen as a complete request until I appended
  the -crlf option to the openssl command as suggested here:
  

  http://stackoverflow.com/questions/8682976/imap-connection-carriage-return-line-feed-issue-from-linux
  
  And then the response to the login request was “login BAD Command
  Error. 12”.  Not sure what that means.  As I said earlier in the thread,
  my credentials get accepted by Exchange Server when submitted from my
  iPhone.
  
  I wonder, though, if the -crlf openssl option could be a clue to why vm
  and Exchange aren’t happy with each other.  Is vm sending linefeeds only?


Re: login BAD Command...

You need _some_ sequence before the word login.
Like . login you yourpw or x login you yourpw.

When I use login me mypw on my imap server, I get login BAD Error
 in response.  When I use  login me (with no password), I
get xxx BAD Error.  So based on your quoted error message, I'm
guessing you negelected to add the leading sentinel string.

Yes, that’s exactly right; thanks!

But addressing that issue just yields a different error, sadly:

.. login m...@myschool.edu mypassword
.. NO LOGIN failed.

But - I’ve been googling a lot lately - I tried this instead:

.. login my-windows-domain\me mypassword

and it worked fine.  This is strange - as I said earlier, my iPhone gets
through to the Exchange server, and it has no idea of what Windows
domain claims me.  But using the Windows domain doesn’t help me from vm;
I still get that “unexpected char (10)” error.  And the trace buffer for
a session using the Windows domain shows no advance over what I got
using a normal email address.

/Lew
---
Lew Perin / pe...@acm.org
http://babelcarp.org


Re: [VM] IMAP-SSL with Exchange Server

2012-06-15 Thread Lewis Perin
Thanks, Uday, for mustering the patience to stick with this annoying and
narrow thread.  I know you have other things to do!

Uday Reddy usr.vm.ro...@gmail.com writes:

Lewis Perin writes:

 cygwin warning:
   MS-DOS style path detected: c:\temp\vm387560729
   Preferred POSIX equivalent is: /cygdrive/c/temp/vm387560729
   CYGWIN environment variable option nodosfilewarning turns off this
   warning.
   Consult the user’s guide for more details about POSIX paths:
 http://cygwin.com/cygwin-ug-net/using.html#using-pathnames

So, clearly you need to fix this issue in order to get a clean IMAP session
for VM.

For some value of “clean”: this is a warning, but is it consequential?
I doubt that this is stopping cygwin stunnel from doing its job, as I
can get to Gmail using imap-ssl by this route.

The file cygwin is complaining about, c:\temp\vm387560729, is the
stunnel config generated by vm.  I imagine vm uses that locution for the
file name because of this line in my vm:

(setq vm-temp-file-directory c:/temp/)

I coded that because it’s native Windows emacs, not Cygwin emacs, and
stunnel is the only Cygwin program I use.  I’m leery of using Cygwin
filenames in configuring native Windows emacs, to be honest.  If it were
safe, in this context, to code:

(setq vm-temp-file-directory /cygdrive/c/temp/)

I’d be delighted to do it.  But I don’t think it is.  I got this message
when I tried it:

completion--some: Opening output file: no such file or directory,
c:/cygdrive/c/temp/vm075228092

This way, it seems vm isn’t even getting to the stage of invoking
stunnel and attempting an imap session.

 * OK The Microsoft Exchange IMAP4 service is ready.^M
 
 * BYE Connection is closed. 13

My guess is that your Exchange server is over-eager to close the
connection.

I don’t think so.  The “* BYE Connection is closed. 13” line appears
quite a while after vm complains about the unexpected char.

You might want to check what happens when you do this with gmail.

See above, please.

/Lew
---
Lew Perin / pe...@acm.org
http://babelcarp.org


Re: [VM] IMAP-SSL with Exchange Server

2012-06-15 Thread Uday Reddy
Lewis Perin writes:

  cygwin warning:
MS-DOS style path detected: c:\temp\vm387560729
Preferred POSIX equivalent is: /cygdrive/c/temp/vm387560729
CYGWIN environment variable option nodosfilewarning turns off this
warning.
Consult the user’s guide for more details about POSIX paths:
  http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
 
 So, clearly you need to fix this issue in order to get a clean IMAP session
 for VM.
 
 For some value of “clean”: this is a warning, but is it consequential?

The warning message is meant for you, not VM!  VM won't know what to do with
it.  You should create a CYGWIN environment variable with nodosfilewarning
as its value, and get rid of the warning message.

Windows Emacs will necessarily use Windows path names, which Cygwin doesn't
like.  But they gave you a work-around.  So, please use it.

I don't know why it is working for gmail.  But it is likely that it is
breaking in some more subtle ways.  VM is trying to listen to the server and
the warning message is interfering with it.

Cheers,
Uday



Re: [VM] IMAP-SSL with Exchange Server

2012-06-14 Thread lsmithso

Hi:
Where does vm save the stummel config file?

I have a similar but unrelated stunnel problem connecting to gmail. It connects 
fine when using an emacs 24 snapshot with built in ssl, but fails with emacs 23 
 stunnel. I'd like to debug my stunnel setup with the vm generated config file.
 

Matthew Vernon writes:
  
  What it might be worth doing is snaffling a copy of the stunnel
  configuration file that VM creates, and running stunnel by hand to check
  it's managing to connect OK.
  
  Matthew
  
  -- 
   `O'-0 `O'---.   `O'---.   `O'---.
 \___| |   \___|0-/  \___|/\___|
  |  | /\   |  |  \   |  |\ |  |
  The Dangers of modern veterinary life
  

-- 
Les Smithson



Re: [VM] IMAP-SSL with Exchange Server

2012-06-13 Thread Lewis Perin
Lewis Perin pe...@panix.com writes:

Uday Reddy usr.vm.ro...@gmail.com writes:

Lewis Perin writes:

 When I submit my password for the (default) inbox, the connection fails
 immediately with
 
   vm-imap-protocol-error: IMAP protocol error: unexpected char (10)

Unless you have a working configuration of stunnel, I would suspect it
first.  If you search vm.info archives on Google Groups you will find
earlier discussions of stunnel.  Perhaps you can get stunnel to work with
some other IMAP server like gmail first to make sure that it works.

I just checked against Gmail using imap-ssl, and it works fine with my
vm/stunnel setup.

Upgrading to VM 8.2.0b might also help, because various improvements have
been made since the old release.

I can see there have been changes to vm-imap.el lately, so I guess I’ll
give it a try.

Oh, but wait: I see on Launchpad that 8.1.2 is more recent than 8.2.0b
and it’s recommended as an upgrade path from 8.1.1 to 8.2.0.  OK...

/Lew
---
Lew Perin / pe...@acm.org
http://babelcarp.org


Re: [VM] IMAP-SSL with Exchange Server

2012-06-13 Thread Matthew Vernon
Lewis Perin pe...@panix.com writes:

 Has anyone reading this had experience connecting vm to a Microsoft
 Exchange IMAP-SSL server?  (Successful experience, I hope!)

Yes; stunnel4 and IMAP to Exchange Just Worked; My notes suggest I
didn't need the additional-configuration-file option. 

What it might be worth doing is snaffling a copy of the stunnel
configuration file that VM creates, and running stunnel by hand to check
it's managing to connect OK.

Matthew

-- 
 `O'-0 `O'---.   `O'---.   `O'---.
   \___| |   \___|0-/  \___|/\___|
|  | /\   |  |  \   |  |\ |  |
The Dangers of modern veterinary life