diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-07-11 07:53:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-07-11 07:53:38 +0000 |
commit | 38a32f6ee6992ebdb8c7dbfe2f69919581c0a599 (patch) | |
tree | 5a8ee1f3b273bd03d1b0a9acd4fd14d14a4dac0b /main/gross/gross-grey_tuple.patch | |
parent | 4fe57a7b7e55c13493cbebfe555cfbccc750b8ee (diff) | |
download | aports-38a32f6ee6992ebdb8c7dbfe2f69919581c0a599.tar.bz2 aports-38a32f6ee6992ebdb8c7dbfe2f69919581c0a599.tar.xz |
main/gross: fix the grey_tuple patch
Diffstat (limited to 'main/gross/gross-grey_tuple.patch')
-rw-r--r-- | main/gross/gross-grey_tuple.patch | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/main/gross/gross-grey_tuple.patch b/main/gross/gross-grey_tuple.patch index 581e0064d2..ea80f1996c 100644 --- a/main/gross/gross-grey_tuple.patch +++ b/main/gross/gross-grey_tuple.patch @@ -6,7 +6,7 @@ Index: include/conf.h "stat_type", "status", \ "grey_mask", "24", \ "grey_delay", "10", \ -+ "grey_type", "normal", \ ++ "grey_tuple", "user", \ "syslog_facility", "mail", \ "blocker_port", "4466", \ "blocker_weight", "1", \ @@ -14,7 +14,7 @@ Index: include/conf.h "log_level", \ "grey_mask", \ "grey_delay", \ -+ "grey_type", \ ++ "grey_tuple", \ "check", \ "protocol", \ "syslog_facility", \ @@ -28,8 +28,8 @@ Index: include/common.h +typedef enum +{ -+ GREY_TUPLE_NORMAL = 0, -+ GREY_TUPLE_LOOSE, ++ GREY_TUPLE_USER = 0, ++ GREY_TUPLE_SERVER, +} greytupletype_t; + typedef struct peer_s @@ -61,12 +61,12 @@ Index: src/gross.c } + greytuplestr = CONF("grey_tuple"); -+ if (strncmp(greytuplestr, "loose", 6) == 0) { -+ logstr(GLOG_DEBUG, "grey_tuple: LOOSE"); -+ ctx->config.grey_tuple = GREY_TUPLE_LOOSE; -+ } else if ((greytuplestr == NULL) || (strncmp(greytuplestr, "normal", 7) == 0)) { -+ logstr(GLOG_DEBUG, "grey_tuple: NORMAL"); -+ ctx->config.grey_tuple = GREY_TUPLE_NORMAL; ++ if ((greytuplestr == NULL) || (strcmp(greytuplestr, "user") == 0)) { ++ logstr(GLOG_DEBUG, "grey_tuple: USER"); ++ ctx->config.grey_tuple = GREY_TUPLE_USER; ++ } else if (strcmp(greytuplestr, "server") == 0) { ++ logstr(GLOG_DEBUG, "grey_tuple: SERVER"); ++ ctx->config.grey_tuple = GREY_TUPLE_SERVER; + } else { + daemon_shutdown(EXIT_CONFIG, "Invalid grey_tuple: %s", greytuplestr); + } @@ -99,10 +99,10 @@ Index: src/worker.c /* greylist */ - snprintf(maskedtuple, MSGSZ, "%s %s %s", chkipstr, request->sender, request->recipient); + switch (ctx->config.grey_tuple) { -+ case GREY_TUPLE_NORMAL: ++ case GREY_TUPLE_USER: + snprintf(maskedtuple, MSGSZ, "%s %s %s", chkipstr, request->sender, request->recipient); + break; -+ case GREY_TUPLE_LOOSE: ++ case GREY_TUPLE_SERVER: + snprintf(maskedtuple, MSGSZ, "%s %s %s", chkipstr, domain_part(request->sender), request->helo_name); + break; + } @@ -118,9 +118,9 @@ Index: doc/examples/grossd.conf # DEFAULT: update = grey +# 'grey_tuple' is the way greylisting tuples are created. Valid options are -+# 'normal' and 'loose'. If 'grey_tuple = normal' the tuple for grey listing ++# 'normal' and 'loose'. If 'grey_tuple = user' the tuple for grey listing +# will be: masked client-ip, sender email, recipient email. If 'grey_tuple = -+# loose' the tuple for greylisting will be client-ip, domain of sender email ++# server' the tuple for greylisting will be client-ip, domain of sender email +# and helo. +# DEFAULT: grey_tuple = normal + @@ -136,10 +136,10 @@ Index: man/grossd.conf.5.in `\s-1STATUS_GREY\s+1'. Setting it to `always' may reduce the impact on \s-1DNS\s+1 servers. +.IP "\fBgrey_tuple\fP" 4 -+is the greylisting tuple. Valid options are `normal' and `loose'. If set to -+`normal', which is the default, \fIgrossd\fP\|(8) will create the tuple from ++is the greylisting tuple. Valid options are `user' and `server'. If set to ++`user', which is the default, \fIgrossd\fP\|(8) will create the tuple from +the masked `smtp\-client\-ip', sender email and recipient email. If set to -+`loose' it will create the tuple from the masked `smtp\-client\-ip', the sender ++`server' it will create the tuple from the masked `smtp\-client\-ip', the sender +email domain and helo message. .IP "\fBgrey_mask\fP" 4 is the mask for \fIgrossd\fP\|(8) to use when matching the |