At 18.36 06/02/2006, you wrote:
Hi, i have a working qmail installation from netqmail and recently
included chkuser (very nice!).
I want to use the CHKUSER_RCPTLIMIT and CHKUSER_WRONGRCPTLIMIT
variables to block spam because they work very nice in my system, but
the problem is that i don't want to apply these limits to the
authenticated clients, so they can send mail with lot of recipients
and even whit wrong recipient so they receive a bounced message. (if
they get an error when sending they just think, o! the server is not
working, lets call the provider). So, i tried whit #define
CHKUSER_SENDER_NOCHECK_VARIABLE "RELAYCLIENT" but it doesn't works. It
only disables sender checking or also the limits? how i can disable
the limits only for authenticated clients? any idea?

Trying to give a practical answer, this what I suggest.

Add in chkuser_settings.h this define
#define CHKUSER_DISABLE_VARIABLE "RELAYCLIENT"
Then, in chkuser.c, add this code within first_time_init() after the following lines:
#if !defined CHKUSER_ALWAYS_ON && defined CHKUSER_STARTING_VARIABLE
        starting_string = env_get (CHKUSER_STARTING_VARIABLE);
        if (starting_string) {
                if (strcasecmp(starting_string, "ALWAYS") == 0) {
                        starting_value = 1;
                } else if (strcasecmp(starting_string, "DOMAIN") == 0) {
                        starting_value = 0;
                }
        } else {
                starting_string = "";
        }
#endif

+#if defined CHKUSER_EXCLUDE_VARIABLE
+        if (env_get (CHKUSER_EXCLUDE_VARIABLE)) {
+                starting_value = -1;
+        }
+#endif
Note that in order to make CHKUSER_EXCLUDE_VARIABLE working:
CHKUSER_ALWAYS_ON must be commented
CHKUSER_STARTING_VARIABLE must be enabled ("ALWAYS" or "DOMAIN", as you like)
I've not tested this code, as I don't have here shortly a test environment, but it should work.
Please test it if you can.

I'll publish this feature in next chkuser version (and rewrite the code in order to make it more easy and powerful - i.e. to make CHKUSER_EXCLUDE_VARIABLE indipendent from other variables).

Tonino

Thanks in advance
Ion

Reply via email to