Code Monkey home page Code Monkey logo

Comments (2)

roehling avatar roehling commented on May 31, 2024

I am not aware of any good way to do that. You can exclude domains if you know they don't use SPF manually. However, given that the rewrite is envelope-only and thus invisible to the end user, I would not bother.

from postsrsd.

uschindler avatar uschindler commented on May 31, 2024

I think that should be relatively easy to implement:

You get the envelope e-mail address of sender by postfix (because it is the one you want to rewrite). Just extract domain name from it (you do that anyways to check the list of excluded domains). Do a DNS lookup of the TXT record of the domain extracted. If the TXT as returned by libc/DNS server contains the string "spf", the envelope sender's address is SPF enabled. In that case you need to do SRS. Otherwise it is useless.

This is an additional DNS lookup on every request, but if the mailserver has done the "policy-spf" checks already, the TXT record is in the DNS cache already...

This issue has nothing to do with the fact that the daemon rewrites any address, forwarded or not. This issue is just to disable the rewriting if the sender domain does not require it, because forwarding can be done safely without SRS. If the sender's domain has SPF enabled, you need SRS, so it is better to do it (although not forwarded later, but that's the well-known postfix cleanup limitation).

from postsrsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.