webapps and /etc/virtual/limit

ccto

Verified User
Joined
Feb 24, 2005
Messages
275
Location
Hong Kong
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.
 
On my installs they're owned by root. What OS Distribution do you use?

Jeff
 
Oh. Thanks.

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

Thanks.

Jeff
 
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:
Code:
if ($username eq "apache" || $username eq "nobody")
to
Code:
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
 
And now I've updated the Nobaloney Internet Services download site as well.

Jeff
 
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 :)
 
Hello,

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

John
 
John, thanks for the reply. Could you please provide the code.
 
Change this line in exim.pl find_uid section:
Code:
[FONT=monospace]
[/FONT]if ($username eq "apache" || $username eq "nobody" || $username eq "webapps")

To:
Code:
[FONT=monospace]
[/FONT]if ($username eq "apache" || $username eq "nobody" || $username eq "webapps" || $username eq "[B]westest[/B]")
 
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?
 
Any idea is much appreciated. I have a client waiting for this issue to be resolved :(
 
Last edited:
Back
Top