[neomutt-devel] neomutt NNTP and Active Directory usernames

Sirius sirius at trudheim.com
Sun Apr 7 17:44:28 CEST 2024


In days of yore (Sun, 07 Apr 2024), Reto thus quoth: 
> On Sun, Apr 07, 2024 at 02:45:26PM +0200, Sirius via neomutt-devel wrote:
> > For some reason, it has replaced the '@' with '_' in the path. Is someone
> > able to explain to me where in the code this transposition might be
> > happening so I can attempt to hack up a fix (I was looking at the code
> > last night and did not know where to even begin)
> 
> My guess?
> Here

You are 100% correct, and the following patch resolved the problem.

--- ../neomutt/muttlib.c	2024-04-06 18:50:46.846900615 +0200
+++ muttlib.c	2024-04-07 17:40:37.224482496 +0200
@@ -913,7 +913,7 @@
   /* convert the path to POSIX "Portable Filename Character Set" */
   for (size_t i = 0; i < len; i++)
   {
-    if (!isalnum(buf->data[i]) && !strchr("/.-_", buf->data[i]))
+    if (!isalnum(buf->data[i]) && !strchr("/.-_@", buf->data[i]))
     {
       buf->data[i] = '_';
     }

Thank you kind sir!

> 
> ```c
> /**
>  * mutt_encode_path - Convert a path to 'us-ascii'
>  * @param buf Buffer for the result
>  * @param src Path to convert (OPTIONAL)
>  *
>  * If `src` is NULL, the path in `buf` will be converted in-place.
>  */
> void mutt_encode_path(struct Buffer *buf, const char *src)
> ```
> 
> called from nntp/newsrc.c:525 in cache_expand()
> 
> Cheers,
> Reto

-- 
Kind regards,

/S


More information about the neomutt-devel mailing list