Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add email router #2

Closed
wvengen opened this issue Sep 9, 2017 · 9 comments
Closed

Add email router #2

wvengen opened this issue Sep 9, 2017 · 9 comments

Comments

@wvengen
Copy link
Member

wvengen commented Sep 9, 2017

With different instances receiving email (Foodsoft for message replies, different instances, plus sharedlists for article updates), there is need for a router to direct incoming email to the correct application. This can be done by adding a Postfix instance. Can also do outbound email. See e.g. docker-postfix for an example. It is important that wildcards matching addresses like foodsoft-1.a918cd@foodcoops.net can also be routed.

@wvengen
Copy link
Member Author

wvengen commented Nov 24, 2017

If sensible, I guess we prefer to use the mailu postfix image, because that's what paroga already uses elsewhere (and we'd like to keep it aligned). Seems like a good base image too. We just need to strip out parts we don't use: we only use forwarding outgoing mails to the upstream smtp server (though being able to deliver like a regular mta would be nice to keep), and forwarding incoming mails to the appropriate service. So no local accounts or storing mail.

@wvengen
Copy link
Member Author

wvengen commented Mar 28, 2018

This is working now.
Pending: adding MAILER_PREFIX (and MAILER_DOMAIN?) to Foodsoft, for mail replies.

@wvengen
Copy link
Member Author

wvengen commented Dec 21, 2021

When MAILER_PREFIX is implemented in Foodsoft, we need to revert c35edea.

@kidhab
Copy link

kidhab commented Dec 21, 2021

I think the initial idea was to let postfix decide where to route incoming reply mail based on the domain.

@wvengen
Copy link
Member Author

wvengen commented Dec 21, 2021

Yes. In some cases one would want to share the domain between several apps (and/or use regular email addresses).
Sharedlists has an option for the using MAILER_PREFIX, which is prepended to the mail address (and stripped on processing). Also, when only one domain is required for a whole setup, it's easier to set it up (one less domain to configure), so I think it's a good idea to implement this eventually.

@kidhab
Copy link

kidhab commented Dec 21, 2021

Also, when only one domain is required for a whole setup, it's easier to set it up (one less domain to configure), so I think it's a good idea to implement this eventually.

I dont' disagree with you. As as side note: It's already possible to route incoming mails for sharedlists and foodsoft using the same mail domain. With postfix you have to setup a transport map like this (assuming MAILER_PREFIX=scharedlists+):

/^sharedlists\+[0-9]*\.([0-9A-Z])*@foodcoops\.net$/    smtp:[1.2.3.4]:2525
/^(.*)\.[0-9\.]*\.[A-Z0-9]*@foodcoops\.net$/           smtp:[1.2.3.4]:2526

Based on how sharedlists and foodsoft build the mail address.

@wvengen
Copy link
Member Author

wvengen commented Dec 21, 2021

The second regex is a little generic, but would already work. I'd be for using that for now, thanks!

@kidhab
Copy link

kidhab commented Dec 27, 2021

Replies by email are working now.

@kidhab kidhab closed this as completed Dec 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants