Add link conversion for Progress Forum.
[lw2-viewer.git] / src / dnsbl.lisp
blob36d28af6bb34a1ec83be9bf4538f76fabdbb9af6
1 (uiop:define-package #:lw2.dnsbl
2 (:use #:cl #:lw2-viewer.config)
3 (:export #:dnsbl-check))
5 (in-package #:lw2.dnsbl)
7 (defun dnsbl-check (address)
8 (let ((quads (split-sequence:split-sequence #\. address)))
9 (when (= (length quads) 4)
10 (loop
11 for dnsbl in *dnsbl-list*
12 for result =
13 (ignore-errors
14 (usocket:get-host-by-name
15 (format nil "~{~A~^.~}.~A" (nreverse quads) dnsbl)))
16 when result return (values result dnsbl)))))