Fix URL handling and more (Gavin Troy, Ypnose, Karol Blazewicz)..
commita5c40ba55809ff9a05305a1a43992eaca51c39ab
authorSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Fri, 20 Jun 2014 20:26:47 +0000 (20 22:26 +0200)
committerSteffen (Daode) Nurpmeso <sdaoden@users.sf.net>
Tue, 24 Jun 2014 19:12:56 +0000 (24 21:12 +0200)
tree1eb14f068f216218e9c781cffabca6bed7759ce9
parent8a94f4393d7391046ce90bc1deb39253691da5f4
Fix URL handling and more (Gavin Troy, Ypnose, Karol Blazewicz)..

Karol Blazewicz (karol DOT blazewicz AT gmail DOT com) opened
a discussion in the ArchLinux Forum (s-nail 14.7-1 doesn't work
[1]) but i didn't realize his actual problem.

Luckily there is still the brave Gavin Troy around, and he was it
who not only followed the thread on s-nail-users@ but actually got
it right, pointing at an URL percent-encoding issue [2]!

The problem this changeset fixes is that URL percent encoding was
always applied to USER and PASSWORD, even if those were not
specified in an URL (and that even regardless of *v15-compat*).

And Gavin Troy (alias WOFall on the ArchLinux forum) also pointed
out that it is possible to specify URLs with invalid content, so
this will result in hard errors from now on.

Ypnose finally reported that reconnecting+ an IMAP box way to
often required a password to be entered [3].
The reason was that the mb_imap_pass hack restored the password
back into the URL object, but which was not used at all for the
non *v15-compat* path, logically: temporarily set
a *password-USER@HOST* variable accordingly instead.

This changeset also fixes credential handling, which did not yet
savestr() away values that may came from the value cache, even
though their backing store can change during the lifetime of
credentials.

I hope all of those issues have been solved now, yet it is still
hacky unless we (in v15.0) no longer use a global mailname[]
string for identifying mailboxes, but simply have, possibly
several, mailboxes, one of which is the currently active one;
these will then have an URL field.
But because we are not there, accessing an IMAP mailbox will show
the URL-encoded user name, since that is the string that is used
from everywhere in the codebase to decide what the current mailbox
is and how to handle it...

  [1] <https://bbs.archlinux.org/viewtopic.php?id=182653>
  [2] <http://article.gmane.org/gmane.mail.s-nail.user/106>
  [3] <http://article.gmane.org/gmane.mail.s-nail.user/111>
auxlily.c
catd/en_US
fio.c
imap.c
nail.1
nail.h
nailfuns.h
pop3.c
sendout.c
smtp.c