On Thu, Sep 02, 2021 at 01:20:22AM -0400, Steve Dondley <s...@dondley.com> wrote:
> > Hi, > > > > Postfix isn't the right thing for that. It's a mail > > server, not a mail client. You'll need to investigate > > the documentation for the mail client that you use when > > reading and sending mail. > > > > For example, with mutt, you can give it a list of all > > of your email addresses with an "alternates" directive, > > and it knows not to include alternates in the recipient > > list when you reply to all. Other mail clients probably > > have similar functionality. > > > > Another alternative that could involve postfix slightly > > it to tell postfix to use something like procmail when > > delivering local mail (or use something like imapfilter), > > and filter incoming mail through a script that performs > > the transformation you want on the email before you see it. > > But that's fiddly, requires writing code that munges your > > email, so it requires great courage and/or foolhardiness. > > I'd do something like this if I didn't already use mutt, > > but I wouldn't recommend it. > > > > Looking for a solution in your mail client is much better. > > > > Also, if your mail client launches a highly > > configurable text editor for composing the reply, you > > can probably configure the editor to automatically > > remove and/or replace the addresses before you start > > typing the reply. > > > > cheers, > > raf > > OK, thank you very much. You just saved me hours of feeling defeated and > dejected trying to figure out how I might get it to work. :) > > I'm using Roundcube which doesn't strike me as a power user's mail client > but I may be able to do a quick hack the PHP or maybe even write a plugin to > make this happen. A project for another time. I now think I was wrong saying that postfix wasn't the right tool for this. Postfix can do an amazing number of things. I had forgotten that it can rewrite addresses in headers for both outgoing and incoming email. Sorry for replying before my brain was fully engaged. :-) See http://www.postfix.org/ADDRESS_REWRITING_README.html In particular, look at the "Address rewriting when mail is received" and "Address rewriting when mail is delivered" sections. I'm not sure, but canonical address mapping sounds like what you want: http://www.postfix.org/ADDRESS_REWRITING_README.html#canonical This isn't the same as just delivering an email to an alias address. It actually rewrites envelope and message header addresses. If this does what you want, it should work no matter what mail client you use. So you can rewrite all your addresses to a single canonical one. I don't know if postfix will remove duplicates (in case multiple non-canonical addresses appear as recipients), but it probably wouldn't matter for the purpose of replying. So here's a guess: /etc/postfix/master.cf: canonical_maps = hash:/etc/postfix/canonical /etc/postfix/canonical EmailB EmailA EmailC EmailA EmailD EmailA EmailE EmailA You'd need to run "postmap hash:/etc/postfix/canonical" to prepare the canonical.db for use whenever you change the canonical file. Good luck. cheers, raf