11 #define FATAL "ezmlm-unsub: fatal: "
13 void *psql = (void *) 0;
16 substdio ssin = SUBSTDIO_FDBUF(read,0,inbuf,sizeof(inbuf));
23 "ezmlm-unsub: usage: ezmlm-unsub [-h hash] [-HmMnNvV] dir box@domain ...");
35 int flagmysql = 1; /* if there is mysql support, use it! */
43 while ((opt = getopt(argc,argv,"h:HmMnNvV")) != opteof)
45 case 'h': (void) scan_ulong(optarg,&u); forcehash = 0; break;
46 case 'H': forcehash = -1; break;
47 case 'm': flagmysql = 1; break;
48 case 'M': flagmysql = 0; break;
49 case 'n': flagname = 1; break;
50 case 'N': flagname = 0; break;
52 case 'V': strerr_die2x(0,
53 "ezmlm-unsub version: ezmlm-0.53+",EZIDX_VERSION);
59 if (!dir) die_usage();
62 strerr_die2x(100,FATAL,ERR_SLASH);
65 strerr_die4sys(111,FATAL,ERR_SWITCH,dir,": ");
67 if (forcehash == 0) forcehash = (int) u;
70 while ((addr = argv[optind++]))
71 (void) subscribe(dir,addr,0,"","-manual",flagmysql,
72 forcehash,(char *) 0,FATAL);
75 if (getln(&ssin,&line,&match,'\n') == -1)
76 strerr_die2sys(111,FATAL,ERR_READ_INPUT);
78 if (line.len == 1 || *line.s == '#') continue;
79 line.s[line.len - 1] = '\0';
85 } else if (ch == ' ' || ch == '\t' || ch == ',') break;
91 (void) subscribe(dir,line.s,0,"","+manual",flagmysql,
92 forcehash,(char *) 0,FATAL);