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

feat: add function ValidateHostAndUser to validate host and user preventing SPAN and BOT #28

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

moisespsena
Copy link
Contributor

I'm using the function ValidateHost to validates host and user in my server, bot, my server provider forwarded this alert to me:

This is an abuse report for an email message sent by IP XXX.XXX.XXX.XXX on Thu, 18 Jun 2020 21:16:22 -0300
This abuse appears to be a spoofing attack or its sender has a wrong SPF configuration for sure.
If you have any question about this abuse, contact the anti-spam administrator [email protected].
For more information about this abuse format below, see https://tools.ietf.org/html/rfc5965
Feedback-Type: abuse
User-Agent: SPFBL/2.11
Version: 1
Original-Mail-From: [email protected]
Original-Rcpt-To: [email protected]
Arrival-Date: Thu, 18 Jun 2020 21:16:22 -0300
Reporting-MTA: dns; mx-br.spfbl.net
Source-IP: XXX.XXX.XXX.XXX
Authentication-Results: mx-br.spfbl.net; smtp.mail=[email protected]; spf=softfail
Removal-Recipient: [email protected]
This email message was rejected at RCPT TO command, so we don't have its headers.

I noticed that the email informed in the message was the one set in the ValidateHost function. So, I made the following changes:

  1. the ValidateHost function now validates only the host of the email address and no longer the user, since it does not require a valid SMTP domain to return.
  2. I created the ValidateHostAndUser function that requires the arguments serverHostName and serverMailAddress.

In this way it makes it possible to validate according to each application and hosting server of the same, not using your pre-fixed email address ([email protected]) and not even a host that did not exist (checkmail.me) .

@badoux badoux merged commit 85ee8a7 into badoux:master Sep 9, 2020
@badoux
Copy link
Owner

badoux commented Sep 9, 2020

Thanks for your contribution !

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

Successfully merging this pull request may close these issues.

None yet

2 participants