21#define WHO "srsreverse"
44static int srserror_str(
int code) {
72 stralloc cookie = {0};
81 logmsg(
WHO,100,FATAL,
"RECIPIENT not set");
82 sender = env_get(
"SENDER");
84 logmsg(
WHO,100,FATAL,
"SENDER not set");
85 dtline = env_get(
"DTLINE");
87 logmsg(
WHO,100,FATAL,
"DTLINE not set");
88 host = env_get(
"HOST");
90 logmsg(
WHO,100,FATAL,
"HOST not set");
104 for (i = 0; i <=
j; ++i)
105 if ((i == 0) || (
host[i] ==
'.')) {
143 if (separator ==
'-' || separator ==
'+' || separator ==
'=') {
148 for (
j = 0, i = 0;
j < cookie.len;
j++) {
149 if (cookie.s[
j] ==
' ' || cookie.s[
j] ==
'\0' ) {
154 if (cookie.s[i] ==
' ') {
j++;
continue; }
161 logmsg(
WHO,99,INFO,B(
"unable to reverse and mail bounced to: ",
sender));
break;
166 logmsg(
WHO,111,FATAL,
"unable to fork: ");
168 if (buffer_copy(&
bo,&
bi) != 0)
169 logmsg(
WHO,111,FATAL,
"unable to read message: ");
177 if (*qqx) logmsg(
WHO,*qqx ==
'D' ? 100 : 111,FATAL,qqx + 1);
178 logmsg(
WHO,0,LOG,B(srsrecipient,
": qp ",
num));
int constmap_init(struct constmap *cm, char *s, int len, int flagcolon)
int control_readfile(stralloc *sa, char *fn, int flagme)
int stralloc_copys(stralloc *, char const *)
void qmail_to(struct qmail *, char *)
void qmail_from(struct qmail *, char *)
void qmail_put(struct qmail *, char *, int)
char * qmail_close(struct qmail *)
unsigned long qmail_qp(struct qmail *)
void qmail_puts(struct qmail *, char *)
int qmail_open(struct qmail *)
int srs_set_separator(srs_t *srs, char value)
int srs_add_secret(srs_t *, const char *)
int srs_reverse(srs_t *, char *, int, const char *)
const char * srs_strerror(int)
#define SRS_ENOTSRSADDRESS
ssize_t mywrite(int fd, char *buf, int len)
struct constmap mapvdomains
char outbuf[BUFSIZE_LINE]
struct constmap mapsrsdomains