diff -ruN e-smith-pop3-2.2.0.old/createlinks e-smith-pop3-2.2.0/createlinks --- e-smith-pop3-2.2.0.old/createlinks 2012-07-06 05:38:19.000000000 +0100 +++ e-smith-pop3-2.2.0/createlinks 2012-07-06 06:32:52.000000000 +0100 @@ -12,7 +12,11 @@ } templates2events("/etc/pam.d/pop3", "console-save"); -templates2events("/etc/pam.d/pop3", "bootstrap-console-save"); + +foreach my $file (qw(/etc/pam.d/pop3 /var/service/pop3/env/MEMLIMIT /var/service/pop3s/env/MEMLIMIT)) +{ + templates2events($file, "bootstrap-console-save"); +} foreach my $event (qw(network-delete network-create email-update)) { diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT --- e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3/env/MEMLIMIT 2012-07-06 06:36:53.000000000 +0100 @@ -0,0 +1,7 @@ +{ +# memory limit to catch any memory leak before it kills the system +my $MIN_MEMORY_LIMIT = 40000000; + +# The MIN_MEMORY_LIMIT is returned unless the DB variable is defined and greater than MIN_MEMORY_LIMIT +$OUT = (not defined ($pop3{MemLimit})) || ($pop3{MemLimit} < $MIN_MEMORY_LIMIT) ? $MIN_MEMORY_LIMIT : $pop3{MemLimit}; +} diff -ruN e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT --- e-smith-pop3-2.2.0.old/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT 1970-01-01 01:00:00.000000000 +0100 +++ e-smith-pop3-2.2.0/root/etc/e-smith/templates/var/service/pop3s/env/MEMLIMIT 2012-07-06 06:38:21.000000000 +0100 @@ -0,0 +1,7 @@ +{ +# memory limit to catch any memory leak before it kills the system +my $MIN_MEMORY_LIMIT = 40000000; + +# The MIN_MEMORY_LIMIT is returned unless the DB variable is defined and greater than MIN_MEMORY_LIMIT +$OUT = (not defined ($pop3s{MemLimit})) || ($pop3s{MemLimit} < $MIN_MEMORY_LIMIT) ? $MIN_MEMORY_LIMIT : $pop3s{MemLimit}; +} diff -ruN e-smith-pop3-2.2.0.old/root/var/service/pop3/run e-smith-pop3-2.2.0/root/var/service/pop3/run --- e-smith-pop3-2.2.0.old/root/var/service/pop3/run 2012-07-06 05:38:19.000000000 +0100 +++ e-smith-pop3-2.2.0/root/var/service/pop3/run 2012-07-06 06:32:30.000000000 +0100 @@ -3,11 +3,12 @@ hostname=$(/sbin/e-smith/config get SystemName) domain=$(/sbin/e-smith/config get DomainName) fqdn="$hostname.$domain" +MEM="`head -1 ./env/MEMLIMIT`" exec 2>&1 # Generate ACL files in ./peers ./control/1 -exec /usr/local/bin/softlimit -m 10000000 \ +exec /usr/local/bin/softlimit -m ${MEM} \ tcpsvd \ -v \ -i ./peers \ diff -ruN e-smith-pop3-2.2.0.old/root/var/service/pop3s/run e-smith-pop3-2.2.0/root/var/service/pop3s/run --- e-smith-pop3-2.2.0.old/root/var/service/pop3s/run 2012-07-06 05:38:19.000000000 +0100 +++ e-smith-pop3-2.2.0/root/var/service/pop3s/run 2012-07-06 06:32:19.000000000 +0100 @@ -3,9 +3,10 @@ hostname=$(/sbin/e-smith/config get SystemName) domain=$(/sbin/e-smith/config get DomainName) fqdn="$hostname.$domain" +MEM="`head -1 ./env/MEMLIMIT`" exec 2>&1 -exec /usr/local/bin/softlimit -m 10000000 \ +exec /usr/local/bin/softlimit -m ${MEM} \ tcpsvd \ -v \ -i ./peers \