You are not logged in.

#1 2016-01-06 06:52:59

Ocypheum
Member
Registered: 2015-09-26
Posts: 58

mail/mailx/s-nail with IMAP

According to `man mail` (or `man mailx`) and the Arch wiki, s-nail supports IMAP. I can't figure out how to connect to Outlook's IMAP server though. It's not clear to me whether the username and password are required to be in the URL or if they can be specified in variables, so I tried all combinations. I also tried with and without including the port number and the subfolder/path. It's also unclear whether a trailing period is required at the end, so I tried that as well.

Without username, password or port:                                                 

? file imap://imap-mail.outlook.com                                              
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://imap-mail.outlook.com/INBOX                                   
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://imap-mail.outlook.com/INBOX.                                  
Could not connect: Operation now in progress                                     

With username, without password or port:                                         

#ERR#? file imap://joe-bob@imap-mail.outlook.com                                 
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://joe-bob@imap-mail.outlook.com/INBOX                           
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://joe-bob@imap-mail.outlook.com/INBOX.                          
Could not connect: Operation now in progress                                     

Without username or password, with port:                                         

#ERR#? file imap://imap-mail.outlook.com:993                                     
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            
                                                                                 
#ERR#? file imap://imap-mail.outlook.com:993/INBOX                               
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            
                                                                                    
#ERR#? file imap://imap-mail.outlook.com:993/INBOX.                                 
IMAP: Resource temporarily unavailable                                              
IMAP write error: Bad file descriptor                                               

With username and port, without password:                                           

#ERR#? file imap://joe-bob@imap-mail.outlook.com:993                                
IMAP: Resource temporarily unavailable                                              
IMAP write error: Bad file descriptor

#ERR#? file imap://joe-bob@imap-mail.outlook.com:993/INBOX                       
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            
                                                                                 
#ERR#? file imap://joe-bob@imap-mail.outlook.com:993/INBOX.                      
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            

With username and password, without port:                                       

#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com                      
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com/INBOX                
Could not connect: Operation now in progress                                     
                                                                                 
#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com/INBOX.               
Could not connect: Operation now in progress                                     

With username, password and port:                                               

#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993                  
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            
                                                                                 
#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993/INBOX            
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor                                            
                                                                                 
#ERR#? file imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993/INBOX.           
IMAP: Resource temporarily unavailable                                           
IMAP write error: Bad file descriptor

Anyone know how to get this to work?

Offline

#2 2016-01-06 06:58:27

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: mail/mailx/s-nail with IMAP

I would start with the account command in the man page...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-01-06 16:42:11

Ocypheum
Member
Registered: 2015-09-26
Posts: 58

Re: mail/mailx/s-nail with IMAP

jasonwryan wrote:

I would start with the account command in the man page...

Right, I have an account set up in .mailrc. It basically looks just like the example:

account outlook {
   localopts yes
   set user="joe-bob@outlook.com"
   set password="p@sSw0rd"
   set smtp=smtp-mail.outlook.com smtp-use-starttls
   set from="Joe Bob <joe-bob@outlook.com>"
}

Thing is this is just for SMTP. As I understand it, you can specify a starting IMAP folder as follows:

account outlook {
   localopts yes
   set user="joe-bob@outlook.com"
   set password="p@sSw0rd"
   set smtp=smtp-mail.outlook.com smtp-use-starttls
   set from="Joe Bob <joe-bob@outlook.com>"
   set imap-keepalive=240
   set folder=imap://imap-mail.outlook.com
}

I've tried all combinations in the folder URL as well, making sure to encode USER and PASS as instructed in the man page:

   set folder=imap://imap-mail.outlook.com
   set folder=imap://imap-mail.outlook.com:993
   set folder=imap://joe-bob@imap-mail.outlook.com:993
   set folder=imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993
   set folder=imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993/INBOX
   set folder=imap://joe-bob:p%40sSw0rd@imap-mail.outlook.com:993/INBOX.

This has the exact same problem, only now I the errors occur when trying to start s-nail interactively.

Last edited by Ocypheum (2016-01-06 17:18:47)

Offline

#4 2016-01-07 18:57:46

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: mail/mailx/s-nail with IMAP

Hello!
Did you try the -d command line switch?  Also add -v, best as -vv.
Port 993 shouldn't be necessary if you use imaps:// protocol indicator.
Have you set an authentication method via *imap-auth*?  Do we support the authentification method?  S-nail doesn't support OAuth.

Note that the next version of S-nail, v14.9, will no longer include IMAP support at all.  There are some programs out there which help to share IMAP folders over several machines, i (as the maintainer of S-nail) will mention isync in the announcement mail, but there are others, like offlineimap (but which needs Python).  That i think supports SASL library linkage, and with it OAuth may be possible, but i don't know.  It will take time until S-nail will offer optional linkage against SASL.  (I also don't know wether all that matters for ArchLinux, i.e., if the maintainer updates from the v14.8.* series that still has IMAP support.)

Offline

#5 2016-01-07 19:01:00

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: mail/mailx/s-nail with IMAP

2P.S.: the credential lookup as such is explained in the manual section "On URL syntax and credential lookup".  And please set the internal variable *v15-compat*, as in "set v15-compat".  (It seems you have done so, since otherwise you should have seen error messages?)

Offline

#6 2016-01-08 21:39:12

Ocypheum
Member
Registered: 2015-09-26
Posts: 58

Re: mail/mailx/s-nail with IMAP

sdaoden wrote:

Hello!
Did you try the -d command line switch?  Also add -v, best as -vv.
Port 993 shouldn't be necessary if you use imaps:// protocol indicator.
Have you set an authentication method via *imap-auth*?  Do we support the authentification method?  S-nail doesn't support OAuth.

Here's the output of `mail -A outlook -dvv` with `set v15-compat` and `set folder=imap://imap-mail.outlook.com` in config:

Credentials: host "imap-mail.outlook.com", user "joe-bob@outlook.com", pass "p@sSw0rd"
Resolving host "imap-mail.outlook.com:imap" ... done
Connecting to "207.46.11.202:imap" ...Could not connect: Operation now in progress

Using `set folder=imaps://imap-mail.outlook.com`:

Resolving host "imap-mail.outlook.com:imaps" ... done
Connecting to "207.46.10.10:imaps" ...connected.
*ssl-protocol*: "-ALL,+TLSv1.2"
could not initiate SSL/TLS connection: error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol

Using `set folder=imap://imap-mail.outlook.com:993`:

Resolving host "imap-mail.outlook.com:993" ... done
Connecting to "207.46.10.10:993" ...connected.
IMAP: Resource temporarily unavailable
>>> T1 CAPABILITY
>>> T2 SELECT "INBOX"
IMAP write error: Bad file descriptor

Same output as above for `set imap-auth=cram-md5` and `set imap-auth=gssapi`.

Using `set folder=imap://imap-mail.outlook.com:993 imap-start-tls`:

Resolving host "imap-mail.outlook.com:993" ... done
Connecting to "65.55.122.74:993" ...connected.
IMAP: Connection reset by peer
>>> T1 STARTTLS
IMAP write error: Broken pipe

Explicitly using port 993 without `imap-start-tls` seems the most promising. It looks like it barfs on the folder name "INBOX" but all the documentation I've found regarding Outlook and IMAP suggests this value is correct.

Note that the next version of S-nail, v14.9, will no longer include IMAP support at all.  There are some programs out there which help to share IMAP folders over several machines, i (as the maintainer of S-nail) will mention isync in the announcement mail, but there are others, like offlineimap (but which needs Python).  That i think supports SASL library linkage, and with it OAuth may be possible, but i don't know.  It will take time until S-nail will offer optional linkage against SASL.  (I also don't know wether all that matters for ArchLinux, i.e., if the maintainer updates from the v14.8.* series that still has IMAP support.)

That's too bad! I like s-nail, but I understand the desire to simplify the code. If it ceases to support IMAP, I will have to use a different program to fetch and deliver mail to a local inbox (like I do currently) and just use s-nail to read it.

Last edited by Ocypheum (2016-01-08 21:55:31)

Offline

#7 2016-01-08 22:17:38

sdaoden
Member
Registered: 2014-06-13
Posts: 30

Re: mail/mailx/s-nail with IMAP

Ocypheum wrote:

Using `set folder=imaps://imap-mail.outlook.com`:

Resolving host "imap-mail.outlook.com:imaps" ... done
Connecting to "207.46.10.10:imaps" ...connected.
*ssl-protocol*: "-ALL,+TLSv1.2"
could not initiate SSL/TLS connection: error:14077102:SSL routines:SSL23_GET_SERVER_HELLO:unsupported protocol

That doesn't look to bad until that point.
Have you tried it with "set ssl-protocol=-ALL,+TLSv1"?
If i use

openssl s_client -connect imap-mail.outlook.com:993

then it seems that is what they want.
Or do "set ssl-protocol=+ALL,-SSLv3" instead, then tighten it until it no longer works.

Ocypheum wrote:

Using `set folder=imap://imap-mail.outlook.com:993`:

Well the port specification is only needed if /etc/services doesn't list a service, but on ArchLinux it includes imaps, so this should really be redundant.  (It seems to me you would have found a bug in the GNU resolver code otherwise.  That is not impossible, though.)

Ocypheum wrote:

Explicitly using port 993 without `imap-start-tls`

It is *imap-use-starttls*.  And yes, IMAPS implies an automatic SSL/TLS handshake, so STARTTLS is not necessary. smile
Searching the web the above should to the connection fine.  The problem that remains is the authentification..

Ocypheum wrote:

That's too bad! I like s-nail, but I understand the desire to simplify the code. If it ceases to support IMAP, I will have to use a different program to fetch and deliver mail to a local inbox and just use s-nail to read it.

Well, thank you very much!  But i know it has a lot of deficiencies, especially in interactive usage.  And i hope we gain support back in the future, but first i will throw away anything to replace some core functionality _next_ (after v14.9), and then come back step by step.  It really must do its core functionality acceptably first.  And then it will be hard enough to readd support for SMTP, POP3 and SSL/TLS for v15.0.  I'm really sorry for that.

Offline

Board footer

Powered by FluxBB