On 2023/10/14 15:06:11 +0200, Sagar Acharya <sagaracha...@tutanota.com> wrote: > How do I reject all emails with attachments by using an opensmtpd filter?
I never used it, but from the look of it you could try mimedefang via the filter-mimedefang package. It's available on OpenBSD, but being written in perl I assume it would work everywhere. https://mimedefang.org/download/ > At what step do I set the filter? rcpt-to, data, or commit step? > > Any tutorials are appreciated. Other than the link posted by Crystal, I don't think there are any tutorials on how to write an OpenSMTPD filter. However, the protocol is described in smtpd-filters(7) [0], and you can take a look at existing implementations, like filter-rspamd[1] (which is written in Go) or at a library like libopensmtpd[2] or OpenSMTPd-Filter[3] which should simplify the task of writing a filter. [0]: https://man.openbsd.org/smtpd-filters.7 [1]: https://github.com/poolpOrg/filter-rspamd [2]: http://imperialat.at/dev/libopensmtpd/ [3]: https://metacpan.org/dist/OpenSMTPd-Filter