Hello Mantas,

[email protected] wrote:
 |I'm playing around with s-nail v14.7.2 (on Arch Linux), and \
 |noticed that my old
 |configuration does not work correctly anymore. It seems that \
 |there's a bug in the handling of '@' in usernames.
 |
 |More specifically, I have a Gmail account defined as:
 |
 |    account gmail {
 |        set folder="imaps://grawity%[email protected]"
 |        # etc.
 |}
 |
 |    set password-grawity%[email protected]="whatever"
 |
 |This used to work in the past (maybe two years ago), but now it ignores the
 |password-* variable and asks for a password interactively. \
 |However, if I change
 |the setting to `set [email protected]@imap.gmail.com="..."`, \
 |it works
 |again. In other words, $folder *requires* the '@' to be percent-encoded, but
 |$password requires the *opposite*.
 |It seems that this was broken by 1a7dff48c85c..9c9e6cd18f7c (the new generic
 |credential layer code). Doesn't seem to be an intentional change?

Neee, it's more like [a5c40ba5] didn't update the backward
compatible code path after Gavin agreed that it's the most natural
behaviour that variable lookups are performed without any
encoding at all [1].  Sigh.

  [1] <http://article.gmane.org/gmane.mail.s-nail.user/117>

If you want to you could test the attached diff and keep on going
with the old syntax.
Thanks for reporting this.
Ciao,

 |Mantas Mikulėnas <[email protected]>

--steffen
diff --git a/imap.c b/imap.c
index 5772066..29ced92 100644
--- a/imap.c
+++ b/imap.c
@@ -1168,11 +1168,11 @@ _imap_getcred(struct mailbox *mbp, struct ccred *ccredp, struct url *urlp)
       char *var, *old;
 
       if ((var = mbp->mb_imap_pass) != NULL) {
-         var = savecat("password-", urlp->url_u_h_p.s);
+         var = savecat("password-", urlp->url_eu_h_p.s);
          old = vok_vlook(var);
          vok_vset(var, mbp->mb_imap_pass);
       }
-      rv = ccred_lookup_old(ccredp, CPROTO_IMAP, urlp->url_u_h_p.s);
+      rv = ccred_lookup_old(ccredp, CPROTO_IMAP, urlp->url_eu_h_p.s);
       if (var != NULL) {
          if (old != NULL)
             vok_vset(var, old);
diff --git a/pop3.c b/pop3.c
index f81e5a0..28d1538 100644
--- a/pop3.c
+++ b/pop3.c
@@ -838,7 +838,7 @@ pop3_setfile(char const *server, enum fedit_mode fm)
    }
 
    if (!(ok_blook(v15_compat) ? ccred_lookup(&sc.sc_cred, &sc.sc_url)
-         : ccred_lookup_old(&sc.sc_cred, CPROTO_POP3, sc.sc_url.url_u_h_p.s)))
+         : ccred_lookup_old(&sc.sc_cred, CPROTO_POP3, sc.sc_url.url_eu_h_p.s)))
       goto jleave;
 
    if (!sopen(&sc.sc_sock, &sc.sc_url))
------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck&#174;
Code Sight&#153; - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users

Reply via email to