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

Support for SRS #328

Closed
ieno opened this issue Nov 14, 2017 · 13 comments · Fixed by #1349
Closed

Support for SRS #328

ieno opened this issue Nov 14, 2017 · 13 comments · Fixed by #1349
Labels
type/feature Introduces a new feature

Comments

@ieno
Copy link

ieno commented Nov 14, 2017

See https://en.wikipedia.org/wiki/Sender_Rewriting_Scheme and https://github.com/roehling/postsrsd

@kaiyou
Copy link
Member

kaiyou commented Nov 15, 2017

That would be an interesting feature for aliases and forwards indeed. No idea how soon we could support it though.

@kaiyou kaiyou added the feature label Nov 15, 2017
@fabiorauber
Copy link
Contributor

It would greatly diminish the risk of the forwarding MTA to be marked as Spammer.

@micw
Copy link
Contributor

micw commented Oct 11, 2019

Is this still valid, especially in conjunction with DKIM/DMARC?

Edit: https://fastmail.blog/2016/12/24/spf-dkim-dmarc/

The solution: always make sure you DKIM sign mail if you have a DMARC policy. If your email is forwarded, SPF will break, but DKIM signatures should survive. SRS wonʼt help with DMARC, because replacing the MAIL FROM envelope with your own domain means the MAIL FROM domain doesnʼt match the From header domain. This is an alignment failure, and so not a pass result for DMARC.

Seems this is superseded by DMARC

@oli-ver
Copy link

oli-ver commented Nov 4, 2019

@kaiyou in #1042 you posted some review comments. @jbmolle are you able to proceed with this? I would like to help if possible as this is currently a problem for an alias I need to use.

@kaiyou
Copy link
Member

kaiyou commented Nov 5, 2019

A completely different approach would be to use a podop map and generate the srs in the admin container instead of running postsrs. It has the advantage of being compatible with replicated setups.

If @jbmolle can adjust the pr, we can probably merge it. Otherwise I'd go for the podop map instead. How do you feel about contributing it if I try and guide you through it?

@oli-ver
Copy link

oli-ver commented Nov 8, 2019

@kaiyou I would like to try. It’s a new area for me though and it could take some time to catch up. I will try and setup the dev environment while waiting for an answer of @jbmolle.

@jbmolle
Copy link

jbmolle commented Nov 13, 2019

Hi @oli-ver, hi @kaiyou ,
Sorry for the late reply. I haven't looked much at this issue.
The modifications I did were enough for the use case I had so far.
But I can look at it again and try to modify the PR according to kaiyou's suggestions.
I don't write much code in Python so I might not be the best to do but I can try and you'll let me know if it's fine.

@oli-ver
Copy link

oli-ver commented Jan 12, 2020

@jbmolle I have some experience with python but none with mailu development but I am open to review code and discuss solutions. @kaiyou, what do you think?

@kaiyou
Copy link
Member

kaiyou commented Jan 13, 2020

I planned on setting up a nee dev environment tonight. Let's try and make this my first issue.

Postfix sender and recipient canonical maps should be bound to admin through podop, and rewriting will be implemented using pysrs from https://pythonhosted.org/milter/pysrs.html as it seems not to be the best but most supported lib.

kaiyou added a commit to kaiyou/Mailu that referenced this issue Jan 14, 2020
@kaiyou
Copy link
Member

kaiyou commented Jan 14, 2020

Just pushed the commit above, that should do most of the lifting work for SRS. Any feedback is welcome before I open the PR.

@oli-ver
Copy link

oli-ver commented Jan 14, 2020

@kaiyou Looks pretty straightforward. I will try to get a dev environment up and running on the weekend, perhaps I can have a closer look how this works when sending mails.

@oli-ver
Copy link

oli-ver commented Feb 2, 2020

@kaiyou I tested the feature with a dev server I just set up (I hope without mistakes).
I sent the mail from an iCloud mail address [email protected] to [email protected] which forwards to [email protected].

I think these are the relevant header parts:

Delivered-To: <[email protected]>
Return-Path: <SRS0=vA/[email protected]>
envelope-from <SRS0=vA/[email protected]>

Is it correct like that?

Unfortunately I cannot test forwarding to mail addresses of other servers because my development machine does not have a static IP and SPAMHAUS has an entry for the IP range that is only temporarily assigned by my DSL provider. Other mail servers bounce the mail because of that.

@kaiyou
Copy link
Member

kaiyou commented Feb 7, 2020

It looks correct, thank you for the testing :) of course I cannot verify the hashes without the secret key, but let's assume those are correct. I will open the PR right away.

@bors bors bot closed this as completed in 1ca4d67 Mar 6, 2020
sholl pushed a commit to sholl/Mailu that referenced this issue Jun 26, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/feature Introduces a new feature
Projects
None yet
7 participants