Pages: 1
RSS
Subfolder by regex filter
 
Hello. I have this rule for archive incoming and out messages to folders/subfolders:

\\MailDir\Data\Archiv-Sorted\Incoming\%SetPattRegExp=_(.*)@(.*)_%-%RegExpBlindMatch=_%FromAddr_%-%ODATE="yyyy"\%SubPatt=_2_\%SubPatt=_1_

Where output from mail john.doe@domain.com this is:
\\MailDir\Data\Archiv-Sorted\Incoming\year\domain.com\john.doe\*

But my IMAP server use as separator dots.

The problem is that it then creates domain and mailboxes that contain a dot as another subfolder.
\\MailDir\Data\Archiv-Sorted\Incoming\year\domain\com\john\doe\*


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\*
 
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? :

https://www.ritlabs.com/en/support/help/73/#6679
I volunteer as a moderator to help keep the forum tidy. I do not work for Ritlabs SRL.
 
Quote
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.
Code
\\MailDir\Data\Archiv-Sorted\Incoming\%ODATE="yyyy"\%SetPattRegexp="(?is)([_\w\-\.\+]+)@([_\w\-]+(\.[_\w\-]+)+)"%RegexpBlindMatch("%OFromAddr")%Replace(".", "_", "%SubPatt(2)\%SubPatt(1)")%-

----------------

I use my second account, because of troubles with the login to this forum  :cry:

Pages: 1