ezmlmx 0.68
ezmlmx
|
When ezmlm-clean is run, messages and message stubs in pending/rejected/accepted/unconfirmed are erased if they are older than delay hours. More...
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "error.h"
#include "stralloc.h"
#include "str.h"
#include "env.h"
#include "sig.h"
#include "getconf.h"
#include "byte.h"
#include "getln.h"
#include "case.h"
#include "qmail.h"
#include "buffer.h"
#include "readwrite.h"
#include "seek.h"
#include "quote.h"
#include "datetime.h"
#include "now.h"
#include "direntry.h"
#include "cookie.h"
#include "getoptb.h"
#include "fmt.h"
#include "errtxt.h"
#include "ezcopy.h"
#include "open.h"
#include "scan.h"
#include "lock.h"
#include "hdr.h"
#include "idx.h"
#include "mime.h"
#include "auto_version.h"
#include "logmsg.h"
#include "lockfile.h"
#include "ezmlm.h"
Go to the source code of this file.
Macros | |
#define | WHO "ezmlm-clean" |
Functions | |
ssize_t | qqwrite (int fd, char *buf, unsigned int len) |
void | readconfigs () |
void | sendnotice (char *d) |
void | dodir (char *dirname, int reply) |
parses file names in directory 'dirname'. | |
int | main (int argc, char **argv) |
Variables | |
int | flagmime = MOD_MIME |
int | flagreturn = 1 |
char | flagcd = '\0' |
stralloc | fnmsg = {0} |
datetime_sec | when |
unsigned int | older |
char | textbuf [1024] |
buffer | bt |
struct qmail | |
char | outbuf [256] |
buffer | bq = BUFFER_INIT(qqwrite,-1,outbuf,sizeof(outbuf)) |
char * | dir |
char | strnum [FMT_ULONG] |
datetime_sec | hashdate |
char | hboundary [HASHLEN] |
stralloc | outhost = {0} |
stralloc | outlocal = {0} |
stralloc | quoted = {0} |
stralloc | charset = {0} |
stralloc | mailinglist = {0} |
stralloc | listid = {0} |
stralloc | line = {0} |
stralloc | modtime = {0} |
stralloc | to = {0} |
int | flagconf |
int | fd |
int | match |
unsigned long | msgnum = 0 |
When ezmlm-clean is run, messages and message stubs in pending/rejected/accepted/unconfirmed are erased if they are older than delay hours.
Timeouts in h for messages. If modtime has a number, it is made to be in the range DELAY_MIN..DELAY_MAX. If the number is 0 or there is no number, DELAY_DEFAULT is used. Messages that are read-only are ignored. Messages in 'pending' that have the execute bit set result in an informative reply to the poster. Any defects in the message format, inability to open the file, etc, result in a maillog entry whereafter the message is erased.
Definition in file ezmlm-clean.c.
#define WHO "ezmlm-clean" |
Definition at line 37 of file ezmlm-clean.c.
void dodir | ( | char * | dirname, |
int | reply ) |
parses file names in directory 'dirname'.
Files that are not owner writable (w) are ignored. If the files are older (by name!) than now-delay, action is taken: If the owner x bit is not set, the file is erased. If it is set and reply is not set, the file is erased. If both are set, a notice about the timeout is sent to the poster. If this fails due to a message-related error (format, etc) the file is erased even though no notice is sent. For temporary errors (like out-of-memory) the message is left intact for the next run. If the notice is sent successfully, the file is erased. All this is to do the best possible without risking a rerun of the .qmail file, which could result in a redelivery of the action request and a second (incorrect) reply to the moderator's request. NOTE: ALL non-hidden files in this dir are processed and mercilessly deleted. No checks for proper file name. E.g. 'HELLO' => time 0 => will be deleted on the next ezmlm-clean run.
Definition at line 237 of file ezmlm-clean.c.
int main | ( | int | argc, |
char ** | argv ) |
ssize_t qqwrite | ( | int | fd, |
char * | buf, | ||
unsigned int | len ) |
void readconfigs | ( | ) |
Definition at line 112 of file ezmlm-clean.c.
void sendnotice | ( | char * | d | ) |
Definition at line 124 of file ezmlm-clean.c.
Definition at line 81 of file ezmlm-clean.c.
buffer bt |
Definition at line 72 of file ezmlm-clean.c.
stralloc charset = {0} |
Definition at line 91 of file ezmlm-clean.c.
char* dir |
Definition at line 83 of file ezmlm-clean.c.
int fd |
Definition at line 100 of file ezmlm-clean.c.
char flagcd = '\0' |
Definition at line 59 of file ezmlm-clean.c.
int flagconf |
Definition at line 99 of file ezmlm-clean.c.
int flagmime = MOD_MIME |
Definition at line 57 of file ezmlm-clean.c.
int flagreturn = 1 |
Definition at line 58 of file ezmlm-clean.c.
stralloc fnmsg = {0} |
Definition at line 60 of file ezmlm-clean.c.
datetime_sec hashdate |
Definition at line 85 of file ezmlm-clean.c.
char hboundary[HASHLEN] |
Definition at line 86 of file ezmlm-clean.c.
stralloc line = {0} |
Definition at line 95 of file ezmlm-clean.c.
stralloc listid = {0} |
Definition at line 94 of file ezmlm-clean.c.
stralloc mailinglist = {0} |
Definition at line 93 of file ezmlm-clean.c.
int match |
Definition at line 101 of file ezmlm-clean.c.
stralloc modtime = {0} |
Definition at line 96 of file ezmlm-clean.c.
unsigned long msgnum = 0 |
Definition at line 102 of file ezmlm-clean.c.
unsigned int older |
Definition at line 69 of file ezmlm-clean.c.
char outbuf[256] |
Definition at line 80 of file ezmlm-clean.c.
stralloc outhost = {0} |
Definition at line 88 of file ezmlm-clean.c.
stralloc outlocal = {0} |
Definition at line 89 of file ezmlm-clean.c.
struct qmail qq |
Definition at line 73 of file ezmlm-clean.c.
stralloc quoted = {0} |
Definition at line 90 of file ezmlm-clean.c.
char strnum[FMT_ULONG] |
Definition at line 84 of file ezmlm-clean.c.
char textbuf[1024] |
Definition at line 71 of file ezmlm-clean.c.
stralloc to = {0} |
Definition at line 97 of file ezmlm-clean.c.
datetime_sec when |
Definition at line 68 of file ezmlm-clean.c.