ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
ezmlm-clean.c File Reference

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"
Include dependency graph for ezmlm-clean.c:

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 qq
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

Detailed Description

When ezmlm-clean is run, messages and message stubs in pending/rejected/accepted/unconfirmed are erased if they are older than delay hours.

Author
Bruce Guenter
Date
2005-02-09 16:24:15Z

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.

Macro Definition Documentation

◆ WHO

#define WHO   "ezmlm-clean"

Definition at line 37 of file ezmlm-clean.c.

Function Documentation

◆ dodir()

void dodir ( char * dirname,
int reply )

parses file names in directory 'dirname'.

Author
Bruce Guenter
    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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int argc,
char ** argv )

Definition at line 271 of file ezmlm-clean.c.

Here is the call graph for this function:

◆ qqwrite()

ssize_t qqwrite ( int fd,
char * buf,
unsigned int len )

Definition at line 75 of file ezmlm-clean.c.

Here is the call graph for this function:

◆ readconfigs()

void readconfigs ( )

Definition at line 112 of file ezmlm-clean.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendnotice()

void sendnotice ( char * d)

Definition at line 124 of file ezmlm-clean.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ bq

buffer bq = BUFFER_INIT(qqwrite,-1,outbuf,sizeof(outbuf))

Definition at line 81 of file ezmlm-clean.c.

◆ bt

buffer bt

Definition at line 72 of file ezmlm-clean.c.

◆ charset

stralloc charset = {0}

Definition at line 91 of file ezmlm-clean.c.

◆ dir

char* dir

Definition at line 83 of file ezmlm-clean.c.

◆ fd

int fd

Definition at line 100 of file ezmlm-clean.c.

◆ flagcd

char flagcd = '\0'

Definition at line 59 of file ezmlm-clean.c.

◆ flagconf

int flagconf

Definition at line 99 of file ezmlm-clean.c.

◆ flagmime

int flagmime = MOD_MIME

Definition at line 57 of file ezmlm-clean.c.

◆ flagreturn

int flagreturn = 1

Definition at line 58 of file ezmlm-clean.c.

◆ fnmsg

stralloc fnmsg = {0}

Definition at line 60 of file ezmlm-clean.c.

◆ hashdate

datetime_sec hashdate

Definition at line 85 of file ezmlm-clean.c.

◆ hboundary

char hboundary[HASHLEN]

Definition at line 86 of file ezmlm-clean.c.

◆ line

stralloc line = {0}

Definition at line 95 of file ezmlm-clean.c.

◆ listid

stralloc listid = {0}

Definition at line 94 of file ezmlm-clean.c.

◆ mailinglist

stralloc mailinglist = {0}

Definition at line 93 of file ezmlm-clean.c.

◆ match

int match

Definition at line 101 of file ezmlm-clean.c.

◆ modtime

stralloc modtime = {0}

Definition at line 96 of file ezmlm-clean.c.

◆ msgnum

unsigned long msgnum = 0

Definition at line 102 of file ezmlm-clean.c.

◆ older

unsigned int older

Definition at line 69 of file ezmlm-clean.c.

◆ outbuf

char outbuf[256]

Definition at line 80 of file ezmlm-clean.c.

◆ outhost

stralloc outhost = {0}

Definition at line 88 of file ezmlm-clean.c.

◆ outlocal

stralloc outlocal = {0}

Definition at line 89 of file ezmlm-clean.c.

◆ qq

struct qmail qq

Definition at line 73 of file ezmlm-clean.c.

◆ quoted

stralloc quoted = {0}

Definition at line 90 of file ezmlm-clean.c.

◆ strnum

char strnum[FMT_ULONG]

Definition at line 84 of file ezmlm-clean.c.

◆ textbuf

char textbuf[1024]

Definition at line 71 of file ezmlm-clean.c.

◆ to

stralloc to = {0}

Definition at line 97 of file ezmlm-clean.c.

◆ when

Definition at line 68 of file ezmlm-clean.c.