i wrote:
|Paul Vojta <[email protected]> wrote:
||On Mon, Jul 24, 2017 at 02:30:44PM +0200, Steffen Nurpmeso wrote:
||> Paul Vojta <[email protected]> wrote:
...
||>|I have the following problem with the current s-nail
...
||>|% ~/s-nail-git/s-nail -f %:+texlive
||>|[email protected]@imap.gmail.com requires a password:
||> ...
||>|s-nail: Could not connect: Network is unreachable
...
||Sorry, the problem remains (on origin/master).
...
|Oh yes. That is an IMAP fallout of the new possibility to specify
...
Now i have again forgotten the patch! It on [master] etc. Sorry.
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)
commit 33b2834f
Author: Steffen (Daode) Nurpmeso <[email protected]>
AuthorDate: 2017-07-25 14:32:03 +0200
Commit: Steffen (Daode) Nurpmeso <[email protected]>
CommitDate: 2017-07-25 14:42:34 +0200
FIX [81d7f4d8] (IMAP: try (hard) to reinstantiate..) (Paul Vojta)..
Another fallout of IMAP reinstantiation.
We have extended support for proto:// prefixes so that users can
now say, e.g., "? copy 1 maildir:///tmp/nonexistent.mdir" and that
thing will be newly created as necessary, and also the operation
will fail shall it exist but not be something that looks like
a valid Maildir.
Of course all this is a hack, because i refrained from doing it
right from the start and add global bypasses and carriers, but
continued to use the brain-damaged "pass strings all through, tear
them apart and join them as necessary" even though i knew from the
start that this looses information. We should: parse user input,
create objects, and keep their instances as long as the operation
they are involved in lingers around. Here: URL. Anyway.
This error now was that we splitted off the protocol (Paul's
example was imaps://) first, followed by simply reassigning
imap:// because we did not know any better afterwards, and that in
turn results in a "is-same-host" mismatch because of the protocol
prefix (which is also wrong, but especially so if we would degrade
an already secure channel, but that is a different story).
---
cmd-write.c | 1 +
folder.c | 4 +++-
popen.c | 4 ++--
3 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/cmd-write.c b/cmd-write.c
index 2139e131..bf0ee695 100644
--- a/cmd-write.c
+++ b/cmd-write.c
@@ -146,6 +146,7 @@ save1(char *str, int domark, char const *cmd, struct n_ignore const *itp,
n_perr(file, 0);
goto jleave;
}
+
#if defined HAVE_POP3 && defined HAVE_IMAP
if(mb.mb_type == MB_POP3 && (fs & n_PROTO_MASK) == n_PROTO_IMAP){
Fclose(obuf);
diff --git a/folder.c b/folder.c
index f78dbba4..03b448e0 100644
--- a/folder.c
+++ b/folder.c
@@ -64,7 +64,9 @@ _update_mailname(char const *name) /* TODO 2MUCH work, cache, prop of Object! */
if(name != NULL){
#ifdef HAVE_REALPATH
char const *adjname;
- enum protocol p = which_protocol(name, TRU1, TRU1, &adjname);
+ enum protocol p;
+
+ p = which_protocol(name, TRU1, TRU1, &adjname);
if(p == PROTO_FILE || p == PROTO_MAILDIR){
name = adjname;
diff --git a/popen.c b/popen.c
index c71db6c9..d51c9a5e 100644
--- a/popen.c
+++ b/popen.c
@@ -563,14 +563,14 @@ n_fopen_any(char const *file, char const *oflags, /* TODO should take flags */
/* We don't want to find mbox.bz2 when doing "copy * mbox", but only for
* "file mbox", so don't try hooks when writing */
- p = which_protocol(file, TRU1, ((omode & W_OK) == 0), &file);
+ p = which_protocol(csave = file, TRU1, ((omode & W_OK) == 0), &file);
fs = (enum n_fopen_state)p;
switch(p){
default:
goto jleave;
case n_PROTO_IMAP:
#ifdef HAVE_IMAP
- file = savecat("imap://", file);
+ file = csave;
flags |= FP_IMAP;
osflags = O_RDWR | O_APPEND | O_CREAT | n_O_NOFOLLOW;
infd = -1;
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
__________________________________
[email protected]