C h a n g e of Domain A u t o R e s p o n s e + Alias

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

C h a n g e of Domain A u t o R e s p o n s e + Alias

Robert Miller
Hi,

I'm looking for a suggestion on the best setup for sending an a u t o  
r e s p o n s e with a   c h a n g e   o f   a d d r e s s    notice,
with a Postfix/Dovecot mail server, while still forwarding the message.

Option 1: [hidden email] -> alias ->
[hidden email] (this account has auto response enabled)

Alternatively, this could use two virtual mailboxes, however I can’t
seem to configure Sieve to work without Dovecot handling the message.

Option 2: [hidden email] —> alias ->
[hidden email] (this account has auto response enabled)

The existing configuration uses Postfix virtual_mailbox_domains to
receive mail from both domains (old and new accounts). Two new,
replacement, recipients are UNIX accounts. Mail is redirected using
virtual_mailbox_maps to rewrite recipient addresses to the new address.
Since this happens before delivery, it is not possible to set an auto
response (e.g. a vacation message) strictly for the old addresses
because .forward + vacation work at time of final delivery, and possibly
not at all for virtual mailboxes.

I did get fairly far with the Pigeonhole project and Sieve, but
eventually discovered that it will not work for aliases, and, if I
removed the mail forwarding and just used a virtual mailbox (see error),
sieve does not process because postfix delivers the message without
Dovecot.

Error:
Jan 9 00:46:42 inet dovecot: lda(user)<11193><VvDSMCqpFl65KwAA+arxkQ>:
sieve:
msgid=<CAKge6ZKYBux=[hidden email]>:
discarding vacation response for implicitly delivered message; no known
(envelope) recipient address found in message headers
(recipient=user@localhost, and additional `:addresses' are specified)

It would seem this has to be done with before-queue content filtering,
however the principles of operation do not include auto responses (and
with mail looping risks, this is understandable).

In general terms, I would imaging having a fairly straightforward method
of accomplishing this would be very useful for all the organizations
that go through names changes, merges, etc.

Thanks for any suggestions!

Robert
Reply | Threaded
Open this post in threaded view
|

Re: C h a n g e of Domain A u t o R e s p o n s e + Alias

Jaroslaw Rafa
Dnia  9.01.2020 o godz. 01:34:47 Robert Miller pisze:
> Since this happens before delivery, it is not possible to
> set an auto response (e.g. a vacation message) strictly for the old
> addresses because .forward + vacation work at time of final
> delivery, and possibly not at all for virtual mailboxes.

It is possible if you put some mail filtering software, eg. procmail (yes, I
know, it's a bit outdated now, but that's what I know and use) between your
.forward file and vacation. That is, call procmail instead of vacation form a
.forward file and call vacation from a procmail rule that matches only for
old address.

You can also set up an autoresponder using procmail and formail only (there
is an example in "man procmailex"), without a need to use the vacation
program at all.
--
Regards,
   Jaroslaw Rafa
   [hidden email]
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
Reply | Threaded
Open this post in threaded view
|

Re: C h a n g e of Domain A u t o R e s p o n s e + Alias

Robert Miller
Thank you Jaroslaw for the suggestion. I may pursue this further for the
two UNIX accounts which cannot send sieve auto responses due to rules
surrounding aliases. FWIW to someone reading this list archive, there
was a solution by moving the To: address up the chain using
X-Original-To. Unfortunately I never solved it. The link is here
https://dlford.io/sieve-configure-vacation-responses/

Meanwhile, I have a pretty big realization: Postfix virtual has nothing
to do with Dovecot virtual mailboxes. I know, duh! In any case, it was
straight forward to reconfigure Postfix to use lmtp on a UNIX port.
Suddenly sieve shows up when monitoring tail -f /var/log/syslog.
Hallelujah. Debian users will have to apt install dovecot-lmtpd, then
configure Postfix to use lmtp for virtual transport. It’s easy to
learn how to do this in the documentation. I also found step-by-step
directions here: https://workaround.org/ispmail/jessie/postfix-dovecot

So, sieve and auto response works for my old mail accounts, which are
maintained as Postfix virtual mailboxes. Win #1.

At a later date I’ll return to your suggestion, because my new primary
account can’t send a vacation reply: that’d be nice.

Configuring Postfix + LMTP + Dovecot + Pigeonhole (Sieve and
Managesieve) + sievec-connect is a couple days for a first timer. This
would make a good Howto for http://www.postfix.org/docs.html

Now, off to remove my redirection for testing purposes
   transport:olddomain.tld       smtp:[olddomain.tld]
from the file transport and update my DNS!

Cheers


On 9 Jan 2020, at 6:51, Jaroslaw Rafa wrote:

> It is possible if you put some mail filtering software, eg. procmail
> (yes, I
> know, it's a bit outdated now, but that's what I know and use) between
> your
> .forward file and vacation. That is, call procmail instead of vacation
> form a
> .forward file and call vacation from a procmail rule that matches only
> for
> old address.
>
> You can also set up an autoresponder using procmail and formail only
> (there
> is an example in "man procmailex"), without a need to use the vacation
> program at all.