message: sanitize maildir

Remove trailing '/' in maildirs, since people have that (like "/foo/"),
and earlier version didn't complain about that.

Fixes #2298
This commit is contained in:
Dirk-Jan C. Binnema
2022-07-13 23:27:54 +03:00
parent 39d7096bba
commit ed93ff4968
3 changed files with 31 additions and 3 deletions

View File

@ -208,6 +208,16 @@ public:
*/
Result<void> set_maildir(const std::string& maildir);
/**
* Clean up the maildir. This is for internal use, but exposed for testing.
* For now cleaned-up means "stray trailing / removed".
*
* @param maildir some maildir
*
* @return a cleaned-up version
*/
static std::string sanitize_maildir(const std::string& maildir);
/**
* Get the subject of this message
*