Koozali.org: home of the SME Server

Clamav, Qmail, PHP, & DB Config files

cc_skavenger

Clamav, Qmail, PHP, & DB Config files
« on: May 03, 2005, 04:04:44 PM »
I have alot of users that like to send e-mails with large attachments, anywhere from 6 to 20 mb.  I am not sure if it is clamav, php, qmail or all three; but when they do send these large files, they end up in the problem e-mails panel in the antivirus panel of the server manager.

To fix this on another qmail e-mail server (Not a SME server), I edited /etc/php.ini and changed:
memory_limit to 32M
post_max_size to 32M
upload_max_filesize to 32M
I then restarted httpd.  I then edited /var/qmail/control/databytes and put in a value of 32768000 for 32mb and restarted qmail.

I was going to try this on a server, but I noticed in the template fragments that this might be easily controlled by the database configuration settings.  

So, my question is:
Are there some database configuration commands to change what I want to change? Something like:

/sbin/e-smith/db configuration setprop post_max_size 32M
/sbin/e-smith/signal-event remoteaccess-update

Thanks

Offline raem

  • *
  • 3,972
  • +4/-0
Re: Clamav, Qmail, PHP, & DB Config files
« Reply #1 on: May 03, 2005, 04:42:08 PM »
cc_skavenger

> ...I am not sure if it is clamav, php, qmail or all three....

I think it's all three depending what you are doing, (thanks to previous posters). Edit as required

for webmail attachments
/sbin/e-smith/config setprop php MaxExecutionTime 1800
/sbin/e-smith/config setprop php MemoryLimit 100000000
/sbin/e-smith/config setprop php PostMaxSize 20000000
/sbin/e-smith/config setprop php UploadMaxFilesize 20000000

/etc/e-smith/events/actions/conf-php

/etc/init.d/httpd-e-smith graceful


clamav.conf & amavis.conf

In /etc/clamav.conf
go to approx line 133 in the section titled
Files in archives larger than this limit won't be scanned
Look for the line no 133 that reads
ArchiveMaxFileSize 10M

In /etc/amavis-ng/amavis.conf
go to approx line 257 in the section titled
How much disk space do we want to consume?
Look for the line no 259 that reads
mazspace = 30M


for smtpfront-qmail  
/sbin/e-smith/db configuration setprop smtpfront-qmail MaxMessageSize 20000000
/sbin/e-smith/signal-event email-update
...

Offline smeghead

  • *
  • 557
  • +0/-0
Clamav, Qmail, PHP, & DB Config files
« Reply #2 on: May 03, 2005, 04:43:58 PM »
Hi Marco

Have you looked into the amavis.conf file?  If the file being sent is large then amavis will error due to using too much disk space, default is 30MB (I seem to recall).

Might be worth a look!

HTH
..................

cc_skavenger

Clamav, Qmail, PHP, & DB Config files
« Reply #3 on: May 03, 2005, 04:52:46 PM »
Will this also work for pop3 and smtp?  Most of our users do not use webmail.  

Sorry for the questions, but I am going to be doing this to a live server and I am hoping not to kill it...

Thanks

Offline raem

  • *
  • 3,972
  • +4/-0
Clamav, Qmail, PHP, & DB Config files
« Reply #4 on: May 04, 2005, 03:19:28 AM »
cc_skavenger

As mentioned there are three different issues.

If you use webmail then do the webmail fix.

If you use pop/smtp then do the smtpfront-qmail fix.

If you also use clamavis (in either case above)then do the fix for that as well.

These changes are safe to do on a live server.
...

cc_skavenger

Clamav, Qmail, PHP, & DB Config files
« Reply #5 on: May 04, 2005, 05:01:45 AM »
Sorry for the doubt.  I just needed to be sure.

Thanks.

Offline albatroz

  • ****
  • 159
  • +0/-0
Clamav, Qmail, PHP, & DB Config files
« Reply #6 on: May 12, 2005, 09:07:37 PM »
I guess I am also in the correct path
(I am using SME 6.01)

My recipe to increase attachments limits is:

First update Apache and PHP with these rpms
http://sme.swerts-knudsen.com/downloads/Updates/6.0.1/Apache/apache-1.3.31-1es1.i386.rpm
http://sme.swerts-knudsen.com/downloads/Updates/6.0.1/PHP/

then checked these points

/etc/php.ini: memory_limit = 20M ; needs to be 2-3 x max upload/attach
/etc/php.ini: file_uploads = On
/etc/php.ini: upload_max_filesize = 20M ; max individual attachment
/etc/httpd/conf/httpd.conf: LimitRequestBody 536870912

However, I am receiving mixed results.
I could attach a 4megabytes file. This is a 100% increase
over the 2megs standard, but with bigger messages,
I receive these messages in /var/log/messages

Allowed memory size of 33554432 bytes exhausted (tried to allocate 8321939 bytes) in /usr/share/pear/Net/SMTP.php on line 750

cc_skavenger

Clamav, Qmail, PHP, & DB Config files
« Reply #7 on: May 13, 2005, 06:58:04 AM »
What Ray mentioned seems to be working.  I don't seem to be getting problem e-mails anymore (except when I upgrade Clam during work hours). :hammer: