Why convert/alias a@aaa.com to b@bbb.local? Why not setup dovecot to have a mailbox and receive mail for a@aaa.com, allowing sieve to run for a@aaa.com, and users login as a@aaa.com on IMAP to check their mail?
That would work if users only had one alias, but they don't - they have several aliases.
On my system i am using virtual accounts in postfix with virtual_mailbox_maps. For user alias im using postfix virtual_alias_maps.
user@example.com is a mailbox someone can login to IMAP with. They have alias@example.com -> user@example.com with the alias map.
If someone sends an email to alias@example.com it ends up in the user@example.com inbox via LMTP
Jun 10 13:38:23 postfix/lmtp[1953783]: 4QdlXt4pn1z7Vv0h: to=<user@example.com>, orig_to=<alias@example.com>, relay=smtp.example.com[private/dovecot-lmtp], delay=2.1, delays=1.7/0.01/0/0.44, dsn=2.0.0, status=sent (250 2.0.0 <user@example.com> N9ypKw61hGTzxB0AbpFOwA Saved)
For sieve plugin i have in dovecot.conf:
sieve_vacation_use_original_recipient = no sieve_vacation_dont_check_recipient = no sieve_vacation_send_from_recipient = no sieve_redirect_envelope_from = sender sieve_user_email = %u
And as a sieve rule i have:
require ["vacation"]; # rule:[Out of Office] if true { vacation :days 1 :addresses ["user@example.com","alias@example.com"] :subject "TEST - Out of Office" "This is a test reply for the out of office auto responder."; }
This works for me. If someone sends an email to alias@example.com they will receive an auto reply with the From: header as alias@example.com and the envelope-from as <> which end users wont see.
Thanks, tried you settings and they are almost the same I am using too, but:
"sieve_user_email = %u" creates a warning: "Warning: sieve: Invalid address value for setting `sieve_user_email': Missing domain"
Still - I see vacation replies created, the issue though is that I am using different relay hosts and whatever "sieve_vacation_send_from_recipient" ist set to, postfix tries to deliver the mail directly to the receiving MX and does not respect my relay hosts.
What I am currently trying to figure out is, is there a way to tell postfix in case it is a vacation reply with no envelope to but a valid from header use that from header as a rule for choosing the right relay host.
-- Cheers spi