~bitfehler/m2dir

5 2

IMAP mailbox name containing slash `/`

Details
Message ID
<17c715950151671b.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod>
DKIM signature
pass
Download raw message
If I do not mistake, the slash `/` is a valid (yet stupid) character for
an IMAP mailbox name. In case the delimiter is NOT the slash (let's say
the period `.`), it may have unwanted result locally since the slash
will be interpreted as a folder separator. Does the spec mention
anything about this edge case?

-- 
Regards
Clément DOUIN
https://soywod.me
Details
Message ID
<5946ffdf-f98e-44bc-b485-c9b0fb4b2e90@bitfehler.net>
In-Reply-To
<17c715950151671b.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod> (view parent)
DKIM signature
pass
Download raw message
Hey,

On 4/17/24 3:51 PM, Clément DOUIN wrote:
> If I do not mistake, the slash `/` is a valid (yet stupid) character for
> an IMAP mailbox name.

Ahh, don't get me started... :D

> In case the delimiter is NOT the slash (let's say
> the period `.`), it may have unwanted result locally since the slash
> will be interpreted as a folder separator. Does the spec mention
> anything about this edge case?

Yes, it's super annoying, I am aware of the issue, and I currently chose 
to not mention it. Luckily, many IMAP servers prevent potentially 
dangerous characters even if they are not the separator. I know others 
do not. I feel like specifying this might be a fool's errand, but I 
might be wrong. The issue is, of course, that the details depend on your 
OS/filesystem/etc. And escaping things in filenames is just... meh. So I 
have the slight urge to leave this up to applications.

Did you have a concrete approach in mind to handle this?

Cheers,
Conrad
Details
Message ID
<17c718a2e752f22e.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod>
In-Reply-To
<5946ffdf-f98e-44bc-b485-c9b0fb4b2e90@bitfehler.net> (view parent)
DKIM signature
pass
Download raw message
> Yes, it's super annoying, I am aware of the issue, and I currently
> chose to not mention it. […] I have the slight urge to leave this up
> to applications.

I understand, if so then should it be explicitly stated in the spec?

> Did you have a concrete approach in mind to handle this?

email-lib URL encodes mailbox full paths, which avoids any wrong or
badly interpreted character as well as broken structure (since the slash
is encoded, it flattens all structures). And it works on all
platforms. Plus the result is still human-readable. It's uggly, sure,
but only if you use uggly characters in your mailbox name, fair enough?

Let's say you have a beautiful "[Gmail]/Sent" mailbox, then email-lib
encodes it as "%5BGmail%5D%2FSent" (which is uggly, but not ugglier than
having `[]/` in your mailbox name). It has the side effect to flatten
structure. 

What could be done for m2dir is to URL encode only the name (not the
full path)?

-- 
Regards
Clément DOUIN
https://soywod.me
Details
Message ID
<b6a78ae4-68c0-4a7d-80af-1a18aa5e6faf@bitfehler.net>
In-Reply-To
<17c718a2e752f22e.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod> (view parent)
DKIM signature
pass
Download raw message
On 4/17/24 4:47 PM, Clément DOUIN wrote:
>> Yes, it's super annoying, I am aware of the issue, and I currently
>> chose to not mention it. […] I have the slight urge to leave this up
>> to applications.
> 
> I understand, if so then should it be explicitly stated in the spec?
> 
>> Did you have a concrete approach in mind to handle this?
> 
> email-lib URL encodes mailbox full paths, which avoids any wrong or
> badly interpreted character as well as broken structure (since the slash
> is encoded, it flattens all structures). And it works on all
> platforms. Plus the result is still human-readable. It's uggly, sure,
> but only if you use uggly characters in your mailbox name, fair enough?
> 
> Let's say you have a beautiful "[Gmail]/Sent" mailbox, then email-lib
> encodes it as "%5BGmail%5D%2FSent" (which is uggly, but not ugglier than
> having `[]/` in your mailbox name). It has the side effect to flatten
> structure.
> 
> What could be done for m2dir is to URL encode only the name (not the
> full path)?

Maybe, I guess? Does not sound too bad and might avoid fragmentation. 
Give me a day or two to think this through...

Cheers,
Conrad
Details
Message ID
<902460a9-f630-49fd-8712-bb9fc14176ec@bitfehler.net>
In-Reply-To
<17c718a2e752f22e.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod> (view parent)
DKIM signature
pass
Download raw message
https://man.sr.ht/~bitfehler/m2dir/#folder-names

¯\_(ツ)_/¯  wdyt?

Cheers,
Conrad
Details
Message ID
<17c767ed080ca52e.f9706245cd3a3f97.3b41d60ef9e2fbfb@soywod>
In-Reply-To
<902460a9-f630-49fd-8712-bb9fc14176ec@bitfehler.net> (view parent)
DKIM signature
pass
Download raw message
> https://man.sr.ht/~bitfehler/m2dir/#folder-names

Sounds good to me!

-- 
Regards
Clément DOUIN
https://soywod.me
Reply to thread Export thread (mbox)