Name translation

I wonder if there is a way currently to do a “name translation”? I have a linux, a windows and an android device and I’d like to sync maildir files between them. Maildir files have a : (colon) in the name as a standard, something neither android nor windows supports.

If it doesn’t, in my head it would work like this-- for each folder, each devices gets a “class” assigned to it by user. So say I have a folder X and 6. devices, dev1, dev2, dev3, dev4, dev5, dev6. dev1, dev2 = class A, dev3, dev 4 = class B, dev5, dev6 = class C.

And there would be a regex based rule to do filename replacement from one class to another. So on dev 6’s interface, there would be two fields-- one on how to translate name from class A devices, and one on how to translate name from class B devices

That said, this is kind of a niche feature so I don’t know if the added complexity is worth it.

Not possible with Syncthing.

And, besides, syncing maildirs is best done using an IMAP mail server, IMO.

Syncthing is inherently bidirectional so any transform needs to be able to run cleanly in both directions. Most translations are not like that, so this would come with significant caveats and restrictions on how it could be used, lest your data be toast. I don’t think we want to do it.

The PR lib/fs: Encode filenames containing reserved characters (fixes #1734) by rasa · Pull Request #7876 · syncthing/syncthing · GitHub addresses this issue.

You’re using something that is much simpler (single character), concrete, and proven; as opposed to what I suggested-- regex, air idea, and unproven. So obviously more amenable to inclusion. I can understand.

This would be a great addition obviously …

In a way, the “encoder type” thing is the class thing I was talking about so I don’t know if there is any way I contribute but still happy to chat if you’d like to brainstorm (although it does seem like your PR has reached a final form?)

On that note, as I said, I understand that my idea is unproven unlike Interix and I also prefer Rasa’s implementation, but I still wanted to elaborate a bit more.

So say I have a folder X and 6. devices, dev1, dev2, dev3, dev4, dev5, dev6. dev1, dev2 = class A, dev3, dev 4 = class B, dev5, dev6 = class C.

Here’s how the field would look like:

On dev1, advanced options for folder X would look like following:

Class: ________ (drop down of classes already assigned to this folder on other devices, along with an option to create a new class)

Translations from: (all classes are enumerated by the interface, and an input box is provided for regex)

class A: s/:/,

class B: s/:/%

— more classes go here —

Effectively this idea is similar to what’s done by Rasa but allows more flexibility.

As I said I myself prefer Rasa’s implementation for two reasons:

  1. Covers all cases that matter

  2. This flexibility is effectively pointless but the downsides are huge (footgun so to speak).

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.