Bug 256711 - mail/mimedefang: allow setting memory limits in rc.conf
Summary: mail/mimedefang: allow setting memory limits in rc.conf
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Mateusz Piotrowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-19 09:56 UTC by ml
Modified: 2022-01-20 21:56 UTC (History)
2 users (show)

See Also:
0mp: maintainer-feedback+


Attachments
Allow setting MX_MAX_RSS and MX_MAX_AS in rc.conf (3.28 KB, patch)
2021-06-19 09:56 UTC, ml
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ml 2021-06-19 09:56:36 UTC
Created attachment 225926 [details]
Allow setting MX_MAX_RSS and MX_MAX_AS in rc.conf

In order to avoid DOSes due to complex MIME, MIMEDefang sets some limits on how much memory a process can use (MX_MAX_RSS and MX_MAX_AS).

The provided example init script sets these variables to very low values (which probably made sense when RAM was much scarcer); the port already patches that file, increasing them, but they are still way too low in some cases, resulting in some mail messages crashing the filter and not passing.

This patch, while retaining the current port defaults, allows these thresholds to be set in rc.conf.
Comment 1 m.tsatsenko 2021-07-04 21:22:41 UTC
Looks good. Thanks for your work
Comment 2 Mateusz Piotrowski freebsd_committer freebsd_triage 2021-12-10 23:25:43 UTC
Would be good to upstream those changes.
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-12-10 23:26:35 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a8a45bdf49a9f13b4dd15d986de86a29e3ea45ed

commit a8a45bdf49a9f13b4dd15d986de86a29e3ea45ed
Author:     ml@netfence.it <ml@netfence.it>
AuthorDate: 2021-12-10 23:21:13 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2021-12-10 23:25:57 +0000

    mail/mimedefang: Allow setting MX_MAX_RSS and MX_MAX_AS in rc.conf

    In order to avoid DOSes due to complex MIME, MIMEDefang sets some limits
    on how much memory a process can use (MX_MAX_RSS and MX_MAX_AS).

    The provided example init script sets these variables to very low values
    (which probably made sense when RAM was much scarcer); the port already
    patches that file, increasing them, but they are still way too low in
    some cases, resulting in some mail messages crashing the filter and not
    passing.

    This patch, while retaining the current port defaults, allows these
    thresholds to be set in rc.conf.

    PR:             256711
    Approved by:    maintainer

 mail/mimedefang/Makefile                           |  2 +
 .../files/patch-examples__init-script.in           | 47 ++++++++++++++--------
 mail/mimedefang/files/patch-mimedefang-filter.5.in |  4 +-
 3 files changed, 35 insertions(+), 18 deletions(-)