-
Notifications
You must be signed in to change notification settings - Fork 75
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
Skip invalid hostnames check in uribl #269
Conversation
For example the string my..my would be detected as a hostname and ends with a fatal plugin error (data_post) uribl: URIBL: checking sub-host my..my (data_post) uribl: URIBL: checking sub-host .my FATAL PLUGIN ERROR [uribl]: unexpected null domain label at /usr/lib64/perl5/vendor_perl/Net/DNS/Question.pm line 80 Instead of creating too complex regex, add a global regex list and skip entries which match one of them. For now, only .. are skiped, but it'll be easy to add more if needed Note that this smart match operator requires perl 5.10 or later
I'm thinking out loud here. I'm really not terribly fond of fixing one regex problem by throwing more regex at it. I think better and faster (runtime) would be to add a
|
What about relying on a dedicated module like http://search.cpan.org/~drolsky/Data-Validate-Domain/ to do those checks ? |
Even better! |
While I'm looking at this, we might even replace the manual URI search with http://search.cpan.org/~mschwern/URI-Find/lib/URI/Find.pm |
What about https://github.com/smtpd/qpsmtpd/compare/master...dani:valid_domain?expand=1 It's a very unintrusive solution, just requires Data::Validate::Domain (which itself requires Net::Domain::TLD. All it does is check the extracted strings are valid domain names (including check the labels are all valid etc...) |
My preferred solution is one that:
Bonus points for replacing custom QP code with well documented and supported CPAN modules. |
Do you mean this solution would be OK if I add unit test ? I'm not very familiar with them, I could probably hack it but here are no test at all for uribl for now, so I'm not sure where to start |
Exactly.
Take a look at the existing plugins that have unit tests. We've done a lot of work to make it not terribly difficult to write plugin tests. Also, you can run the unit tests for just one plugin with this syntax:
That saves a ton of time. |
On Tue, 5 Jul 2016, Matt Simerson wrote:
... which don't have a deep dependency tree. |
Which is the case: Data::Validate::Domain only requires Net::Domain::TLD. Unfortunately, I just can't get the logic for writing unit tests :-( |
@dani, did you make progress on using Data::Validate::Domain? If so, can you push that to this branch? |
closing as abandoned. |
@msimerson , is uribl plugin abandonned or is this the lack of answer of @dani that makes this pull request abandoned ? |
the latter. |
For example the string my..my would be detected as a hostname and ends with a fatal plugin error
(data_post) uribl: URIBL: checking sub-host my..my
(data_post) uribl: URIBL: checking sub-host .my
FATAL PLUGIN ERROR [uribl]: unexpected null domain label at /usr/lib64/perl5/vendor_perl/Net/DNS/Question.pm line 80
Instead of creating too complex regex, add a global regex list and skip entries which match one of them.
For now, only .. are skiped, but it'll be easy to add more if needed
Note that this smart match operator requires perl 5.10 or later