OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 

From: Wietse Venema (wietseporcupine.org)
Date: Sat Mar 01 2003 - 08:15:25 CST


Craig Sanders:
> AFAIK, mailbox_size_limit is implemented by master setting the file size
> ulimit (i.e. basically equivalent to "ulimit -f" in sh).
>
> is this set for all processes forked by master (including content
> filters) or only for local or mailbox_command?

There is no global mailbox size limit for all Postfix processes.
It would not make sense, because only the local/virtual delivery
agent actually deal with mailboxes.

Different processes set their file size limit to different values
as appropriate. A bit of grepping the source code reveals:

Mail submission:
    postdrop/postdrop.c: set_file_limit((off_t) var_message_limit);
    sendmail/sendmail.c: set_file_limit((off_t) var_message_limit);

Mail enqueuing:
    cleanup/cleanup_init.c: set_file_limit((off_t) var_message_limit);

Mail delivery:
    local/local.c: set_file_limit(var_mailbox_limit);
    virtual/virtual.c: set_file_limit(var_virt_mailbox_limit);

> e.g. say i have a content filter running as user "filter", and that
> content filter runs spamassassin 2.50 (which has bayesian stuff built
> in) - do i have to worry about ~filter/.spamassassin/bayes_toks
> exceeding mailbox_size_limit?

File size limits are inherited from parent process to child process.
What is the parent process of your content filter?

Aside from that, it seems to be a good idea to have resource limits
on content filtering processes, so that one weird message can't hose
your entire email infrastructure.

        Wietse