]> Pileus Git - ~andy/fetchmail/blob - options.c
This preliminary SSL patch goes to Mike.
[~andy/fetchmail] / options.c
1 /*
2  * options.c -- command-line option processing
3  *
4  * Copyright 1998 by Eric S. Raymond.
5  * For license terms, see the file COPYING in this directory.
6  */
7
8 #include "config.h"
9
10 #include <stdio.h>
11 #include <pwd.h>
12 #include <string.h>
13 #include <errno.h>
14 #if defined(STDC_HEADERS)
15 #include  <stdlib.h>
16 #include  <limits.h>
17 #else
18 #include  <ctype.h>
19 #endif
20
21 #include "getopt.h"
22 #include "fetchmail.h"
23 #include "i18n.h"
24
25 #define LA_HELP         1
26 #define LA_VERSION      2 
27 #define LA_CHECK        3
28 #define LA_SILENT       4 
29 #define LA_VERBOSE      5 
30 #define LA_DAEMON       6
31 #define LA_NODETACH     7
32 #define LA_QUIT         8
33 #define LA_LOGFILE      9
34 #define LA_INVISIBLE    10
35 #define LA_SYSLOG       11
36 #define LA_NOSYSLOG     12
37 #define LA_RCFILE       13
38 #define LA_IDFILE       14
39 #define LA_POSTMASTER   15
40 #define LA_NOBOUNCE     16
41 #define LA_PROTOCOL     17
42 #define LA_UIDL         18
43 #define LA_PORT         19
44 #define LA_PREAUTH      20
45 #define LA_TIMEOUT      21
46 #define LA_ENVELOPE     22
47 #define LA_QVIRTUAL     23
48 #define LA_USERNAME     24
49 #define LA_ALL          25
50 #define LA_NOKEEP       26
51 #define LA_KEEP         27
52 #define LA_FLUSH        28
53 #define LA_NOREWRITE    29
54 #define LA_LIMIT        30
55 #define LA_WARNINGS     31
56 #define LA_FOLDER       32
57 #define LA_SMTPHOST     33
58 #define LA_SMTPADDR     34
59 #define LA_ANTISPAM     35
60 #define LA_BATCHLIMIT   36
61 #define LA_FETCHLIMIT   37
62 #define LA_EXPUNGE      38
63 #define LA_MDA          39
64 #define LA_BSMTP        40
65 #define LA_LMTP         41
66 #define LA_PLUGIN       42
67 #define LA_PLUGOUT      43
68 #define LA_NETSEC       44
69 #define LA_INTERFACE    45
70 #define LA_MONITOR      46
71 #define LA_CONFIGDUMP   47
72 #define LA_YYDEBUG      48
73
74 #ifdef SSL_ENABLE
75 #define LA_SSL          49
76 #define LA_SSLKEY       50
77 #define LA_SSLCERT      51
78 #endif
79
80 /* options still left: CDgGhHjJoORwWxXYz */
81 static const char *shortoptions = 
82         "?Vcsvd:NqL:f:i:p:UP:A:t:E:Q:u:akKFnl:r:S:Z:b:B:e:m:T:I:M:yw:";
83
84 static const struct option longoptions[] = {
85 /* this can be const because all flag fields are 0 and will never get set */
86   {"help",      no_argument,       (int *) 0, LA_HELP        },
87   {"version",   no_argument,       (int *) 0, LA_VERSION     },
88   {"check",     no_argument,       (int *) 0, LA_CHECK       },
89   {"silent",    no_argument,       (int *) 0, LA_SILENT      },
90   {"verbose",   no_argument,       (int *) 0, LA_VERBOSE     },
91   {"daemon",    required_argument, (int *) 0, LA_DAEMON      },
92   {"nodetach",  no_argument,       (int *) 0, LA_NODETACH    },
93   {"quit",      no_argument,       (int *) 0, LA_QUIT        },
94   {"logfile",   required_argument, (int *) 0, LA_LOGFILE     },
95   {"invisible", no_argument,       (int *) 0, LA_INVISIBLE   },
96   {"syslog",    no_argument,       (int *) 0, LA_SYSLOG      },
97   {"nosyslog",  no_argument,       (int *) 0, LA_NOSYSLOG    },
98   {"fetchmailrc",required_argument,(int *) 0, LA_RCFILE      },
99   {"idfile",    required_argument, (int *) 0, LA_IDFILE      },
100   {"postmaster",required_argument, (int *) 0, LA_POSTMASTER  },
101   {"nobounce",  no_argument,       (int *) 0, LA_NOBOUNCE    },
102
103   {"protocol",  required_argument, (int *) 0, LA_PROTOCOL    },
104   {"proto",     required_argument, (int *) 0, LA_PROTOCOL    },
105   {"uidl",      no_argument,       (int *) 0, LA_UIDL        },
106   {"port",      required_argument, (int *) 0, LA_PORT        },
107   {"preauth",   required_argument, (int *) 0, LA_PREAUTH},
108   {"timeout",   required_argument, (int *) 0, LA_TIMEOUT     },
109   {"envelope",  required_argument, (int *) 0, LA_ENVELOPE    },
110   {"qvirtual",  required_argument, (int *) 0, LA_QVIRTUAL    },
111
112   {"user",      required_argument, (int *) 0, LA_USERNAME    },
113   {"username",  required_argument, (int *) 0, LA_USERNAME    },
114
115   {"all",       no_argument,       (int *) 0, LA_ALL         },
116   {"nokeep",    no_argument,       (int *) 0, LA_NOKEEP      },
117   {"keep",      no_argument,       (int *) 0, LA_KEEP        },
118   {"flush",     no_argument,       (int *) 0, LA_FLUSH       },
119   {"norewrite", no_argument,       (int *) 0, LA_NOREWRITE   },
120   {"limit",     required_argument, (int *) 0, LA_LIMIT       },
121   {"warnings",  required_argument, (int *) 0, LA_WARNINGS    },
122
123   {"folder",    required_argument, (int *) 0, LA_FOLDER      },
124   {"smtphost",  required_argument, (int *) 0, LA_SMTPHOST    },
125   {"smtpaddress", required_argument, (int *) 0, LA_SMTPADDR  },
126   {"antispam",  required_argument, (int *) 0, LA_ANTISPAM    },
127   
128   {"batchlimit",required_argument, (int *) 0, LA_BATCHLIMIT  },
129   {"fetchlimit",required_argument, (int *) 0, LA_FETCHLIMIT  },
130   {"expunge",   required_argument, (int *) 0, LA_EXPUNGE     },
131   {"mda",       required_argument, (int *) 0, LA_MDA         },
132   {"bsmtp",     required_argument, (int *) 0, LA_BSMTP       },
133   {"lmtp",      no_argument,       (int *) 0, LA_LMTP        },
134
135 #ifdef INET6
136   {"netsec",    required_argument, (int *) 0, LA_NETSEC      },
137 #endif /* INET6 */
138
139 #ifdef SSL_ENABLE
140   {"ssl",       no_argument,       (int *) 0, LA_SSL        },
141   {"sslkey",    required_argument, (int *) 0, LA_SSLKEY     },
142   {"sslcert",   required_argument, (int *) 0, LA_SSLCERT    },
143 #endif
144
145 #if (defined(linux) && !INET6) || defined(__FreeBSD__)
146   {"interface", required_argument, (int *) 0, LA_INTERFACE   },
147   {"monitor",   required_argument, (int *) 0, LA_MONITOR     },
148 #endif /* (defined(linux) && !INET6) || defined(__FreeBSD__) */
149   {"plugin",    required_argument, (int *) 0, LA_PLUGIN      },
150   {"plugout",   required_argument, (int *) 0, LA_PLUGOUT     },
151
152   {"configdump",no_argument,       (int *) 0, LA_CONFIGDUMP  },
153
154   {"yydebug",   no_argument,       (int *) 0, LA_YYDEBUG     },
155
156   {(char *) 0,  no_argument,       (int *) 0, 0              }
157 };
158
159 static int xatoi(char *s, int *errflagptr)
160 /* do safe conversion from string to number */
161 {
162 #if defined (STDC_HEADERS) && defined (LONG_MAX) && defined (INT_MAX)
163     /* parse and convert numbers, but also check for invalid characters in
164      * numbers
165      */
166
167     char *endptr;
168     long value;
169
170     errno = 0;
171
172     value = strtol(s, &endptr, 0);
173
174     /* any invalid chars in string? */
175     if ( (endptr == s) || (*endptr != '\0') ) {
176         (void) fprintf(stderr, _("String '%s' is not a valid number string.\n"), s);
177         (*errflagptr)++;
178         return 0;
179     }
180
181     /* is the range valid? */
182     if ( (((value == LONG_MAX) || (value == LONG_MIN)) && (errno == ERANGE)) ||
183                                 (value > INT_MAX) || (value < INT_MIN)) {
184
185         (void) fprintf(stderr, _("Value of string '%s' is %s than %d.\n"), s,
186                                         (value < 0) ? _("smaller"): _("larger"),
187                                         (value < 0) ? INT_MIN : INT_MAX);
188         (*errflagptr)++;
189         return 0;
190     }
191
192     return (int) value;  /* shut up, I know what I'm doing */
193 #else
194     int i;
195     char *dp;
196 # if defined (STDC_HEADERS)
197     size_t      len;
198 # else
199     int         len;
200 # endif
201
202     /* We do only base 10 conversions here (atoi)! */
203
204     len = strlen(s);
205     /* check for leading white spaces */
206     for (i = 0; (i < len) && isspace(s[i]); i++)
207         ;
208
209     dp = &s[i];
210
211     /* check for +/- */
212     if (i < len && (s[i] == '+' || s[i] == '-'))        i++;
213
214     /* skip over digits */
215     for ( /* no init */ ; (i < len) && isdigit(s[i]); i++)
216         ;
217
218     /* check for trailing garbage */
219     if (i != len) {
220         (void) fprintf(stderr, _("String '%s' is not a valid number string.\n"), s);
221         (*errflagptr)++;
222         return 0;
223     }
224
225     /* atoi should be safe by now, except for number range over/underflow */
226     return atoi(dp);
227 #endif
228 }
229
230 int parsecmdline (argc, argv, rctl, ctl)
231 /* parse and validate the command line options */
232 int argc;               /* argument count */
233 char **argv;            /* argument strings */
234 struct runctl *rctl;    /* global run controls to modify */
235 struct query *ctl;      /* option record to be initialized */
236 {
237     /*
238      * return value: if positive, argv index of last parsed option + 1
239      * (presumes one or more server names follows).  if zero, the
240      * command line switches are such that no server names are
241      * required (e.g. --version).  if negative, the command line is
242      * has one or more syntax errors.
243      */
244
245     int c;
246     int ocount = 0;     /* count of destinations specified */
247     int errflag = 0;    /* TRUE when a syntax error is detected */
248     int helpflag = 0;   /* TRUE when option help was explicitly requested */
249     int option_index;
250     char *buf, *cp;
251
252     rctl->poll_interval = -1;
253
254     memset(ctl, '\0', sizeof(struct query));    /* start clean */
255     ctl->smtp_socket = -1;
256
257     while (!errflag && 
258            (c = getopt_long(argc,argv,shortoptions,
259                             longoptions,&option_index)) != -1) {
260
261         switch (c) {
262         case 'V':
263         case LA_VERSION:
264             versioninfo = TRUE;
265             break;
266         case 'c':
267         case LA_CHECK:
268             check_only = TRUE;
269             break;
270         case 's':
271         case LA_SILENT:
272             outlevel = O_SILENT;
273             break;
274         case 'v':
275         case LA_VERBOSE:
276             if (outlevel == O_VERBOSE)
277                 outlevel = O_DEBUG;
278             else
279                 outlevel = O_VERBOSE;
280             break;
281         case 'd':
282         case LA_DAEMON:
283             rctl->poll_interval = xatoi(optarg, &errflag);
284             break;
285         case 'N':
286         case LA_NODETACH:
287             nodetach = TRUE;
288             break;
289         case 'q':
290         case LA_QUIT:
291             quitmode = TRUE;
292             break;
293         case 'L':
294         case LA_LOGFILE:
295             rctl->logfile = optarg;
296             break;
297         case LA_INVISIBLE:
298             rctl->invisible = TRUE;
299             break;
300         case 'f':
301         case LA_RCFILE:
302             rcfile = (char *) xmalloc(strlen(optarg)+1);
303             strcpy(rcfile,optarg);
304             break;
305         case 'i':
306         case LA_IDFILE:
307             rctl->idfile = (char *) xmalloc(strlen(optarg)+1);
308             strcpy(rctl->idfile,optarg);
309             break;
310         case LA_POSTMASTER:
311             rctl->postmaster = (char *) xmalloc(strlen(optarg)+1);
312             strcpy(rctl->postmaster,optarg);
313             break;
314         case LA_NOBOUNCE:
315             run.bouncemail = FALSE;
316             break;
317         case 'p':
318         case LA_PROTOCOL:
319             /* XXX -- should probably use a table lookup here */
320             if (strcasecmp(optarg,"auto") == 0)
321                 ctl->server.protocol = P_AUTO;
322             else if (strcasecmp(optarg,"pop2") == 0)
323                 ctl->server.protocol = P_POP2;
324 #ifdef SDPS_ENABLE
325             else if (strcasecmp(optarg,"sdps") == 0)
326             {
327                 ctl->server.protocol = P_POP3; 
328                 ctl->server.sdps = TRUE;
329             }
330 #endif /* SDPS_ENABLE */
331             else if (strcasecmp(optarg,"pop3") == 0)
332                 ctl->server.protocol = P_POP3;
333             else if (strcasecmp(optarg,"apop") == 0)
334                 ctl->server.protocol = P_APOP;
335             else if (strcasecmp(optarg,"rpop") == 0)
336                 ctl->server.protocol = P_RPOP;
337             else if (strcasecmp(optarg,"kpop") == 0)
338             {
339                 ctl->server.protocol = P_POP3;
340 #if INET6
341                 ctl->server.service = KPOP_PORT;
342 #else /* INET6 */
343                 ctl->server.port = KPOP_PORT;
344 #endif /* INET6 */
345 #ifdef KERBEROS_V5
346                 ctl->server.preauthenticate =  A_KERBEROS_V5;
347 #else
348                 ctl->server.preauthenticate =  A_KERBEROS_V4;
349 #endif /* KERBEROS_V5 */
350             }
351             else if (strcasecmp(optarg,"imap") == 0)
352                 ctl->server.protocol = P_IMAP;
353 #ifdef KERBEROS_V4
354             else if (strcasecmp(optarg,"imap-k4") == 0)
355                 ctl->server.protocol = P_IMAP_K4;
356 #endif /* KERBEROS_V4 */
357 #ifdef GSSAPI
358             else if (strcasecmp(optarg, "imap-gss") == 0)
359                 ctl->server.protocol = P_IMAP_GSS;
360 #endif /* GSSAPI */
361             else if (strcasecmp(optarg, "imap-crammd5") == 0)
362                 ctl->server.protocol = P_IMAP_CRAM_MD5;
363             else if (strcasecmp(optarg, "imap-login") == 0)
364                 ctl->server.protocol = P_IMAP_LOGIN;
365             else if (strcasecmp(optarg,"etrn") == 0)
366                 ctl->server.protocol = P_ETRN;
367             else {
368                 fprintf(stderr,_("Invalid protocol `%s' specified.\n"), optarg);
369                 errflag++;
370             }
371             break;
372         case 'U':
373         case LA_UIDL:
374             ctl->server.uidl = FLAG_TRUE;
375             break;
376         case 'P':
377         case LA_PORT:
378 #if INET6
379             ctl->server.service = optarg;
380 #else /* INET6 */
381             ctl->server.port = xatoi(optarg, &errflag);
382 #endif /* INET6 */
383             break;
384         case LA_PREAUTH:
385             if (strcmp(optarg, "password") == 0)
386                 ctl->server.preauthenticate = A_PASSWORD;
387             else if (strcmp(optarg, "kerberos") == 0)
388 #ifdef KERBEROS_V5
389                 ctl->server.preauthenticate = A_KERBEROS_V5;
390 #else
391                 ctl->server.preauthenticate = A_KERBEROS_V4;
392 #endif /* KERBEROS_V5 */
393             else if (strcmp(optarg, "kerberos_v5") == 0)
394                 ctl->server.preauthenticate = A_KERBEROS_V5;
395             else if (strcmp(optarg, "kerberos_v4") == 0)
396                 ctl->server.preauthenticate = A_KERBEROS_V4;
397             else {
398                 fprintf(stderr,_("Invalid preauthentication `%s' specified.\n"), optarg);
399                 errflag++;
400             }
401             break;
402         case 't':
403         case LA_TIMEOUT:
404             ctl->server.timeout = xatoi(optarg, &errflag);
405             if (ctl->server.timeout == 0)
406                 ctl->server.timeout = -1;
407             break;
408         case 'E':
409         case LA_ENVELOPE:
410             ctl->server.envelope = xstrdup(optarg);
411             break;
412         case 'Q':    
413         case LA_QVIRTUAL:
414             ctl->server.qvirtual = xstrdup(optarg);
415             break;
416
417         case 'u':
418         case LA_USERNAME:
419             ctl->remotename = xstrdup(optarg);
420             break;
421         case 'a':
422         case LA_ALL:
423             ctl->fetchall = FLAG_TRUE;
424             break;
425         case 'K':
426         case LA_NOKEEP:
427             ctl->keep = FLAG_FALSE;
428             break;
429         case 'k':
430         case LA_KEEP:
431             ctl->keep = FLAG_TRUE;
432             break;
433         case 'F':
434         case LA_FLUSH:
435             ctl->flush = FLAG_TRUE;
436             break;
437         case 'n':
438         case LA_NOREWRITE:
439             ctl->rewrite = FLAG_FALSE;
440             break;
441         case 'l':
442         case LA_LIMIT:
443             c = xatoi(optarg, &errflag);
444             ctl->limit = NUM_VALUE_IN(c);
445             break;
446         case 'r':
447         case LA_FOLDER:
448             xalloca(buf, char *, strlen(optarg) + 1);
449             strcpy(buf, optarg);
450             cp = strtok(buf, ",");
451             do {
452                 save_str(&ctl->mailboxes, cp, 0);
453             } while
454                 ((cp = strtok((char *)NULL, ",")));
455             break;
456         case 'S':
457         case LA_SMTPHOST:
458             xalloca(buf, char *, strlen(optarg) + 1);
459             strcpy(buf, optarg);
460             cp = strtok(buf, ",");
461             do {
462                 save_str(&ctl->smtphunt, cp, TRUE);
463             } while
464                 ((cp = strtok((char *)NULL, ",")));
465             ocount++;
466             break;
467         case 'D':
468         case LA_SMTPADDR:
469             ctl->smtpaddress = xstrdup(optarg);
470             break;
471         case 'Z':
472         case LA_ANTISPAM:
473             xalloca(buf, char *, strlen(optarg) + 1);
474             strcpy(buf, optarg);
475             cp = strtok(buf, ",");
476             do {
477                 struct idlist   *idp = save_str(&ctl->antispam, NULL, 0);;
478
479                 idp->val.status.num = atoi(cp);
480             } while
481                 ((cp = strtok((char *)NULL, ",")));
482             break;
483         case 'b':
484         case LA_BATCHLIMIT:
485             c = xatoi(optarg, &errflag);
486             ctl->batchlimit = NUM_VALUE_IN(c);
487             break;
488         case 'B':
489         case LA_FETCHLIMIT:
490             c = xatoi(optarg, &errflag);
491             ctl->fetchlimit = NUM_VALUE_IN(c);
492             break;
493         case 'e':
494         case LA_EXPUNGE:
495             c = xatoi(optarg, &errflag);
496             ctl->expunge = NUM_VALUE_IN(c);
497             break;
498         case 'm':
499         case LA_MDA:
500             ctl->mda = xstrdup(optarg);
501             ocount++;
502             break;
503         case LA_BSMTP:
504             ctl->bsmtp = xstrdup(optarg);
505             ocount++;
506             break;
507         case LA_LMTP:
508             ctl->listener = LMTP_MODE;
509             break;
510
511         case 'T':
512         case LA_NETSEC:
513 #if NET_SECURITY
514             ctl->server.netsec = (void *)optarg;
515 #else
516             fprintf(stderr, _("fetchmail: network security support is disabled\n"));
517             errflag++;
518 #endif /* NET_SECURITY */
519             break;
520
521 #if (defined(linux) && !INET6) || defined(__FreeBSD__)
522         case 'I':
523         case LA_INTERFACE:
524             interface_parse(optarg, &ctl->server);
525             break;
526         case 'M':
527         case LA_MONITOR:
528             ctl->server.monitor = xstrdup(optarg);
529             break;
530 #endif /* (defined(linux) && !INET6) || defined(__FreeBSD__) */
531         case LA_PLUGIN:
532             ctl->server.plugin = xstrdup(optarg);
533             break;
534         case LA_PLUGOUT:
535             ctl->server.plugout = xstrdup(optarg);
536             break;
537
538 #ifdef SSL_ENABLE
539         case LA_SSL:
540             ctl->use_ssl = FLAG_TRUE;
541             break;
542
543         case LA_SSLKEY:
544             ctl->sslkey = xstrdup(optarg);
545             break;
546
547         case LA_SSLCERT:
548             ctl->sslcert = xstrdup(optarg);
549             break;
550 #endif
551
552         case 'y':
553         case LA_YYDEBUG:
554             yydebug = TRUE;
555             break;
556
557         case 'w':
558         case LA_WARNINGS:
559             c = xatoi(optarg, &errflag);
560             ctl->warnings = NUM_VALUE_IN(c);
561             break;
562
563         case LA_CONFIGDUMP:
564             configdump = TRUE;
565             break;
566
567         case LA_SYSLOG:
568             rctl->use_syslog = FLAG_TRUE;
569             break;
570
571         case LA_NOSYSLOG:
572             rctl->use_syslog = FLAG_FALSE;
573             break;
574
575         case '?':
576         case LA_HELP:
577         default:
578             helpflag++;
579         }
580     }
581
582     if (errflag || ocount > 1 || helpflag) {
583         /* squawk if syntax errors were detected */
584 #define P(s)    fputs(s, helpflag ? stdout : stderr)
585         P(_("usage:  fetchmail [options] [server ...]\n"));
586         P(_("  Options are as follows:\n"));
587         P(_("  -?, --help        display this option help\n"));
588         P(_("  -V, --version     display version info\n"));
589
590         P(_("  -c, --check       check for messages without fetching\n"));
591         P(_("  -s, --silent      work silently\n"));
592         P(_("  -v, --verbose     work noisily (diagnostic output)\n"));
593         P(_("  -d, --daemon      run as a daemon once per n seconds\n"));
594         P(_("  -N, --nodetach    don't detach daemon process\n"));
595         P(_("  -q, --quit        kill daemon process\n"));
596         P(_("  -L, --logfile     specify logfile name\n"));
597         P(_("      --syslog      use syslog(3) for most messages when running as a daemon\n"));
598         P(_("      --invisible   don't write Received & enable host spoofing\n"));
599         P(_("  -f, --fetchmailrc specify alternate run control file\n"));
600         P(_("  -i, --idfile      specify alternate UIDs file\n"));
601         P(_("      --postmaster  specify recipient of last resort\n"));
602         P(_("      --nobounce    redirect bounces from user to postmaster.\n"));
603 #if (defined(linux) && !INET6) || defined(__FreeBSD__)
604         P(_("  -I, --interface   interface required specification\n"));
605         P(_("  -M, --monitor     monitor interface for activity\n"));
606 #endif
607 #if defined( SSL_ENABLE )
608         P(_("      --ssl         enable ssl encrypted session\n"));
609         P(_("      --sslkey      ssl private key file\n"));
610         P(_("      --sslcert     ssl client certificate\n"));
611 #endif
612         P(_("      --plugin      specify external command to open connection\n"));
613         P(_("      --plugout     specify external command to open smtp connection\n"));
614
615         P(_("  -p, --protocol    specify retrieval protocol (see man page)\n"));
616         P(_("  -U, --uidl        force the use of UIDLs (pop3 only)\n"));
617         P(_("  -P, --port        TCP/IP service port to connect to\n"));
618         P(_("      --preauth     preauthentication type (password or kerberos)\n"));
619         P(_("  -t, --timeout     server nonresponse timeout\n"));
620         P(_("  -E, --envelope    envelope address header\n"));
621         P(_("  -Q, --qvirtual    prefix to remove from local user id\n"));
622
623         P(_("  -u, --username    specify users's login on server\n"));
624         P(_("  -a, --all         retrieve old and new messages\n"));
625         P(_("  -K, --nokeep      delete new messages after retrieval\n"));
626         P(_("  -k, --keep        save new messages after retrieval\n"));
627         P(_("  -F, --flush       delete old messages from server\n"));
628         P(_("  -n, --norewrite   don't rewrite header addresses\n"));
629         P(_("  -l, --limit       don't fetch messages over given size\n"));
630         P(_("  -w, --warnings    interval between warning mail notification\n"));
631
632 #if NET_SECURITY
633         P(_("  -T, --netsec      set IP security request\n"));
634 #endif /* NET_SECURITY */
635         P(_("  -S, --smtphost    set SMTP forwarding host\n"));
636         P(_("  -D, --smtpaddress set SMTP delivery domain to use\n"));
637         P(_("  -Z, --antispam,   set antispam response values\n"));
638         P(_("  -b, --batchlimit  set batch limit for SMTP connections\n"));
639         P(_("  -B, --fetchlimit  set fetch limit for server connections\n"));
640         P(_("  -e, --expunge     set max deletions between expunges\n"));
641         P(_("  -m, --mda         set MDA to use for forwarding\n"));
642         P(_("      --bsmtp       set output BSMTP file\n"));
643         P(_("      --lmtp        use LMTP (RFC2033) for delivery\n"));
644         P(_("  -r, --folder      specify remote folder name\n"));
645 #undef P
646
647         if (helpflag)
648             exit(PS_SUCCESS);
649         else
650             exit(PS_SYNTAX);
651     }
652
653     return(optind);
654 }
655
656 /* options.c ends here */