22static char strnum[FMT_ULONG];
40static void logs(
char *s) {
if (buffer_puts(&
bo2,s) == -1)
_exit(1); }
43static void logm(
char *s) {
logs(
" F:");
logs(s); }
44static void logt(
char *s) {
logs(
" T:");
logs(s); }
45static void logi(
char *s) {
logs(
" '");
logs(s);
logs(
"'"); }
46static void logn(
char *s) {
if (buffer_puts(&
bo2,s) == -1 )
_exit(1);
if (buffer_flush(&
bo2) == -1)
_exit(1); }
49void smtp_loga(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8,
char *s9)
51void smtp_logb(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
53void smtp_logg(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
55void smtp_logh(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5)
57void smtp_logi(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8)
59void smtp_logr(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8)
73void err_vrfy() {
out(
"252 send some mail, i'll try my best\r\n"); }
76int err_child() {
out(
"454 problem with child and I can't auth (#4.3.0)\r\n");
return -1; }
77int err_fork() {
out(
"454 child won't start and I can't auth (#4.3.0)\r\n");
return -1; }
78int err_pipe() {
out(
"454 unable to open pipe and I can't auth (#4.3.0)\r\n");
return -1; }
79int err_write() {
out(
"454 unable to write pipe and I can't auth (#4.3.0)\r\n");
return -1; }
81int err_postgl() {
out(
"454 problem with child and I can't greylist (#4.3.0)\r\n");
return -1; }
82int err_forkgl() {
out(
"454 problem with child and I can't greylist (#4.3.0)\r\n");
return -1; }
88 out(
"454 TLS not available due to temporary reason (#5.7.3)\r\n");
91void err_tlsreq(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5)
93 out(
"535 STARTTLS required (#5.7.1)\r\n");
99void err_helo(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8)
101 out(
"550 sorry, invalid HELO/EHLO greeting ");
103 out(
" (#5.7.1)\r\n");
111 out(
"530 Auth not available (#5.7.1)\r\n");
116 out(
"503 you're already authenticated (#5.5.0)\r\n");
120 out(
"503 no auth during mail transaction (#5.5.0)\r\n");
122void err_authfail(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
124 out(
"535 authentication failed (#5.7.1)\r\n");
smtp_logb(s1,s2,s3,s4,s5,s6,s7);
128 out(
"535 authentication required (#5.7.1)\r\n");
smtp_logh(s1,s2,s3,s4,s5);
132 out(
"530 Authorization required (#5.7.1) \r\n");
smtp_logh(s1,s2,s3,s4,s5);
136 out(
"501 auth exchange canceled (#5.0.0)\r\n");
141 out(
"501 malformed auth input (#5.5.4)\r\n");
146 out(
"504 auth type unimplemented (#5.5.1)\r\n");
151 out(
"504 auth type unimplemented (#5.5.1)\r\n");
159void err_mav(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
161 out(
"553 sorry, invalid sender address specified ");
163 out(
" (#5.7.1)\r\n");
166void err_bmf(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8)
168 out(
"553 sorry, your envelope sender is in my badmailfrom list ");
170 out(
" (#5.7.1)\r\n");
173void err_mfdns(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
175 out(
"553 sorry, your envelope sender must exist ");
177 out(
" (#5.7.1)\r\n");
183void err_spf(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *
msg)
186 int len = str_len(
msg);
188 for (i = 0; i < len; i =
j + 1) {
189 j = byte_chr(
msg + i, len - i,
'\n') + i;
200 out(
" (#5.7.1)\r\n");
209void postgrey(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
211 out(
"421 greylisted");
213 out(
" (#4.3.0)\r\n");
216void err_nogateway(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
218 out(
"553 sorry, that domain isn't in my list of allowed rcpthosts ");
220 out(
" (#5.7.1)\r\n");
223void err_brt(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
225 out(
"553 sorry, your envelope recipient is in my badrcptto list ");
227 out(
" (#5.7.1)\r\n");
230void err_rcpts(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
232 out(
"452 sorry, too many recipients (#4.5.3)\r\n");
235void err_recipient(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
237 if (env_get(
"RECIPIENTS450"))
238 out(
"450 sorry, mailbox currently unavailable (#4.2.1)\r\n");
240 out(
"550 sorry, no mailbox by that name ");
250 out(
"451 Bare Line Feeds (LF) are not accepted in SMTP; CRLF is required according to RFC 2822.\r\n");
256 out(
"503 DATA command not accepted at this time (#5.5.1)\r\n");
260void err_size(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7)
262 out(
"552 sorry, that message size exceeds my databytes limit (#5.3.4)\r\n");
265void err_data(
char *s1,
char *s2,
char *s3,
char *s4,
char *s5,
char *s6,
char *s7,
char *s8)
267 out(
"554 sorry, invalid message content ");
269 out(
" (#5.3.2)\r\n");
void smtp_logh(char *s1, char *s2, char *s3, char *s4, char *s5)
void err_mav(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_recipient(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void smtp_logg(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void postgrey(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_helo(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8)
void err_submission(char *s1, char *s2, char *s3, char *s4, char *s5)
void err_authinvalid(char *s1, char *s2, char *s3, char *s4, char *s5)
void err_authsetup(char *s1, char *s2, char *s3, char *s4, char *s5)
void smtp_logr(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8)
void err_authfail(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_rcpts(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_spf(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *msg)
void err_tlsreq(char *s1, char *s2, char *s3, char *s4, char *s5)
void smtp_loga(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9)
void err_bmf(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8)
void err_authreq(char *s1, char *s2, char *s3, char *s4, char *s5)
void smtp_logi(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8)
void err_mfdns(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_size(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_nogateway(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void smtp_logb(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)
void err_data(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8)
void err_brt(char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7)