[Mimedefang] Embedded Perl (continued)

Jan-Pieter Cornet johnpc at xs4all.nl
Wed Sep 23 04:32:40 EDT 2015

On 2015-9-22 17:16 , Steffen Kaiser wrote:
> I had SpamAssassin rules allocating about 100MB, the forked children
> only shared the C libraries after some time. That's a problem of
> Perl's way to handle rereferences to data.

It might help not to integrate SpamAssassin, but to use spamc to communicate with spamd. However, that only saves memory if you have other stuff in your filter rules that take time processing messages, like DNS blacklist checks, virus scanners, SPF/DKIM/DMARC processing, SMTP forward lookups, etc.

That way, perl processes doing those other things do not have a big lump of SpamAssassin rules sitting in memory (which is usually quite a lot of memory due to the way spamassassin works). You'd generally need fewer spamassassin slaves than mimedefang slaves (if you don't, then this won't save memory but eat a bit more memory instead because of the extra perl processes involved).

On the other hand, it does make things a bit more complex because you have to manage another daemon, monitor it, restart when rules change, maintain configs, etc. Per-recipient rules might be somewhat harder.

Oh, and stock mimedefang doesn't support it. I've attached the SpamC.pm that we use for spamd communication. Also make sure that you set $Features{"SpamAssassin"} = 0 in your filter, to prevent Mail::SpamAssassin from loading (otherwise your mimedefang slaves would still eat memory for spamassassin).

You will need to modify this SpamC.pm as it uses a modular Mimedefang.pm, but the changes should be trivial.

Jan-Pieter Cornet <johnpc at xs4all.nl>
"Any sufficiently advanced incompetence is indistinguishable from malice."
    - Grey's Law
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SpamC.pm
Type: text/x-perl-script
Size: 3205 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20150923/2717d211/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 957 bytes
Desc: OpenPGP digital signature
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20150923/2717d211/attachment.sig>

More information about the MIMEDefang mailing list