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

Enhancement Request: SPF/DKIM authenticated domains #58

Open
314159 opened this issue Jan 6, 2018 · 2 comments
Open

Enhancement Request: SPF/DKIM authenticated domains #58

314159 opened this issue Jan 6, 2018 · 2 comments
Labels

Comments

@314159
Copy link

314159 commented Jan 6, 2018

Hi,

I would suggest an improvement to postgrey, in that, if a email is sent, and the address is SFP/DKIM authenticated, then use the domain name in place of the IP address for postgrey.

This means that sites like google or facebook that never seem to use the same IP address to send a mail would be handled automatically and would not need to be whitelisted.

@schweikert
Copy link
Owner

I agree that it would be really useful, but this information is not available in the postfix access policy delegation protocol, so postgrey would need to do DNS lookups. With the current architecture of the daemon, this would not be possible in a performant and reliable way.

@Haravikk
Copy link

Haravikk commented Feb 15, 2020

I came to post essentially the same idea.

I'm assuming the performance concern is that postgrey is designed to receive incoming message details and respond as quickly as possible, which waiting for a (presumably blocking) SPF query would cause to slow down by a significant amount?

What if instead, new entries were marked as "SPF unknown", and processed by a background daemon instead? This way postgrey can continue to respond to queries with the data it has available at the time, but after the background daemon has checked for SPF details this data can be included for any requests that come in later. Unless the SPF lookup is very slow, it should still avoid false positives pretty quickly.

For example:

  1. postgrey receives a message from the unknown @example.org, delivered by foo.mailjet.com
  2. postgrey stores foo.mailjet.com for @example.org and delays as normal
  3. postgrey receives delayed message, marks tuple as allowed but with SPF unknown
  4. background daemon runs, grabbing SPF data for example.org (may require multiple queries if it uses the import directive). Data is stored.
  5. postgrey receives a new message from known @example.org but from unknown bar.mailjet.com, however it has SPF data for example.org which lists bar.mailjet.com as a valid sender, allowing the message to be passed immediately.

Something like that perhaps?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants