diff options
| author | manuel <manuel@mausz.at> | 2013-02-05 23:48:16 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2013-02-05 23:48:16 +0100 |
| commit | b0c5a1bf27516611d34b6b7d56a0376e3c64171b (patch) | |
| tree | 775492f51e62ed7b0dfe1eba75bfd189950c470f /qmail-qmtpd.c | |
| parent | e52f8862b7bd6519055296a9b757259c0fd358d7 (diff) | |
| download | qmail-b0c5a1bf27516611d34b6b7d56a0376e3c64171b.tar.gz qmail-b0c5a1bf27516611d34b6b7d56a0376e3c64171b.tar.bz2 qmail-b0c5a1bf27516611d34b6b7d56a0376e3c64171b.zip | |
[PATCH] realrcptto
Diffstat (limited to 'qmail-qmtpd.c')
| -rw-r--r-- | qmail-qmtpd.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/qmail-qmtpd.c b/qmail-qmtpd.c index df911a6..d772206 100644 --- a/qmail-qmtpd.c +++ b/qmail-qmtpd.c | |||
| @@ -14,6 +14,15 @@ | |||
| 14 | 14 | ||
| 15 | void badproto() { _exit(100); } | 15 | void badproto() { _exit(100); } |
| 16 | void resources() { _exit(111); } | 16 | void resources() { _exit(111); } |
| 17 | void die_nomem() { resources(); } | ||
| 18 | void die_control() { resources(); } | ||
| 19 | void die_cdb() { resources(); } | ||
| 20 | void die_sys() { resources(); } | ||
| 21 | |||
| 22 | extern void realrcptto_init(); | ||
| 23 | extern void realrcptto_start(); | ||
| 24 | extern int realrcptto(); | ||
| 25 | extern int realrcptto_deny(); | ||
| 17 | 26 | ||
| 18 | int safewrite(fd,buf,len) int fd; char *buf; int len; | 27 | int safewrite(fd,buf,len) int fd; char *buf; int len; |
| 19 | { | 28 | { |
| @@ -98,6 +107,8 @@ main() | |||
| 98 | if (rcpthosts_init() == -1) resources(); | 107 | if (rcpthosts_init() == -1) resources(); |
| 99 | relayclient = env_get("RELAYCLIENT"); | 108 | relayclient = env_get("RELAYCLIENT"); |
| 100 | relayclientlen = relayclient ? str_len(relayclient) : 0; | 109 | relayclientlen = relayclient ? str_len(relayclient) : 0; |
| 110 | |||
| 111 | realrcptto_init(); | ||
| 101 | 112 | ||
| 102 | if (control_readint(&databytes,"control/databytes") == -1) resources(); | 113 | if (control_readint(&databytes,"control/databytes") == -1) resources(); |
| 103 | x = env_get("DATABYTES"); | 114 | x = env_get("DATABYTES"); |
| @@ -114,6 +125,7 @@ main() | |||
| 114 | if (!local) local = "unknown"; | 125 | if (!local) local = "unknown"; |
| 115 | 126 | ||
| 116 | for (;;) { | 127 | for (;;) { |
| 128 | realrcptto_start(); | ||
| 117 | if (!stralloc_copys(&failure,"")) resources(); | 129 | if (!stralloc_copys(&failure,"")) resources(); |
| 118 | flagsenderok = 1; | 130 | flagsenderok = 1; |
| 119 | 131 | ||
| @@ -216,6 +228,10 @@ main() | |||
| 216 | case -1: resources(); | 228 | case -1: resources(); |
| 217 | case 0: failure.s[failure.len - 1] = 'D'; | 229 | case 0: failure.s[failure.len - 1] = 'D'; |
| 218 | } | 230 | } |
| 231 | |||
| 232 | if (!failure.s[failure.len - 1]) | ||
| 233 | if (!realrcptto(buf,1)) | ||
| 234 | failure.s[failure.len - 1] = 'D'; | ||
| 219 | 235 | ||
| 220 | if (!failure.s[failure.len - 1]) { | 236 | if (!failure.s[failure.len - 1]) { |
| 221 | qmail_to(&qq,buf); | 237 | qmail_to(&qq,buf); |
| @@ -231,6 +247,7 @@ main() | |||
| 231 | result = qmail_close(&qq); | 247 | result = qmail_close(&qq); |
| 232 | if (!flagsenderok) result = "Dunacceptable sender (#5.1.7)"; | 248 | if (!flagsenderok) result = "Dunacceptable sender (#5.1.7)"; |
| 233 | if (databytes) if (!bytestooverflow) result = "Dsorry, that message size exceeds my databytes limit (#5.3.4)"; | 249 | if (databytes) if (!bytestooverflow) result = "Dsorry, that message size exceeds my databytes limit (#5.3.4)"; |
| 250 | if (!relayclient && realrcptto_deny()) result = "Dsorry, no mailbox here by that name. (#5.1.1)\r\n"; | ||
| 234 | 251 | ||
| 235 | if (*result) | 252 | if (*result) |
| 236 | len = str_len(result); | 253 | len = str_len(result); |
