[Kde-pim] Checking for valid folder names in Akonadi

Ingo Klöcker kloecker at kde.org
Thu May 27 22:04:35 BST 2010


On Thursday 27 May 2010, Thomas McGuire wrote:
> Hi,
> 
> when creating a folder in Akonadi, we currently don't check if the
> name is valid. This can cause Bad Things, the user can use '/' in
> the middle or '.' at the start, which will confuse the IMAP and the
> maildir resource.
> 
> So in slotCreateCollection() of the standard action manager we should
> check this and show a nice error dialog if the folder name is
> invalid. Same when changing the folder name with the folder
> properties dialog. The question is: How? A valid file name is
> resource-specific, especially in the IMAP case, the folder seperator
> can apparently be server-specific, KMail 1 had methods like
> delimiterForFolder() for this.
> 
> Should we just ignore all that and simply disallow dots at the start
> and slashes? Or should we come up with some sort of D-Bus interface?
> That seems a bit overkill (especially since the client methods need
> to be async) to me, but would be the only way to do it properly.
> 
> Any opinions?

I think we should just check for obviously invalid names. We should 
probably disallow:
- leading dot
- slash '/'
- backslash '\'
- colon ':'

Anything else?


Of course, any resource needs to handle a failure of the creation of the 
actual folder (e.g. if certain non-ASCII characters are not supported by 
the filesystem) gracefully.


Regards,
Ingo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20100527/fa7455fd/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list