mimedefang

mailfilter to identify and mark spam

WWW CVSWeb GITHub
  1. Package version
    mimedefang-3.4
  2. Maintainer
    Giovanni Bechis

MIMEDefang is a framework for filtering e-mail. It uses Sendmail's
"Milter" API, some C glue code, and some Perl code to let you write
high-performance mail filters in Perl.

People use MIMEDefang to:
- Block viruses
- Block or tag spam
- Remove HTML mail parts
- Add boilerplate disclaimers to outgoing mail
- Remove or alter attachments
- Replace attachments with URL's
- Implement sophisticated access controls.

You're limited only by your imagination. If you can think of it and code
it in Perl, you can do it with MIMEDefang.

+-----------------------------------------------------------------------
| Running ${PKGSTEM} on OpenBSD
+-----------------------------------------------------------------------

Post-installation steps
=======================
Register the mimedefang milter with sendmail(8) by adding the following
to your .mc file:

INPUT_MAIL_FILTER(`mimedefang', \
`S=local:/var/spool/MIMEDefang/mimedefang.sock, \
F=T, T=C:15m;S:4m;R:4m;E:10m')dnl

Then re-generate your .cf file.

When using administrator notifications, it is advised to add the
"_mdefang" user to the list of users that are allowed to set their
envelope "from" address to a different user. This is done in:
${SYSCONFDIR}/mail/trusted-user

Improving performance
---------------------
On a busy mail server, it is advised to have the spool directory in
virtual memory (i.e. ramdisk). This can be achieve by adding the
following line to fstab(5):
swap /var/spool/MIMEDefang tmpfs rw,nodev,nosuid,-s256M,-u570,-g570,-m0750 0 0

This will create a 256M tmpfs filesystem under /var/spool/MIMEDefang.

SpamAssassin
------------
SpamAssassin can be used by mimedefang(8) in which case some maintenance
tasks are required and cron(8) jobs must be setup in root's crontab(5):

- Automating SpamAssassin rule updates:
0 0 * * * PATH=${PATH}:${LOCALBASE}/bin; ${LOCALBASE}/bin/sa-update && ${RCDIR}/mimedefang_multiplexor reload >/dev/null

- Synchronizing the journal data into the Bayes databases:
30 0 * * * PATH=${PATH}:${LOCALBASE}/bin; su -s /bin/sh _mdefang -c "${LOCALBASE}/bin/sa-learn --force-expire >/dev/null"

IP validation header
====================
To retain relay's IP address information between Mail eXchangers, an
identical ${SYSCONFDIR}/mail/mimedefang-ip-key must be installed on all
relays. The content of this file is generated using:
# ${PREFIX}/share/examples/gen-ip-validator.pl

Start-up order
==============
Be sure to start mimedefang_multiplexor before mimedefang in rc.local(8).
# rcctl order mimedefang_multiplexor mimedefang

  • mail/p5-Mail-Tools
  • mail/p5-MIME-tools
  • security/p5-Crypt-OpenSSL-Random
  • security/p5-IO-Socket-SSL
  • sysutils/p5-Unix-Syslog
  • archivers/p5-Archive-Zip
  • www/p5-HTML-Parser

  • mail/p5-Mail-Tools
  • mail/p5-MIME-tools
  • security/p5-Crypt-OpenSSL-Random
  • security/p5-IO-Socket-SSL
  • sysutils/p5-Unix-Syslog
  • archivers/p5-Archive-Zip
  • www/p5-HTML-Parser