I don't fully understand your question, but even if I did, I probably couldn't offer a solution. My only suggestion is that perhaps you can do it using one of the Replace functions documented at the link below, or maybe by using the %Validfilechars command? :
True Friend wrote: Does anyone know how I can modify the rule so that the messages are correctly saved according to the original format...\\MailDir\Data\Archiv-Sorted\Incoming\year\domain.com\john.doe\*
As I see, you want to move mails to specific archive folders, you should use more general expression as the target folder name. Here all dots in domain part and name part of the e-mail address are replaced by underscore character.