36 static bool rule2reply(SMFICTX *,
char *,
char *,
size_t,
char *,
45 {
"NO_PEER_HOSTNAME",
"*** No peer hostname when connecting"},
47 "*** A suspicious file (executable code) was found in the message!"},
48 {
"NO_FROM_HEADER",
"*** There is no From: header field"},
49 {
"NO_RCPT_HEADER",
"*** There is no To, CC or Bcc header field"},
50 {
"NO_SUBJECT_HEADER",
"*** There is no Subject Header"},
51 {
"NO_HEADERS",
"*** There are no headers..."},
52 {
"INTRANET_USER",
"*** Mail to intranet user from outside world..."},
53 {
"LOCAL_USER",
"*** %s can receive mail only from local network"},
54 {
"BINARY_MESSAGE",
"*** Trying a buffer overflow ??? - Let's discard it! "},
55 {
"VIRUS",
"*** A virus was detected in your message"},
56 {
"POLICY",
"*** This message violates our policy"},
57 {
"TOO_MUCH_RCPT",
"*** Too many recipients for this message"},
58 {
"RESOLVE_FAIL",
"*** RESOLVE : mail gateway DNS lookup failed"},
59 {
"RESOLVE_FORGED",
"*** RESOLVE : mail gateway hostname seems to be forged"},
60 {
"TOO_MUCH_EMPTY_CONN",
"*** Too many empty connections"},
61 {
"TOO_MUCH_BADRCPT",
"*** Harvesting ???"},
62 {
"TOO_MUCH_OPEN_CONN",
"*** Too many open connections"},
63 {
"THROTTLE_EXCEEDED",
"*** CONN THROTTLE : too high"},
64 {
"RCPT_THROTTLE_EXCEEDED",
"*** RCPT THROTTLE : too high"},
65 {
"FROM_CONTENTS",
"*** From: contents violates our site policy"},
66 {
"SUBJECT_CONTENTS",
"*** Subject: contents violates our site policy"},
67 {
"HEADERS_CONTENTS",
"*** Header contents violates our site policy"},
69 "*** Sorry, this server is configured to refuse that is indistinguishable from spam"},
70 {
"HELO_CONTENTS",
"*** HELO contents : strange!!!"},
71 {
"TEXT_NOT_ALLOWED",
"*** Message contents violate our site policy"},
72 {
"ENCODED_BODY",
"*** We don't accept encoded messages"},
73 {
"BODY_ENCODED_BINARY",
"*** No BINARY messages!"},
74 {
"BODY_ENCODED_BASE64",
"*** No BASE 64 messages!"},
75 {
"BODY_ENCODED_QP",
"*** No QUOTED PRINTABLE messages!"},
76 {
"BAD_NULL_SENDER",
"*** Bad NULL sender"},
89 while (p->
code != NULL) {
119 char *sin = NULL, *sout = NULL;
125 sin = reply_code2msg(
code);
131 && rule2reply(ctx, b_out, b_in,
sizeof (b_out), attr, value)) {
135 sout =
"*** Unknown error";
150 rule2reply(ctx, out, in, sz, attr, value)
162 if (in == NULL || out == NULL)
170 while ((sz > 0) &&
zeStrRegex(p,
"__[A-Z0-9_]+__", &pi, &pf,
TRUE)) {
186 if ((attr != NULL) && (strlen(attr) > 0)
187 && (strncasecmp(p, attr, strlen(attr)) == 0)) {
198 if (strncasecmp(p, tag, strlen(tag)) == 0) {
205 if (strncasecmp(p, tag, strlen(tag)) == 0) {
211 tag =
"__CLNT_ADDR__";
212 if (strncasecmp(p, tag, strlen(tag)) == 0) {
230 tag =
"__CLNT_NAME__";
231 if (strncasecmp(p, tag, strlen(tag)) == 0) {
238 if (strncasecmp(p, tag, strlen(tag)) == 0) {
245 if (strncasecmp(p, tag, strlen(tag)) == 0) {
bool get_reply_msg(SMFICTX *ctx, char *code, char *msg, size_t sz, char *attr, char *value)
bool zeStrRegex(char *, char *, long *, long *, bool)
bool db_policy_check(char *prefix, char *key, char *bufout, size_t szbuf)
int zeSafeStrnCpy(char *, size_t, char *, size_t)
int zeSafeStrnCat(char *, size_t, char *, size_t)
#define ZE_LogMsgWarning(level,...)
struct replymsg_T replymsg_T