Jeff Koch wrote:


We have users that have their email clients set to check for new mail every minute. We ask them to check no more than once every 15 minutes but they don't listen. We are hitting close to 10K pop sessions/hour at peak and it is killing the server. Is there anything we can do to prevent them from popping so frequently? A patch maybe or a config entry?

Remember, you asked for it... use at your own risk. Be sure to warn your help desk about what is happening.


Some users will want your head on a platter because now they can't login without waiting at least ten minutes between connections. :) They will never receive mail if they keep checking too often! Each early login resets the ten minute timer and they have to wait that much longer. The only way to retrieve mail is to wait the entire time. The wait is set to 10 minutes with the expression ( 10 * 60 ) which returns the number of seconds required between mail checks.

People who follow the rules and check no more often than 15 minutes will not see any difference.


In vchkpw.c


find the start of login_virtual_user() about line 388.

void login_virtual_user()


Add a new variable just below it

  time_t last_time;


Now search for 'lastauth' about line 528. You should find:

#ifdef ENABLE_AUTH_LOGGING
  vset_lastauth(TheUser,TheDomain,IpAddr);
#endif


Change it to:

#ifdef ENABLE_AUTH_LOGGING
  last_time = vget_lastauth(vpw,TheDomain);
  vset_lastauth(TheUser,TheDomain,IpAddr);
  if(( vget_lastauth(vpw,TheDomain) - last_time ) < ( 10 * 60 )) {
    vchkpw_exit(3);
  }
#endif

Recomile and install.

I did not actually test this, but it is pretty simple and should work. As always, backup the vchkpw program before you try this. Test during off hours before using in production.


Note: Authentication logging is required for this to work.



Reply via email to