PDA

View Full Version : webapps and /etc/virtual/limit



ccto
10-29-2007, 11:02 PM
For your information -

During the testing , we found -

those webmail programs - squirrelmail, roundcube, uebimaiu, .. are owned by webapps.

If the php is running in cgi mode,
when user send out emails, it will send out successfully, however, it counts to /etc/virtual/usage/webapps
If we set the limit (/etc/virtual/limit) to prevent smtp abuse, it may cause webapps easily exceed the limit (as webmail shared by all hosting pop3 users)

May I suggest to (somehow) bypass webapps in smtp limit?

Thank you for your kind attention.
Regards
ccto.

nobaloney
10-30-2007, 04:51 PM
On my installs they're owned by root. What OS Distribution do you use?

Jeff

chatwizrd
10-30-2007, 04:55 PM
Custombuild and suphp they are owned by webapps

nobaloney
10-30-2007, 05:09 PM
Oh. Thanks.

John, can you make the exception? (see first post)

Thanks.

Jeff

DirectAdmin Support
10-31-2007, 12:30 AM
Ah, ok, the exim.pl is expecting the "apache" user there, to go into more detailed checking. It was never taught webapps.

I've added the webapps check as an alias to the apache user (same checks).
Basically, I just changed this line:
if ($username eq "apache" || $username eq "nobody")to
if ($username eq "apache" || $username eq "nobody" || $username eq "webapps")in the exim.pl in the "find_uid" subroutine.

You can get the updated exim.pl here:
http://files.directadmin.com/services/exim.pl

John

nobaloney
10-31-2007, 11:12 AM
And now I've updated the Nobaloney Internet Services download site as well.

Jeff

itsbk
02-12-2008, 02:59 AM
But is there a way to bypass a normal user? That is my limit is currently 200 per hour. But I need to allow another user, say "westest" to send 500 emails per hour. Is this possible.

Thanks in advance :)

DirectAdmin Support
02-12-2008, 03:06 AM
Hello,

Sure, just add a bit more code into the exim.pl to limit whoever, however much you want.

John

itsbk
02-12-2008, 03:29 AM
John, thanks for the reply. Could you please provide the code.

smtalk
02-12-2008, 06:18 AM
Change this line in exim.pl find_uid section:


if ($username eq "apache" || $username eq "nobody" || $username eq "webapps")


To:


if ($username eq "apache" || $username eq "nobody" || $username eq "webapps" || $username eq "westest")

itsbk
02-14-2008, 09:15 PM
Smtalk, thanks for the code. But from what I understand using your code can bypass limits for the user westest. But my question is, is it possible to apply different limits for different domains. I compared exim.pl of another control panel and introduced the following code, but it doesn't seem to work though mail sending/counting etc works as desired. Could you point me in the right direction.


sub check_limits
{
my $count = 0;
open (LIMIT, "/etc/virtual/limit");
my $email_limit = int(<LIMIT>);
close(LIMIT);

open (CUSTOM_LIMIT, "/etc/virtual/maxemails");
while(<CUSTOM_LIMIT>) {
s/\n//g;
my($maxuser,$maxmails) = split(/=/);
if ($maxuser eq $name) {
$email_limit = int($maxmails)};
}
close(CUSTOM_LIMIT);

But $email_limit is not considering the limit specified in /etc/virtual/maxemails. I also tried changing $name to $dmn.
Note: maxemail assumes entries in format username=limit. That is westest=5

Any ideas?

itsbk
02-16-2008, 08:44 AM
Hi,

Any ideas on the above issue?

itsbk
02-18-2008, 04:45 AM
Any idea is much appreciated. I have a client waiting for this issue to be resolved :(