37#define WHO "ezmlm-clean"
65static void die_usage() {
logmsg(
WHO,100,USAGE,
"ezmlm-clean [-mMrRvV] dir"); }
84char strnum[FMT_ULONG];
88stralloc outhost = {0};
89stralloc outlocal = {0};
138 buffer_init(&bt,buffer_unixread,
fd,textbuf,
sizeof(textbuf));
142 if (!case_startb(line.s,line.len,
"return-path:"))
die_read();
143 x = 12 + byte_chr(line.s + 12,line.len-12,
'<');
144 y = byte_rchr(line.s + x,line.len-x,
'>');
145 if (x != line.len && x+y != line.len) {
146 if (!stralloc_copyb(&
to,line.s+x+1, y-1))
die_nomem();
190 if (seek_begin(
fd) == -1)
193 buffer_init(&bt,buffer_unixread,
fd,textbuf,
sizeof(textbuf));
199 if (!stralloc_copy(&line,&outlocal))
die_nomem();
200 if (!stralloc_cats(&line,
"-return-@"))
die_nomem();
201 if (!stralloc_cat(&line,&outhost))
die_nomem();
244 moddir = opendir(dirname);
248 while ((d = readdir(
moddir))) {
249 if (d->d_name[0] ==
'.')
continue;
250 scan_ulong(d->d_name,&
modtime);
255 if ((stat(
fnmsg.s,&st) != -1) && (st.st_mode & 0200)) {
256 if (reply && (st.st_mode & 0100)) {
280 while ((
opt = getoptb(argc,argv,
"mMrRvV")) != opteof)
288 default: die_usage();
292 if (!
dir) die_usage();
294 if (chdir(
dir) == -1)
303 older = (
unsigned long)
when - 3600L * delay;
309 dodir(
"mod/accepted/",0);
310 dodir(
"mod/rejected/",0);
311 dodir(
"mod/unconfirmed/",0);
#define TXT_RETURNED_POST
const char auto_version[]
#define hdr_listsubject1(a)
Error messages. If you translate these, I would urge you to keep the English version as well....
#define ERR_TMP_QMAIL_QUEUE
int lockfile(const char *)
const char * qmail_close(struct qmail *)
void qmail_puts(struct qmail *, const char *)
void qmail_put(struct qmail *, const char *, int)
void qmail_from(struct qmail *, const char *)
void qmail_to(struct qmail *, const char *)
unsigned long qmail_qp(struct qmail *)
int qmail_open(struct qmail *, const stralloc *)
charset, outhost, outlocal and flagcd are shared
int getconf_line(stralloc *sa, const char *fn, int flagrequired, const char *dir)
void ezcopy(struct qmail *qqp, const char *fn, char q)
void set_cpoutlocal(const stralloc *ln)
void set_cpouthost(const stralloc *ln)
void hdr_from(const char *append)
void hdr_boundary(int last)
void hdr_datemsgid(unsigned long when)
ssize_t qqwrite(int fd, char *buf, unsigned int len)
void dodir(char *dirname, int reply)
parses file names in directory 'dirname'.
void hdr_transferenc(void)
void hdr_add2(const char *start, const char *value, unsigned int len)
void hdr_add2s(const char *start, const char *value)
void encode_b64(const unsigned char *indata, unsigned int n, stralloc *outdata, int control)
void hdr_ctype(enum ctype ctype)
void hdr_mime(enum ctype ctype)
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)