Implements IP blacklist checking tool

This commit is contained in:
Alicia Sykes committed 2025-10-07 07:06:21 +01:00
1 parent 3a40ff9eb7
commit 5892efdf6b
4 files changed
+1173

No files matched your search

+30
View File
@@ -253,4 +253,34 @@ export const iconMap: Record<string, string> = {
'dnssec-chain': `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d="M144 160L144 224C144 232.8 151.2 240 160 240L480 240C488.8 240 496 232.8 496 224L496 160C496 151.2 488.8 144 480 144L160 144C151.2 144 144 151.2 144 160zM336 416L336 480C336 488.8 343.2 496 352 496L480 496C488.8 496 496 488.8 496 480L496 416C496 407.2 488.8 400 480 400L352 400C343.2 400 336 407.2 336 416z"/><path d="M480 144C488.8 144 496 151.2 496 160L496 224C496 232.8 488.8 240 480 240L160 240C151.2 240 144 232.8 144 224L144 160C144 151.2 151.2 144 160 144L480 144zM160 96C124.7 96 96 124.7 96 160L96 224C96 259.3 124.7 288 160 288L168 288L168 384C168 432.6 207.4 472 256 472L288 472L288 480C288 515.3 316.7 544 352 544L480 544C515.3 544 544 515.3 544 480L544 416C544 380.7 515.3 352 480 352L352 352C316.7 352 288 380.7 288 416L288 424L256 424C233.9 424 216 406.1 216 384L216 288L480 288C515.3 288 544 259.3 544 224L544 160C544 124.7 515.3 96 480 96L160 96zM480 400C488.8 400 496 407.2 496 416L496 480C496 488.8 488.8 496 480 496L352 496C343.2 496 336 488.8 336 480L336 416C336 407.2 343.2 400 352 400L480 400z"/></svg>`,
signature: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Pro v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2025 Fonticons, Inc.--><path opacity=".4" d=""/><path d="M144 192C144 165.5 165.5 144 192 144C218.5 144 240 165.5 240 192L240 199.9C240 225.6 238 251.3 233.9 276.7L123.5 314.5C87.9 326.7 64 360.1 64 397.7L64 474C64 512.6 95.3 544 134 544C158.6 544 181.4 531.1 194 510L209.9 483.6C239.5 434.2 261 380.3 273.5 324.1L275.3 316L275.9 313.1L352.7 286.8L329.4 351.9C326.8 359.3 327.9 367.4 332.4 373.8C336.3 379.3 342.3 382.9 348.9 383.8C354 375 360.5 367.1 368 360.4L368 336C368 296.6 385.8 261.4 413.8 237.9C412.7 235.4 411.1 233.1 409.1 231.1C402.6 224.5 393 222.3 384.2 225.2L284.7 259.3C286.9 239.6 288 219.7 288 199.8L288 191.9C288 138.9 245 95.9 192 95.9C139 95.9 96 139 96 192L96 232C96 245.3 106.7 256 120 256C133.3 256 144 245.3 144 232L144 192zM289.5 432C282.7 448.3 275.2 464.3 266.9 480L336 480L336 432L289.5 432zM139.1 359.9L222.4 331.4C210.7 376.2 192.6 419.1 168.8 458.9L152.9 485.3C148.9 491.9 141.8 496 134.1 496C122 496 112.1 486.2 112.1 474L112.1 397.7C112.1 380.6 123 365.4 139.2 359.9zM528 336.1L528 384L464 384L464 336.1C464 318.4 478.3 304.1 496 304.1C513.7 304.1 528 318.4 528 336.1zM384 432L384 528C384 554.5 405.5 576 432 576L560 576C586.5 576 608 554.5 608 528L608 432C608 411.1 594.6 393.3 576 386.7L576 336.1C576 291.9 540.2 256.1 496 256.1C451.8 256.1 416 291.9 416 336.1L416 386.7C397.4 393.3 384 411.1 384 432z"/></svg>`,
// '': ``,
// pie-chart
// help-circle
// balance-scale
// code
// test
// performance
// security
// globe-2
// users
// list-ordered
// tunnel
// user
// flag
// book-open
// shuffle
// template
// share
// list-checks
// clipboard-list
// edit-3
// mail-check
// eye
// star
// wifi
// play-circle
// formula
// default
};
+20
View File
@@ -1168,6 +1168,26 @@ export const SUB_NAV: Record<string, (NavItem | NavGroup)[]> = {
'authenticated',
],
},
{
href: makePath('/diagnostics/dns/blacklist-checker'),
label: 'DNS Blacklist Checker',
description: 'Check if IP or domain is listed on spam blacklists for email deliverability troubleshooting',
icon: 'blacklist',
keywords: [
'dnsbl',
'rbl',
'blacklist',
'spam',
'spamhaus',
'sorbs',
'email',
'deliverability',
'reputation',
'blocklist',
'listing',
'delisting',
],
},
{
href: makePath('/diagnostics/dns/soa-serial'),
label: 'SOA Serial Analyzer',
@@ -0,0 +1,304 @@
import { json, error } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { promises as dns } from 'node:dns';
interface DNSBLRequest {
target: string; // IP or domain
}
interface RBLResult {
rbl: string;
listed: boolean;
response?: string;
reason?: string;
responseTime: number;
error?: string;
url?: string;
description?: string;
}
interface DNSBLResponse {
target: string;
targetType: 'ipv4' | 'ipv6' | 'domain';
resolvedIPs?: string[];
results: RBLResult[];
summary: {
totalChecked: number;
listedCount: number;
cleanCount: number;
errorCount: number;
};
timestamp: string;
}
// Comprehensive list of major RBLs
const RBLS = [
// Spamhaus
// { zone: 'zen.spamhaus.org', name: 'Spamhaus ZEN', description: 'Combined blocklist', url: 'https://www.spamhaus.org/lookup/' },
// { zone: 'sbl.spamhaus.org', name: 'Spamhaus SBL', description: 'Spam sources', url: 'https://www.spamhaus.org/lookup/' },
// { zone: 'xbl.spamhaus.org', name: 'Spamhaus XBL', description: 'Exploits', url: 'https://www.spamhaus.org/lookup/' },
// { zone: 'pbl.spamhaus.org', name: 'Spamhaus PBL', description: 'Policy blocklist', url: 'https://www.spamhaus.org/lookup/' },
{ zone: 'dbl.spamhaus.org', name: 'Spamhaus DBL', description: 'Domain blocklist', url: 'https://www.spamhaus.org/lookup/' },
// SORBS
{ zone: 'dnsbl.sorbs.net', name: 'SORBS', description: 'Spam sources', url: 'https://www.sorbs.net/lookup.shtml' },
// SpamCop
{ zone: 'bl.spamcop.net', name: 'SpamCop', description: 'Spam reports', url: 'https://www.spamcop.net/bl.shtml' },
// Barracuda
{ zone: 'b.barracudacentral.org', name: 'Barracuda', description: 'Reputation system', url: 'https://barracudacentral.org/lookups' },
// UCEPROTECT
{ zone: 'dnsbl-1.uceprotect.net', name: 'UCEPROTECT L1', description: 'Single IPs', url: 'https://www.uceprotect.net/en/rblcheck.php' },
{ zone: 'dnsbl-2.uceprotect.net', name: 'UCEPROTECT L2', description: 'ISP ranges', url: 'https://www.uceprotect.net/en/rblcheck.php' },
{ zone: 'dnsbl-3.uceprotect.net', name: 'UCEPROTECT L3', description: 'Countries/ASNs', url: 'https://www.uceprotect.net/en/rblcheck.php' },
// PSBL
{ zone: 'psbl.surriel.com', name: 'PSBL', description: 'Passive spam block', url: 'https://psbl.org/' },
// Others
// { zone: 'cbl.abuseat.org', name: 'CBL', description: 'Composite blocking', url: 'https://www.abuseat.org/lookup.cgi' },
{ zone: 'dnsbl.dronebl.org', name: 'DroneBL', description: 'Drones/zombies', url: 'https://dronebl.org/lookup' },
{ zone: 'spam.dnsbl.sorbs.net', name: 'SORBS Spam', description: 'Verified spam', url: 'https://www.sorbs.net/lookup.shtml' },
{ zone: 'dul.dnsbl.sorbs.net', name: 'SORBS DUL', description: 'Dynamic IPs', url: 'https://www.sorbs.net/lookup.shtml' },
{ zone: 'bl.blocklist.de', name: 'Blocklist.de', description: 'Blocklist.de (abusive mail servers)', url: 'https://www.blocklist.de/en/index.html' },
{ zone: 'bl.mailspike.net', name: 'Mailspike', description: 'Mailspike abuse list', url: 'https://mailspike.org/' },
{ zone: 'all.spamrats.com', name: 'SpamRats', description: 'SpamRats RBL', url: 'https://www.spamrats.com/' },
{ zone: 'multi.surbl.org', name: 'SURBL Multi', description: 'URI/domain lists (phishing/malware/abuse)', url: 'https://www.surbl.org/' },
{ zone: 'dnsrbl.org', name: 'DNSRBL', description: 'DNS Real-time Blackhole List', url: 'https://dnsrbl.org/' },
];
function isIPv4(str: string): boolean {
return /^(\d{1,3}\.){3}\d{1,3}$/.test(str);
}
function isIPv6(str: string): boolean {
return /^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/.test(str);
}
function reverseIPv4(ip: string): string {
return ip.split('.').reverse().join('.');
}
function reverseIPv6(ip: string): string {
// Expand IPv6 to full form
const parts = ip.split(':');
const fullParts: string[] = [];
for (let i = 0; i < parts.length; i++) {
if (parts[i] === '') {
const zerosNeeded = 8 - parts.filter(p => p !== '').length;
for (let j = 0; j <= zerosNeeded; j++) {
fullParts.push('0000');
}
} else {
fullParts.push(parts[i].padStart(4, '0'));
}
}
// Convert to nibble format and reverse
const nibbles = fullParts.slice(0, 8).join('').split('').reverse().join('.');
return nibbles;
}
async function checkRBL(ip: string, rbl: typeof RBLS[0], isDomain: boolean): Promise<RBLResult> {
const startTime = Date.now();
try {
let query: string;
if (isDomain) {
// For domain blacklists, query domain directly
query = `${ip}.${rbl.zone}`;
} else if (isIPv4(ip)) {
query = `${reverseIPv4(ip)}.${rbl.zone}`;
} else if (isIPv6(ip)) {
query = `${reverseIPv6(ip)}.${rbl.zone}`;
} else {
throw new Error('Invalid IP format');
}
const addresses = await dns.resolve4(query);
const responseTime = Date.now() - startTime;
// Get TXT record for listing reason
let reason: string | undefined;
try {
const txtRecords = await dns.resolveTxt(query);
reason = txtRecords.flat().join(' ');
} catch {
// TXT record optional
}
// Check if this is an error response rather than actual listing
// Many RBLs return specific codes for errors (e.g., 127.255.255.x for errors)
const response = addresses[0];
const isErrorResponse =
response.startsWith('127.255.') || // Common error code range
(reason && (
reason.toLowerCase().includes('open resolver') ||
reason.toLowerCase().includes('query refused') ||
reason.toLowerCase().includes('not supported') ||
reason.toLowerCase().includes('check.spamhaus.org') ||
reason.toLowerCase().includes('blocked - see') ||
reason.toLowerCase().includes('access denied') ||
reason.toLowerCase().includes('please use')
));
if (isErrorResponse) {
return {
rbl: rbl.name,
listed: false,
responseTime,
error: reason || 'RBL query blocked or unsupported',
};
}
return {
rbl: rbl.name,
listed: true,
response,
reason,
responseTime,
url: rbl.url,
description: rbl.description,
};
} catch (err: any) {
const responseTime = Date.now() - startTime;
if (err.code === 'ENOTFOUND' || err.code === 'ENODATA') {
// Not listed
return {
rbl: rbl.name,
listed: false,
responseTime,
};
}
// Actual error
return {
rbl: rbl.name,
listed: false,
responseTime,
error: err.message,
};
}
}
async function resolveTarget(target: string): Promise<{ type: 'ipv4' | 'ipv6' | 'domain'; ips?: string[] }> {
if (isIPv4(target)) {
return { type: 'ipv4' };
}
if (isIPv6(target)) {
return { type: 'ipv6' };
}
// It's a domain, resolve to IPs
try {
const ips: string[] = [];
let lastError: Error | null = null;
try {
const ipv4s = await dns.resolve4(target);
ips.push(...ipv4s);
} catch (err) {
lastError = err as Error;
// No IPv4
}
try {
const ipv6s = await dns.resolve6(target);
ips.push(...ipv6s);
} catch (err) {
if (!lastError) lastError = err as Error;
// No IPv6
}
if (ips.length === 0) {
// Provide helpful error message based on DNS error
if (lastError && 'code' in lastError) {
if (lastError.code === 'ENOTFOUND') {
throw new Error(`Domain "${target}" does not exist or could not be found`);
} else if (lastError.code === 'ENODATA') {
throw new Error(`Domain "${target}" exists but has no A or AAAA records`);
} else if (lastError.code === 'ETIMEOUT') {
throw new Error(`DNS lookup timed out for "${target}"`);
}
}
throw new Error(`Could not resolve domain "${target}" to any IP addresses`);
}
return { type: 'domain', ips };
} catch (err) {
throw new Error(`Failed to resolve domain: ${err instanceof Error ? err.message : 'Unknown error'}`);
}
}
export const POST: RequestHandler = async ({ request }) => {
try {
const body: DNSBLRequest = await request.json();
const { target } = body;
if (!target || typeof target !== 'string' || !target.trim()) {
throw error(400, 'Target IP or domain is required');
}
const trimmedTarget = target.trim().toLowerCase();
// Resolve target
const { type, ips } = await resolveTarget(trimmedTarget);
let allResults: RBLResult[] = [];
if (type === 'domain') {
// Check domain blacklists (DBL)
const domainRBLs = RBLS.filter(rbl => rbl.zone.includes('dbl'));
const domainChecks = domainRBLs.map(rbl => checkRBL(trimmedTarget, rbl, true));
const domainResults = await Promise.all(domainChecks);
allResults.push(...domainResults);
// Check IPs against IP blacklists
if (ips && ips.length > 0) {
const ipRBLs = RBLS.filter(rbl => !rbl.zone.includes('dbl'));
for (const ip of ips) {
const ipChecks = ipRBLs.map(rbl => checkRBL(ip, rbl, false));
const ipResults = await Promise.all(ipChecks);
allResults.push(...ipResults.map(r => ({ ...r, rbl: `${r.rbl} (${ip})` })));
}
}
} else {
// Check IP against all IP blacklists
const ipRBLs = RBLS.filter(rbl => !rbl.zone.includes('dbl'));
const checks = ipRBLs.map(rbl => checkRBL(trimmedTarget, rbl, false));
allResults = await Promise.all(checks);
}
const summary = {
totalChecked: allResults.length,
listedCount: allResults.filter(r => r.listed).length,
cleanCount: allResults.filter(r => !r.listed && !r.error).length,
errorCount: allResults.filter(r => r.error).length,
};
const response: DNSBLResponse = {
target: trimmedTarget,
targetType: type,
resolvedIPs: ips,
results: allResults,
summary,
timestamp: new Date().toISOString(),
};
return json(response);
} catch (err) {
console.error('DNSBL check error:', err);
if (err && typeof err === 'object' && 'status' in err) {
throw err;
}
throw error(500, `DNSBL check failed: ${err instanceof Error ? err.message : 'Unknown error'}`);
}
};
@@ -0,0 +1,819 @@
<script lang="ts">
import { tooltip } from '$lib/actions/tooltip.js';
import Icon from '$lib/components/global/Icon.svelte';
import '../../../../styles/diagnostics-pages.scss';
let target = $state('');
let loading = $state(false);
let results = $state<any>(null);
let error = $state<string | null>(null);
let selectedExampleIndex = $state<number | null>(null);
let expandedItems = $state<Record<string, boolean>>({});
function toggleExpand(rblName: string) {
expandedItems = {
...expandedItems,
[rblName]: !expandedItems[rblName]
};
}
const examples = [
{ target: 'example.com', description: 'Example.com (12 IPs, Clean Domain)' },
{ target: '127.0.0.2', description: 'RBL Test IP (Multiple Listings)' },
{ target: '1.1.1.1', description: 'Cloudflare DNS (Clean IP)' },
{ target: '::FFFF:7F00:2', description: 'Local IPv6' },
];
const isInputValid = $derived(() => {
const trimmed = target.trim();
if (!trimmed) return false;
// Basic IP or domain validation
const ipv4Pattern = /^(\d{1,3}\.){3}\d{1,3}$/;
const ipv6Pattern = /^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;
const domainPattern = /^([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
return ipv4Pattern.test(trimmed) || ipv6Pattern.test(trimmed) || domainPattern.test(trimmed);
});
async function checkBlacklist() {
if (!isInputValid) return;
loading = true;
error = null;
results = null;
try {
const response = await fetch('/api/internal/diagnostics/dnsbl', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ target: target.trim() }),
});
if (!response.ok) {
const data = await response.json();
throw new Error(data.message || 'Failed to check blacklist');
}
results = await response.json();
} catch (err) {
error = err instanceof Error ? err.message : 'An unexpected error occurred';
} finally {
loading = false;
}
}
function loadExample(example: (typeof examples)[0], index: number) {
target = example.target;
selectedExampleIndex = index;
checkBlacklist();
}
function clearExampleSelection() {
selectedExampleIndex = null;
}
</script>
<svelte:head>
<title>DNS Blacklist Checker | IP Calc</title>
<meta
name="description"
content="Check if your IP address or domain is listed on major spam blacklists (RBLs). Multi-RBL checking for email deliverability troubleshooting."
/>
<meta
name="keywords"
content="DNSBL, RBL, blacklist checker, spam blacklist, Spamhaus, SORBS, email deliverability, IP reputation"
/>
</svelte:head>
<div class="card">
<header class="card-header">
<h1>DNS Blacklist Checker</h1>
<p>Check if your IP or domain is listed on major spam blacklists (RBLs)</p>
</header>
<!-- Examples -->
<div class="card examples-card">
<details class="examples-details">
<summary class="examples-summary">
<Icon name="chevron-right" size="xs" />
<h4>Quick Examples</h4>
</summary>
<div class="examples-grid">
{#each examples as example, i (i)}
<button
class="example-card"
class:selected={selectedExampleIndex === i}
onclick={() => loadExample(example, i)}
use:tooltip={`Check ${example.target} on blacklists`}
>
<h5>{example.description}</h5>
<p>{example.target}</p>
</button>
{/each}
</div>
</details>
</div>
<!-- Input Form -->
<div class="card input-card">
<form class="inline-form" onsubmit={(e) => { e.preventDefault(); checkBlacklist(); }}>
<div class="form-group flex-grow">
<label for="target">IP Address or Domain</label>
<input
id="target"
type="text"
bind:value={target}
oninput={clearExampleSelection}
placeholder="e.g., 8.8.8.8 or example.com"
disabled={loading}
/>
</div>
<button type="submit" disabled={loading || !isInputValid} class="primary submit-btn">
{#if loading}
<Icon name="loader" size="sm" animate="spin" />
Checking...
{:else}
<Icon name="search" size="sm" />
Check Blacklist
{/if}
</button>
</form>
</div>
<!-- Error Display -->
{#if error}
<div class="card error-card">
<Icon name="alert-triangle" size="md" />
<div>
<h4>Error</h4>
<p>{error}</p>
</div>
</div>
{/if}
{#if loading}
<div class="card">
<div class="card-content">
<div class="loading-state">
<Icon name="loader" size="lg" animate="spin" />
<div class="loading-text">
<h3>Checking Blacklists</h3>
<p>Querying DNS blacklist records for {target}...</p>
</div>
</div>
</div>
</div>
{/if}
<!-- Results -->
{#if results}
<div class="card results-card">
<div class="card-header">
<h2>Blacklist Check Results</h2>
</div>
<!-- Summary -->
<div class="summary-section" class:clean={results.summary.listedCount === 0} class:listed={results.summary.listedCount > 0}>
<div class="summary-header">
<Icon name={results.summary.listedCount === 0 ? 'check-circle' : 'alert-triangle'} size="lg" />
<div>
<h3>{results.summary.listedCount === 0 ? 'Clean' : 'Listed on Blacklists'}</h3>
<p>Target: <strong>{results.target}</strong> ({results.targetType})</p>
{#if results.resolvedIPs && results.resolvedIPs.length > 0}
<p class="resolved-ips">Resolved IPs: {results.resolvedIPs.join(', ')}</p>
{/if}
</div>
</div>
<div class="info-grid">
<div class="info-item">
<span class="label">Total Checked</span>
<span class="value">{results.summary.totalChecked}</span>
</div>
<div class="info-item success">
<span class="label">Clean</span>
<span class="value">{results.summary.cleanCount}</span>
</div>
<div class="info-item error">
<span class="label">Listed</span>
<span class="value">{results.summary.listedCount}</span>
</div>
<div class="info-item warning">
<span class="label">Errors</span>
<span class="value">{results.summary.errorCount}</span>
</div>
</div>
</div>
<!-- Listed Results -->
{#if results.results.filter((r: any) => r.listed).length > 0}
<div class="card blacklist-section error">
<div class="card-header">
<h3>
<Icon name="alert-triangle" size="sm" />
Listed on Blacklists ({results.results.filter((r: any) => r.listed).length})
</h3>
</div>
<div class="results-list">
{#each results.results.filter((r: any) => r.listed) as result (result.rbl)}
<div class="result-item listed expandable" class:expanded={expandedItems[result.rbl]}>
<button class="result-header clickable" onclick={() => toggleExpand(result.rbl)}>
<span class:expanded={expandedItems[result.rbl]}>
<Icon name="chevron-right" size="xs" />
</span>
<strong>{result.rbl}</strong>
<span class="response-time">{result.responseTime}ms</span>
<span class="status-chip error">
<Icon name="x-circle" size="xs" />
Listed
</span>
</button>
{#if expandedItems[result.rbl]}
<div class="details-content">
{#if result.description}
<div class="record-details">
<span class="label">Type:</span>
<span class="value">{result.description}</span>
</div>
{/if}
{#if result.response}
<div class="record-details">
<span class="label">Response:</span>
<code>{result.response}</code>
</div>
{/if}
{#if result.reason}
<div class="record-details reason">
<span class="label">Reason:</span>
<span class="value">{result.reason}</span>
</div>
{/if}
{#if result.url}
<div class="record-details">
<span class="label">Delisting:</span>
<a href={result.url} target="_blank" rel="noopener noreferrer" class="delist-link">
<Icon name="external-link" size="xs" />
Check status and request removal
</a>
</div>
{/if}
</div>
{/if}
</div>
{/each}
</div>
</div>
{/if}
<!-- Clean Results -->
{#if results.results.filter((r: any) => !r.listed && !r.error).length > 0}
<div class="card blacklist-section success">
<details>
<summary class="card-header clickable">
<span class="chevron">
<Icon name="chevron-right" size="xs" />
</span>
<h3>
<Icon name="check-circle" size="sm" />
Clean Results ({results.results.filter((r: any) => !r.listed && !r.error).length})
</h3>
</summary>
<div class="results-list">
{#each results.results.filter((r: any) => !r.listed && !r.error) as result (result.rbl)}
<div class="result-item clean">
<div class="result-header">
<strong>{result.rbl}</strong>
<span class="response-time">{result.responseTime}ms</span>
<span class="status-chip success">
<Icon name="check-circle" size="xs" />
Clean
</span>
</div>
</div>
{/each}
</div>
</details>
</div>
{/if}
<!-- Warnings/Query Errors -->
{#if results.results.filter((r: any) => r.error).length > 0}
<div class="card blacklist-section warning">
<details>
<summary class="card-header clickable">
<span class="chevron">
<Icon name="chevron-right" size="xs" />
</span>
<h3>
<Icon name="alert-circle" size="sm" />
Query Warnings ({results.results.filter((r: any) => r.error).length})
</h3>
</summary>
<div class="results-list">
{#each results.results.filter((r: any) => r.error) as result (result.rbl)}
<div class="result-item warning-item">
<div class="result-header">
<strong>{result.rbl}</strong>
<span class="status-chip warning">
<Icon name="alert-circle" size="xs" />
Warning
</span>
</div>
<div class="record-details">
<span class="label">Note:</span>
<span class="value">{result.error}</span>
</div>
</div>
{/each}
</div>
<div class="warning-info">
<p>
<Icon name="info" size="xs" />
These RBLs could not be queried, possibly due to rate limiting, public resolver restrictions, or API access requirements.
This does not indicate a listing.
</p>
</div>
</details>
</div>
{/if}
<!-- Additional Info -->
<div class="card info-card">
<details>
<summary class="card-header clickable">
<span class="chevron">
<Icon name="chevron-right" size="xs" />
</span>
<h4>What do these results mean?</h4>
</summary>
<div class="card-content">
<div class="info-section">
<h5>Understanding Blacklists</h5>
<p>
DNS Blacklists (DNSBLs or RBLs) are databases used to identify IP addresses or domains known for sending spam,
hosting malware, or engaging in malicious activities. Email servers check these lists to filter unwanted mail.
</p>
</div>
<div class="info-section">
<h5>If You're Listed</h5>
<ul>
<li>Check the blacklist's website for delisting procedures</li>
<li>Investigate the cause (compromised system, open relay, etc.)</li>
<li>Fix the underlying issue before requesting removal</li>
<li>Most lists automatically delist after a period without incidents</li>
</ul>
</div>
<div class="info-section">
<h5>Major Blacklists Checked</h5>
<p>
This tool checks against major RBLs including Spamhaus (ZEN, SBL, XBL, PBL, DBL), SORBS, SpamCop, Barracuda,
UCEPROTECT, PSBL, CBL, and DroneBL. These are commonly used by email servers worldwide.
</p>
</div>
</div>
</details>
</div>
</div>
{/if}
</div>
<style lang="scss">
.inline-form {
display: flex;
gap: var(--spacing-md);
align-items: flex-end;
flex-wrap: wrap;
.form-group.flex-grow {
flex: 1;
min-width: 250px;
margin: 0;
}
.submit-btn {
white-space: nowrap;
}
}
.summary-section {
padding: var(--spacing-lg);
border-radius: var(--radius-md);
border-left: 4px solid var(--color-primary);
&.clean {
border-left-color: var(--color-success);
background: linear-gradient(
135deg,
color-mix(in srgb, var(--color-success), transparent 95%),
color-mix(in srgb, var(--color-success), transparent 98%)
);
}
&.listed {
border-left-color: var(--color-error);
background: linear-gradient(
135deg,
color-mix(in srgb, var(--color-error), transparent 95%),
color-mix(in srgb, var(--color-error), transparent 98%)
);
}
.summary-header {
display: flex;
gap: var(--spacing-md);
align-items: flex-start;
margin-bottom: var(--spacing-md);
h3 {
margin: 0 0 var(--spacing-2xs) 0;
color: var(--text-primary);
font-size: var(--font-size-xl);
}
p {
margin: 0;
color: var(--text-secondary);
font-size: var(--font-size-sm);
&.resolved-ips {
margin-top: var(--spacing-2xs);
font-family: monospace;
}
}
}
}
.blacklist-section {
margin-top: var(--spacing-md);
padding: var(--spacing-md);
.card-header {
h3 {
display: flex;
align-items: center;
gap: var(--spacing-sm);
}
}
&.success {
.card-header h3 :global(.icon) { color: var(--color-success);}
}
&.warning {
.card-header h3 :global(.icon) { color: var(--color-warning);}
}
&.error {
.card-header h3 :global(.icon) { color: var(--color-error);}
}
details {
.card-header.clickable {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
gap: var(--spacing-sm);
margin: 0;
cursor: pointer;
user-select: none;
border-radius: var(--radius-md);
padding: var(--spacing-sm);
transition: background var(--transition-fast);
&:hover {
background: var(--bg-tertiary);
}
.chevron {
display: inline-flex;
transition: transform var(--transition-fast);
}
h3 {
display: flex;
align-items: center;
gap: var(--spacing-xs);
margin: 0;
}
}
&[open] .card-header.clickable .chevron {
transform: rotate(90deg);
}
.results-list,
.warning-info {
animation: slideDown 0.2s ease-out;
}
}
}
.results-list {
display: flex;
flex-direction: column;
gap: var(--spacing-sm);
margin: var(--spacing-md) 0;
}
.result-item {
padding: var(--spacing-sm);
border-radius: var(--radius-sm);
border: 1px solid var(--border-primary);
transition: all var(--transition-fast);
&.listed {
background: color-mix(in srgb, var(--color-error), transparent 97%);
border-color: color-mix(in srgb, var(--color-error), transparent 70%);
.label {
min-width: 5rem;
}
}
&.clean {
background: color-mix(in srgb, var(--color-success), transparent 97%);
border-color: color-mix(in srgb, var(--color-success), transparent 80%);
}
&.warning-item {
background: color-mix(in srgb, var(--color-warning), transparent 97%);
border-color: color-mix(in srgb, var(--color-warning), transparent 80%);
}
&.expandable {
padding: 0;
overflow: hidden;
}
.result-header {
display: flex;
align-items: center;
gap: var(--spacing-sm);
strong {
flex: 1;
color: var(--text-primary);
font-size: var(--font-size-md);
}
.status-chip {
display: inline-flex;
align-items: center;
gap: var(--spacing-2xs);
padding: var(--spacing-2xs) var(--spacing-sm);
border-radius: var(--radius-sm);
font-size: var(--font-size-xs);
font-weight: 600;
white-space: nowrap;
&.error {
background: var(--color-error);
color: var(--bg-primary);
}
&.success {
background: var(--color-success);
color: var(--bg-primary);
}
&.warning {
background: var(--color-warning);
color: var(--bg-primary);
}
}
.response-time {
font-size: var(--font-size-xs);
color: var(--text-tertiary);
font-family: monospace;
}
&.clickable {
width: 100%;
padding: var(--spacing-sm);
background: transparent;
border: none;
cursor: pointer;
text-align: left;
transition: background var(--transition-fast);
&:hover {
background: color-mix(in srgb, var(--color-error), transparent 90%);
}
span.expanded {
transform: rotate(90deg);
transition: transform var(--transition-fast);
}
}
}
.details-content {
padding: 0 var(--spacing-sm) var(--spacing-sm) var(--spacing-sm);
animation: slideDown 0.2s ease-out;
}
.record-details {
display: flex;
gap: var(--spacing-sm);
align-items: flex-start;
margin-top: var(--spacing-sm);
font-size: var(--font-size-sm);
padding-left: var(--spacing-md);
.label {
color: var(--text-secondary);
font-weight: 600;
flex-shrink: 0;
}
code, .value {
color: var(--text-primary);
word-break: break-word;
flex: 1;
}
code {
font-family: monospace;
background: var(--bg-primary);
}
&.reason .value {
font-family: inherit;
}
.delist-link {
display: inline-flex;
align-items: center;
gap: var(--spacing-2xs);
color: var(--color-primary);
text-decoration: none;
font-weight: 500;
transition: color var(--transition-fast);
&:hover {
color: var(--color-primary-dark);
text-decoration: underline;
}
}
}
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.info-card {
margin-top: var(--spacing-md);
background: var(--bg-secondary);
.card-content {
padding-top: var(--spacing-md);
}
details {
.card-header.clickable {
display: flex;
flex-direction: row;
align-items: center;
justify-content: flex-start;
gap: var(--spacing-sm);
margin: 0;
cursor: pointer;
user-select: none;
transition: background var(--transition-fast);
&:hover {
background: var(--surface-hover);
}
.chevron {
display: inline-flex;
transition: transform var(--transition-fast);
}
h4 {
margin: 0;
}
}
&[open] .card-header.clickable .chevron {
transform: rotate(90deg);
}
.card-content {
animation: slideDown 0.2s ease-out;
}
}
.info-section {
margin-bottom: var(--spacing-md);
&:last-child {
margin-bottom: 0;
}
h5 {
color: var(--text-primary);
margin: 0 0 var(--spacing-xs) 0;
font-size: var(--font-size-md);
}
p {
color: var(--text-secondary);
line-height: 1.6;
margin: 0;
}
ul {
margin: var(--spacing-xs) 0 0 0;
padding-left: var(--spacing-lg);
color: var(--text-secondary);
line-height: 1.6;
li {
margin-bottom: var(--spacing-2xs);
}
}
}
}
.warning-info {
padding: var(--spacing-md);
margin-top: var(--spacing-sm);
background: color-mix(in srgb, var(--color-info), transparent 95%);
border-radius: var(--radius-sm);
border-left: 3px solid var(--color-info);
p {
margin: 0;
display: flex;
align-items: flex-start;
gap: var(--spacing-xs);
font-size: var(--font-size-sm);
color: var(--text-secondary);
line-height: 1.6;
}
}
.info-grid {
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
.info-item {
display: flex;
flex-direction: column;
gap: var(--spacing-xs);
justify-content: center;
align-items: center;
background: var(--bg-secondary);
padding: var(--spacing-sm);
border-radius: var(--radius-sm);
}
}
.error-card {
display: flex;
align-items: center;
padding: var(--spacing-md);
gap: var(--spacing-md);
p { margin: 0; }
}
@media (max-width: 768px) {
.inline-form {
.submit-btn {
width: 100%;
}
}
.info-grid {
grid-template-columns: 1fr 1fr;
}
.result-item .record-details {
flex-direction: column;
align-items: flex-start;
.label {
min-width: auto;
font-weight: 600;
}
}
}
@media (max-width: 480px) {
.info-grid {
grid-template-columns: 1fr;
}
.result-item .result-header {
flex-wrap: wrap;
.response-time {
width: 100%;
text-align: left;
}
}
}
</style>