mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 08:29:24 +00:00
Rule move: added $email$ placeholder
This commit is contained in:
parent
4bc02cee83
commit
6ce9222300
2 changed files with 11 additions and 4 deletions
1
FAQ.md
1
FAQ.md
|
@ -2594,6 +2594,7 @@ A *move* action can optionally create subfolders (since version 1.1966) to move
|
|||
```
|
||||
$month$
|
||||
$year$
|
||||
$email$
|
||||
$domain$
|
||||
```
|
||||
|
||||
|
|
|
@ -627,16 +627,22 @@ public class EntityRule {
|
|||
create = create.replace("$year$", year);
|
||||
create = create.replace("$month$", month);
|
||||
|
||||
String domain = "";
|
||||
String email = null;
|
||||
String domain = null;
|
||||
if (message.from != null &&
|
||||
message.from.length > 0 &&
|
||||
message.from[0] instanceof InternetAddress) {
|
||||
InternetAddress from = (InternetAddress) message.from[0];
|
||||
domain = UriHelper.getEmailDomain(from.getAddress());
|
||||
email = from.getAddress();
|
||||
domain = UriHelper.getEmailDomain(email);
|
||||
}
|
||||
create = create.replace("$domain$", domain);
|
||||
create = create.replace("$email$", email == null ? "" : email);
|
||||
create = create.replace("$domain$", domain == null ? "" : domain);
|
||||
|
||||
String name = folder.name + folder.separator + create;
|
||||
if (folder.separator != null)
|
||||
create = create.replace(folder.separator, '_');
|
||||
|
||||
String name = folder.name + (folder.separator == null ? "" : folder.separator) + create;
|
||||
EntityFolder created = db.folder().getFolderByName(message.account, name);
|
||||
if (created == null) {
|
||||
created = new EntityFolder();
|
||||
|
|
Loading…
Add table
Reference in a new issue