How to make Postfix gateway forward mail to Exchange + store a copy on local Cyrus IMAP?
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to make Postfix gateway forward mail to Exchange + store a copy on local Cyrus IMAP?
Hi guys,
I've got this task to set up a Postfix based mail gateway that will act as primary MX and filter the email for spam (with amavisd-new/spamassassin) before transporting it to the backend Microsoft Exchange environment. So far nothing odd. But the thing is that I even need to set up a Cyrus IMAP instance, locally on the Postfix gateway that will recieve a copy of every incoming e-mail as well. The logic behind this setup is to have some kind of "disaster solution", if Exchange environment would be down, an email would still be avaiable in Cyrus IMAP so users can authenticate themseleves and reach it. I have no clue how to do this, I've been searching the net, looking through manuals, not a single clue how I can have these both transports at the same time. Could some kind of BCC be solution? Please note that this Cyrus IMAP should be entirely "autonomous". It should not be in any kind of synch with Exchange except for reception of a copy of every single incoming e-mail on the domain.
What I need, to start with, is the clues which parameters in Postfix I need to look into to point the email transport to both of these directions at the same time. By following documentation I can only see picture how to either send mail to Cyrus or forward to Exchange, but not both at the same time. As for the authentication / accounts and other specific things regarding the environment - I'll figure that out myself. I just need to know now how I can use transport_maps to forward the e-mail to Exchange and at the same time send a copy to local IMAP on the server.
Hi, and thanks for the reply.
I was suspecting, like written before, some of the bcc-options should do the trick. My intention is not to bcc to an optional address. Cyrus will have identical e-mail addresses to those that will exist in Exchange environment as well. So only a single bcc-option in Postfix won't do the trick, I assume (or am I missing something?). As soon as transport_maps directive is set pointing smtp to Exchange for that domain, Cyrus (listening localy on lmtp socket) is being ignored by Postfix, nothing will get there. Therefore, I assume something else needs to be done so the transport goes both ways.
I was thinking of a policy daemon, postfix supports policy daemons which can inspect mail during the connection and before it's submitted to the queue, but then you wouldn't have the actual content. Maybe a custom filter that fits in where amavis or spamassassin would ... ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.