Skip to content

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

@landons

Description

@landons

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions