On Tue, Jan 23, 2024 at 02:40:06PM -0500, Michael W. Lucas via mailop wrote:
> 
> I have domains that should never receive mail. I'd like a milter that
> looks for mail to those domains and feeds the IP of the sender to an
> outside program.
> 
> Surely someone wrote this spamtrap software? Or does everyone just
> parse the log?

Your description here made me think of an often ignored feature of a
system I am quite familiar with -- the OpenBSD spamd spam deferral deamon.

It's not a milter and I have no idea how well inserting spamd in your
incoming signal path fits your overall configuration, but at least it's
doable if you use or want to use OpenBSD or FreeBSD (where it exists as
a port).

Basically, if you fill your /etc/mail/spamd.alloweddomains (on OpenBSD)
or /usr/local/etc/spamd/spamd.alloweddomains (on FreeBSD) with the domains
you *do* want to receive mail for and leave the rest of them out, any host
trying to deliver mail via the interface spamd listens on to domains not
in that file will be added to spamd-greytrap, which is trivially expoartable
for use elsewhere. 

One recent example from here in the last few days:

Jan 23 15:18:27 skapet spamd[84681]: (GREY) 193.222.96.180: <t...@bsdly.net> -> 
<director_ericmo...@hotmail.com>
Jan 23 15:18:27 skapet spamd[4259]: Trapping 193.222.96.180 for tuple 
193.222.96.180 win-4tti4dh7sgh.domain <t...@bsdly.net> 
<director_ericmo...@hotmail.com>
Jan 23 15:18:27 skapet spamd[4259]: new greytrap entry 193.222.96.180 from 
<t...@bsdly.net> to <director_ericmo...@hotmail.com>, helo 
win-4tti4dh7sgh.domain

Needless to say I am not Microsoft, so hotmail.com is not in nxdomain.no's
/etc/mail/spamd.alloweddomains.

All the best,
Peter

-- 
Peter N. M. Hansteen, member of the first RFC 1149 implementation team
https://bsdly.blogspot.com/ https://www.bsdly.net/ https://www.nuug.no/
"Remember to set the evil bit on all malicious network traffic"
delilah spamd[29949]: 85.152.224.147: disconnected after 42673 seconds.
_______________________________________________
mailop mailing list
mailop@mailop.org
https://list.mailop.org/listinfo/mailop

Reply via email to