LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Restricting frequency of email checking with ipop3 (https://www.linuxquestions.org/questions/linux-software-2/restricting-frequency-of-email-checking-with-ipop3-98300/)

Synapse-lk 09-29-2003 01:30 PM

Restricting frequency of email checking with ipop3
 
I am looking for a way to restrict how often users can log into our ipop3 server to check their mail. The server is running RH 9 with dual 1.5Ghz Athlons and 1GB of RAM, but its getting totally swamped due to the number of requests to check email messages. A lot of our users are checking every minute, and no matter how much we ask they don't seem to want to stop, so I am looking for a way to make the server restrict the number of times they can login in a given time period. Any help would be great.

-Syn

clacour 10-02-2003 10:26 PM

I'm afraid I can't give detailed advice -- you'll have to do a fair amount of research to make this practical -- but check out PAM. It has a whole bunch of stuff beyond the obvious to give you control over how your system is used.

Disk quotas, cpu quotas, times users can log in, and (the one I think you'll be interested in,) I'm pretty sure you can specify how often somebody can do something (like log in). Set it up so they can only log in once every 5 minutes and your problem is solved.

One word of warning, though. I'm used to a "check for mail" being pretty quick and low-intensity. As a user, I would consider having my system check once a minute for new mail fairly reasonable. And if I know that someone has just sent me email, I might very likely check it four or five times over the next minute or minute and a half (until and unless I got it). If the second time I tried to check, it said "you can't log in again for another 4:42 minutes", I'd go medium ballistic.

You can say things with PAM like "no more than 20 times in an hour" which would make the average three minutes, but would allow for much more frequent checking on a short-term basis if they were only checking say, once every 10 minutes normally.

It depends on your situation. If you're an ISP and these are paying customers, try hard to figure out a way to let them do what they want. You'll make a lot more money. (Practical suggestion. Get more ram - a lot more, all the machine will hold. If the directory information for mail is cached in ram, it takes a lot less time (cpu time as well as clock time) to access it and complete the transaction.)

If, on the other hand, you've put this server up for free and this is a bunch of freeloaders whom you would just as soon went away, you can afford to be lot more draconian.

Hope this helps,

CHL

Synapse-lk 10-02-2003 11:03 PM

Thanks for the advice clacour, I will surely be checking into PAM a little bit more now.

You're right that for most intents and purposes checking mail is low-intensity, but where I work (I'm a sys admin for a highly technology based firm) is kind of a special case. We have under 100 employees, but we generate a MASSIVE amount of email. I mean massive! :) To help with the load, as well for other reasons beyond the scope of this thread, we split up the email service from one machine that was handling incoming and outgoing mail to 2. One of these handles outgoing mail and one handles incoming mail, spam/virus checking, and runs the pop services. Spam checking and pop logins are where the real strain on the machine comes from, sendmail alone is pretty efficient.

As for the machine itself its a dual cpu Athlon MP1800+ with 2GB of RAM, which is currently doing ok with the load that is on it. Things do get pretty bogged down though when a lot of activity starts up. A large majority of our email is generated by applications, so if there is a flurry of events in our business these scripts can generate a lot of messages in a very short time. To combat this some I wanted to use time restrictions to cut down on the average load on the machine so that these peaks wouldn't be such a problem.... something 2 minutes would be fine for me, 1 minute between updates is a bit much though. :)

Anyway, I'm babbling about stuff I'm sure you don't want to hear, so thanks for the help!

-Syn


All times are GMT -5. The time now is 01:47 PM.