Alias mail addresses with tag are always send to subfolder, even if handling of tagged mails is set to "In subject".
How to reproduce:
Result:
That's not easy to resolve.
You may have rcpts in the alias goto field that do _not_ want a rewritten subject.
Rspamd does not know about the expanded alias address, I think that happens in postfix/cleanup and therefore after the smtp_milter.
We could add an option in the alias table, but that would affect all rcpts of that alias.
Personally, that's fine for me 'cause I and other users from my server are working with the above setup and would prefer the tag instead of automatic sorting, and then sort them with filer rules, because we don't get any hint for a new mail when the mail is directly sorted into a folder
Is this the same problem:
Alias [email protected] points to [email protected] and does not get moved to the subfolder dmarc
Thanks!
This doesn't directly apply to this bug, but it does to some of the referenced bugs:
I was able to globally hack the "tagged alias sort into subfolders" issue so that all tagged mail (including alias destinations) is sorted into folders for all users system wide. Obviously, this won't work for everyone, but it worked for me. Perhaps a couple global options would be appropriate for those who was subject tagging or folder sorting system-wide.
Basically, short-circuiting the X-Moo-Tag header check. I also force the tagged folder to be lowercase (just a personal preference coming from my previous email setup)
# cat mailcow-dockerized/data/conf/dovecot/sieve_after
require "fileinto";
require "mailbox";
require "variables";
require "subaddress";
require "envelope";
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
}
if allof (
envelope :detail :matches "to" "*"
#header :contains "X-Moo-Tag" "YES"
) {
set :lower "tag" "${1}";
if mailboxexists "${1}" {
fileinto "${1}";
} else {
fileinto :create "${1}";
}
}
@mkuron We should drop that feature.
I was wrong, it only works for mailboxes.
We could add a presets for sieve rules and add it here.
@andryyy, I would be fine with that, but some people like it. They could of course manually create sieve rules to achieve the same, but that isn't so easy.
We should add a warning to the alias add/edit page that appears when there are multiple goto addresses specified and at least one of them has changed the tag/subfolder setting from its default.
And show that same warning on the page where the tag/subfolder setting can be changed if the user has at least one shared alias.
I would like to add this to my sieve filters:
require ["variables", "envelope", "fileinto", "subaddress"];
if envelope :is :user "to" "sales" {
if envelope :matches :detail "to" "*" {
/* Save name in ${name} in all lowercase except for the first letter.
* Joe, joe, jOe thus all become 'Joe'.
*/
set :lower :upperfirst "name" "${1}";
}
if string :is "${name}" "" {
/* Default case if no detail is specified */
fileinto "sales";
} else {
/* For sales+joe@ this will become users/Joe */
fileinto "users/${name}";
}
}
Can I add this to sieve_after? Or do I need the put this somewhere else?
And is this possible for alias adresses?