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

Feature Request: Ability to return custom responses in validation process #151

Open
landons opened this issue May 6, 2019 · 6 comments
Open

Comments

@landons
Copy link

landons commented May 6, 2019

Hey there,

I'd like to create an SPF validation processor. This works as part of the save process, due to allowing custom responses (i.e. #78), but there's a lot of unnecessary overhead in getting all the way through the DATA command before doing the check, so it'd be better to do it when validating the recipient (that's Postfix's default approach as well).

However, the return value for ValidateRcpt is just an error, which is assumed to semantically mean the user doesn't exist.

// server.go
// ...
client.PushRcpt(to)
rcptError := s.backend().ValidateRcpt(client.Envelope)
if rcptError != nil {
	client.PopRcpt()
	client.sendResponse(r.FailRcptCmd, " ", rcptError.Error())
} else {
	client.sendResponse(r.SuccessRcptCmd)
}

Are you open to a similar change to what you did for #78? Being able to return RFC 7208-compatible responses to the RCPT TO command would be awesome.

I'm happy to take a stab at it too if you're open to it.

@landons
Copy link
Author

landons commented May 6, 2019

Actually, now I'll play devil's advocate against my own request for this specific case. It's rare for modern servers to use SPF by itself--DMARC constitutes the policy of what to do when SPF/DKIM checks fail, but the message body does need to be parsed to do DKIM or DMARC verification. I don't think I actually need this feature after all.

@landons landons closed this as completed May 6, 2019
@flashmob
Copy link
Owner

flashmob commented May 7, 2019

Howdy @landons

You've raised a good point!

It would be a good feature to add, so do you mind if this could be re-opened?

It would be better to be able to analyze the message while it is getting saved. The current model doesn't allow for this, as you have noticed, but a new "processing the message as a stream" feature is being worked on PR #135

What does Postfix do once the spf or dkim checks fail? Does it allow the connection to continue, or does it terminate it?

@landons landons reopened this May 7, 2019
@landons
Copy link
Author

landons commented May 7, 2019 via email

@jackwellsxyz
Copy link

Hello @flashmob and @landons, I'd love to have DKIM/SPF/DMARC added to go-guerrilla as well. How's the pull request going? Need any assistance? Thanks!

@flashmob
Copy link
Owner

flashmob commented Sep 18, 2019 via email

@landons
Copy link
Author

landons commented Sep 18, 2019 via email

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

3 participants