diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-06-06 12:46:52 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-06-06 12:46:52 +0000 |
commit | 1a7ea88b7e55316cced61eba049fdc21454d84a6 (patch) | |
tree | f4ab91daaa27fee2c2f344d6ea76eafc2eea3b1b | |
parent | 0362b22ca1496d15159f7de31252a9a3168e2640 (diff) | |
download | mailfromd-1a7ea88b7e55316cced61eba049fdc21454d84a6.tar.gz mailfromd-1a7ea88b7e55316cced61eba049fdc21454d84a6.tar.bz2 |
(action_failure_default): Changed to return:reject
(SMTP_MAJOR): New macro
(check_on_host): Use SMTP_MAJOR
git-svn-id: file:///svnroot/mailfromd/trunk@50 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | src/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -142,7 +142,7 @@ union action_data action_success_data; action_fp action_failure; union action_data action_failure_data; -#define action_failure_default "return:accept" +#define action_failure_default "return:reject" #define action_failure_map MAP(SMFIS_ACCEPT)|MAP(SMFIS_CONTINUE)|\ MAP(SMFIS_DISCARD)|MAP(SMFIS_REJECT) @@ -421,6 +421,8 @@ action_add(SMFICTX *ctx, union action_data *data) /* SMTP I/O functions */ +#define SMTP_MAJOR(c) ((c)/100) + struct smtp_io_data { SMFICTX *ctx; /* Milter context */ stream_t stream; /* I/O stream */ @@ -722,17 +724,18 @@ check_on_host(SMFICTX *ctx, char *email, char *client_addr) break; } smtp_send2(&io, "HELO ", smtp_domain); - if (smtp_recv(&io) || io.code != 250) { + if (smtp_recv(&io) || SMTP_MAJOR(io.code) != 2) { status = getmx_not_found; break; } smtp_send3(&io, "MAIL FROM: <", postmaster_email, ">"); - if (smtp_recv(&io) || io.code != 250) { + if (smtp_recv(&io) || SMTP_MAJOR(io.code) != 2) { status = getmx_not_found; break; } smtp_send3(&io, "RCPT TO: <", email, ">"); - if (smtp_recv(&io) || (io.code != 250 && io.code / 100 != 4)) { + if (smtp_recv(&io) + || (SMTP_MAJOR(io.code) != 2 && SMTP_MAJOR(io.code) != 4)) { status = getmx_not_found; break; } |