24#define WHO "ezmlm-receipt"
34static void die_usage() {
logmsg(
WHO,100,USAGE,
"ezmlm-receipt [-dD] dir"); }
37static void die_trash() {
logmsg(
WHO,0,INFO,
"trash address"); }
61char strnum[FMT_ULONG];
98 bouncedir = opendir(
fndir.s);
106 while (no && (d = readdir(bouncedir))) {
107 if (str_equal(d->d_name,
"."))
continue;
108 if (str_equal(d->d_name,
".."))
continue;
120 if (!stralloc_catb(&
fndate,strnum,fmt_ulong(strnum,(
unsigned long) getpid())))
137 if (buffer_put(&
bo,strnum,fmt_ulong(strnum,
msgnum)) == -1)
174 if (!
dir) die_usage();
178 }
else if (
dir[1] ==
'D') {
183 if (!
dir) die_usage();
185 if (chdir(
dir) == -1)
188 sender = env_get(
"SENDER");
189 def = env_get(
"DEFAULT");
190 local = env_get(
"LOCAL");
199 if (str_len(
local) >= str_len(def) + 14)
200 if (str_start(
local + str_len(
local) - 14 - str_len(def),
"digest-"))
209 if (!stralloc_cats(&outlocal,
"-digest"))
die_nomem();
211 if (!*
action) die_trash();
215 if (!case_diffs(
action,
"receipt")) {
216 host = sender + str_rchr(sender,
'@');
222 cp += str_chr(
cp,
'-');
223 if (case_starts(
cp,
"-return-")) {
225 logmsg(
WHO,100,FATAL,
"bad VERP format for receipt");
239 if (line.len == 1)
break;
240 if (case_startb(line.s,line.len,
TXT_TAG)) {
262 if (*
action !=
'-') die_badaddr();
266 if (getln(&
bi,&line,&
match,
'\n') == -1)
269 if (case_startb(line.s,line.len,
TXT_TAG)) {
277 if (seek_begin(0) == -1)
306 if (getln(&
bi,&line,&
match,
'\n') == -1)
308 if (!
match) die_trash();
310 if (line.len <= 1)
break;
323 if (str_diffn(
paragraph.s,
"Hi. This is the",15)) die_trash();
339 if (i < 3) die_trash();
int quote2(stralloc *sa, const char *s)
Error messages. If you translate these, I would urge you to keep the English version as well....
charset, outhost, outlocal and flagcd are shared
void closesql(void)
close connection to SQL server, if open
int getconf_line(stralloc *sa, const char *fn, int flagrequired, const char *dir)
void doit(char *addr, unsigned long msgnum, unsigned long when, stralloc *bounce)
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
int subreceipt(char *dir, unsigned long msgnum, stralloc *cookie, char *listaddr, int done, char *info, char *fatal)