# HG changeset patch # User markus schnalke # Date 1291842022 10800 # Node ID 792e0201c1b3682476ffe72e3fcfd597f8e36a6b # Parent bb3005ce0837325d473943c38f2d274b0fadadfd mark -qo (without argument) obsolete Its behavior (online detect and send over the available route) is included in -q. In the -qo case no local mail would be sent, but why would be not want to do so? We might use -qo (without arg) for something more useful in the future. diff -r bb3005ce0837 -r 792e0201c1b3 man/masqmail.8 --- a/man/masqmail.8 Wed Dec 08 17:17:38 2010 -0300 +++ b/man/masqmail.8 Wed Dec 08 18:00:22 2010 -0300 @@ -5,7 +5,7 @@ .SH SYNOPSIS -.BR masqmail\ [ \-t ] \ [ \-oi ] \ [ \-f\ \fIADDRESS ] \ \fIRECIPIENT... +.BR masqmail\ [ \-t ] \ [ \-oi ] \ [ \-f\ \fIADDRESS ]\ \fIRECIPIENT... .B mailq .br @@ -15,7 +15,7 @@ .br .B masqmail \-q -.BR masqmail\ \-qo\ [ \fINAME ] +.BR masqmail\ \-qo\ \fINAME .BI mailrm\ MSGID... .br @@ -88,33 +88,35 @@ Do a single queue run. Try to deliver all messages in the queue. Masqmail sends to addresses on the local host, on the local net, -and if it detects an online connection to remote ones too. +and to remote ones, if available online routes permit. That means, masqmail sends all queued mail it can. -.B \-q -includes -.B \-qo -(without argument). +Online detection is done with the configured +method (see \fBonline_detect\fR in \fBmasqmail.conf(5)\fR). .TP -.B Single queue run (online) -.B \-qo \fR[\fB\fINAME\fR] +.B Single queue run (only named route) +.BI \-qo\ NAME -Do a single queue run and deliver only using one specific online route. +Do a single queue run and deliver only using the specified online route. -If a connection name is given, then this one will be used. - -If no connection name is given, it will be determined with the configured -method (see \fBonline_detect\fR in \fBmasqmail.conf(5)\fR) and, -if none is available no mail will be delivered. - -The specified route configuration is read and queued mail to matching -remote recipients will be sent. -The \fINAME\fR is defined in the configuration -(see \fBonline_routes.\fINAME\fR). +The route configuration for \fINAME\fP is read and queued mail +to matching remote recipients is sent. +(See \fBonline_routes.\fINAME\fR in the main config file.) You may want to use this option in scripts that run as soon as a link to the internet has been set up (e.g. ip-up). +.B Obsolete behavior: +Up to now: If +.B \-qo +has no argument, the online connection is determinded +by online detect and, if available, mail is sent through it. +If none is available no mail is delivered. + +This behavior is likely to change in future versions +because it is included in \-q. +We could do something more useful instead. + .P The other modes are simple ones: @@ -335,9 +337,9 @@ ``Daemon (queue)'' mode. See above. .TP -\fB\-qo [\fIname\fB]\fR +\fB\-qo \fIname -``Single queue run (online)'' mode. See above. +``Single queue run (only named route)'' mode. See above. .TP \fB\-t\fR diff -r bb3005ce0837 -r 792e0201c1b3 src/masqmail.c --- a/src/masqmail.c Wed Dec 08 17:17:38 2010 -0300 +++ b/src/masqmail.c Wed Dec 08 18:00:22 2010 -0300 @@ -371,8 +371,6 @@ } /* -qo, -q (without argument), or called as runq */ -/* TODO: are -qo and -q exclusively or not? - And how is this related to being a daemon? */ static int run_queue(gboolean do_runq, gboolean do_runq_online, char* route_name) { @@ -390,6 +388,8 @@ conf.online_detect = g_strdup("argument"); set_online_name(route_name); } + /* TODO: change behavior of `-qo without argument'? + Because that behavior is included in -q. */ ret = queue_run_online(); } return ret; @@ -567,7 +567,12 @@ set_mode(MODE_RUNQUEUE); do_runq_online = TRUE; /* can be NULL, then we use online detection method */ + /* TODO: behavior might change if it is NULL */ route_name = get_optarg(argv, &arg, opt+2); + if (!route_name) { + fprintf(stderr, "Please do not use -qo without argument anymore; use -q instead.\n"); + fprintf(stderr, "The behavior for -qo without argument is likely to change.\n"); + } } else if (strncmp(opt, "q", 1) == 0) { /* must be after the `qo' check */