Пример #1
0
static struct option options[] = {
  OPT_COPY_FLAG(sendopt,'c'),
  OPT_COPY_FLAG(sendopt,'C'),
  OPT_COPY_FLAG(sendopt,'r'),
  OPT_COPY_FLAG(sendopt,'R'),
  OPT_COPY_FLAG(sendopt,'Q'),
  OPT_COPY_FLAG(storeopt,'m'),
  OPT_COPY_FLAG(storeopt,'M'),
  OPT_COPY_FLAG(storeopt,'p'),
  OPT_COPY_FLAG(storeopt,'P'),
  OPT_COPY_FLAG(storeopt,'s'),
  OPT_COPY_FLAG(storeopt,'S'),
  OPT_COPY_FLAG(storeopt,'y'),
  OPT_COPY_FLAG(storeopt,'Y'),
  OPT_CSTR(queryext,'q',0),
  OPT_FLAG(dontact,'0',1,0),
  OPT_END
};

static int mailprog(const char *s)
{
    int r;
    int child;

    if ((child = wrap_fork()) == 0)
      wrap_execsh(s);
    /* parent */
    switch((r = wrap_waitpid(child))) {
      /* 100 perm error, 111 temp, 99 dom ok */
      /* 0 rec ok, others bounce */
Пример #2
0
static const char *flagt = 0;
static const char *flagw = 0;
static unsigned long deltah = 24L;	/* default interval 24h */
static int flagconfig = 0;
static int flagdelete = 0;
static int flaglist = 0;

static struct option options[] = {
  OPT_FLAG(flagconfig,'c',1,0),
  OPT_FLAG(flagconfig,'C',0,0),
  OPT_FLAG(flagdelete,'d',1,0),
  OPT_FLAG(flagdelete,'D',0,0),
  OPT_ULONG(deltah,'i',0),
  OPT_FLAG(flaglist,'l',1,0),
  OPT_FLAG(flaglist,'L',0,0),
  OPT_CSTR(flagt,'t',0),
  OPT_CSTR(flagw,'w',0),
  OPT_END
};

static void die_syntax(stralloc *line)
{
  if (!stralloc_0(line)) die_nomem();
  strerr_die4x(100,FATAL,MSG1(ERR_SYNTAX,TXT_EZCRONRC),": ",line->s);
}

static void die_argument(void)
{
  strerr_die2x(100,FATAL,MSG(ERR_NOT_CLEAN));
}
Пример #3
0
const char USAGE[] =
"ezmlm-moderate: usage: ezmlm-moderate [-cCmMrRvV] [-t replyto] dir [/path/ezmlm-send]";

static const char *replyto = (char *) 0;
static int flagmime = MOD_MIME;	/* default is message as attachment */

static stralloc sendopt = {0};

static struct option options[] = {
  OPT_COPY_FLAG(sendopt,'c'),
  OPT_COPY_FLAG(sendopt,'C'),
  OPT_COPY_FLAG(sendopt,'r'),
  OPT_COPY_FLAG(sendopt,'R'),
  OPT_FLAG(flagmime,'m',1,0),
  OPT_FLAG(flagmime,'M',0,0),
  OPT_CSTR(replyto,'t',0),
  OPT_CSTR(replyto,'T',0),
  OPT_END
};

stralloc mydtline = {0};
stralloc accept = {0};
stralloc reject = {0};
stralloc to = {0};
stralloc send = {0};
stralloc comment = {0};
datetime_sec when;

char strnum[FMT_ULONG];
char hash[COOKIE];
char boundary[COOKIE];
Пример #4
0
		"from\\to\\subject\\reply-to\\date\\message-id\\cc\\"
		"mime-version\\content-type\\content-transfer-encoding";
int flagarchived;		/* if list is archived */
int flagindexed;		/* if list is indexed */
const char *flagformat = 0;

const char FATAL[] = "ezmlm-get: fatal: ";
const char USAGE[] =
"ezmlm-get: usage: ezmlm-get [-bBcClLpPsSvV] [-f fmt] [digestcode]";

static struct option options[] = {
  OPT_FLAG(flagbottom,'b',1,0),	/* add text/bottom (default) */
  OPT_FLAG(flagbottom,'B',0,0),	/* suppress text/bottom */
  OPT_FLAG(flagdo,'c',1,0),	/* do commands */
  OPT_FLAG(flagdo,'C',0,0),	/* ignore commands X dig */
  OPT_CSTR(flagformat,'f',"digformat"),
  OPT_FLAG(flagpublic,'p',1,0), /* always public */
  OPT_FLAG(flagpublic,'P',0,0),	/* never public = only mods do cmd */
  OPT_FLAG(flagsubonly,'s',1,"subgetonly"), /* only subs have archive access */
  OPT_FLAG(flagsubonly,'S',0,0), /* everyone has archive access */
  OPT_FLAG(flagindexed,0,1,"indexed"),
  OPT_FLAG(flagarchived,0,1,"archived"),
  OPT_ULONG(copylines,0,"copylines"),
  OPT_END
};

stralloc listname = {0};
stralloc fn = {0};
stralloc moddir = {0};
stralloc mydtline = {0};
stralloc digheaders = {0};
Пример #5
0
#include "die.h"
#include "idx.h"
#include "config.h"
#include "auto_version.h"

const char FATAL[] = "ezmlm-list: fatal: ";
const char USAGE[] =
"ezmlm-list: usage: ezmlm-list [-mMnNvV] dir [subdir]";

static int flagnumber = 0; /* default list subscribers, not number of */
static const char *flagsubdb = 0;

static struct option options[] = {
  OPT_CSTR_FLAG(flagsubdb,'m',0,0),
  OPT_CSTR_FLAG(flagsubdb,'M',"std",0),
  OPT_CSTR(flagsubdb,'S',0),
  OPT_FLAG(flagnumber,'n',1,0),
  OPT_FLAG(flagnumber,'N',0,0),
  OPT_END
};

static void die_write(void)
{
  strerr_die2sys(111,FATAL,MSG(ERR_WRITE_STDOUT));
}

static int subwrite(const char *s,unsigned int l)
{
  return substdio_put(subfdout,s,l) | substdio_put(subfdout,"\n",1);
}