masqmail

changeset 290:792e0201c1b3

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.
author markus schnalke <meillo@marmaro.de>
date Wed, 08 Dec 2010 18:00:22 -0300
parents bb3005ce0837
children 95d536599fd7
files man/masqmail.8 src/masqmail.c
diffstat 2 files changed, 31 insertions(+), 24 deletions(-) [+]
line diff
     1.1 --- a/man/masqmail.8	Wed Dec 08 17:17:38 2010 -0300
     1.2 +++ b/man/masqmail.8	Wed Dec 08 18:00:22 2010 -0300
     1.3 @@ -5,7 +5,7 @@
     1.4  
     1.5  .SH SYNOPSIS
     1.6  
     1.7 -.BR masqmail\  [ \-t ] \  [ \-oi ] \  [ \-f\ \fIADDRESS ] \ \fIRECIPIENT...
     1.8 +.BR masqmail\  [ \-t ] \  [ \-oi ] \  [ \-f\ \fIADDRESS ]\  \fIRECIPIENT...
     1.9  
    1.10  .B mailq
    1.11  .br
    1.12 @@ -15,7 +15,7 @@
    1.13  .br
    1.14  .B masqmail \-q
    1.15  
    1.16 -.BR masqmail\ \-qo\  [ \fINAME ]
    1.17 +.BR masqmail\ \-qo\  \fINAME
    1.18  
    1.19  .BI mailrm\  MSGID...
    1.20  .br
    1.21 @@ -88,33 +88,35 @@
    1.22  Do a single queue run.
    1.23  Try to deliver all messages in the queue.
    1.24  Masqmail sends to addresses on the local host, on the local net,
    1.25 -and if it detects an online connection to remote ones too.
    1.26 +and to remote ones, if available online routes permit.
    1.27  That means, masqmail sends all queued mail it can.
    1.28 -.B \-q
    1.29 -includes
    1.30 -.B \-qo
    1.31 -(without argument).
    1.32 +Online detection is done with the configured
    1.33 +method (see \fBonline_detect\fR in \fBmasqmail.conf(5)\fR).
    1.34  
    1.35  .TP
    1.36 -.B Single queue run (online)
    1.37 -.B \-qo \fR[\fB\fINAME\fR]
    1.38 +.B Single queue run (only named route)
    1.39 +.BI \-qo\  NAME
    1.40  
    1.41 -Do a single queue run and deliver only using one specific online route.
    1.42 +Do a single queue run and deliver only using the specified online route.
    1.43  
    1.44 -If a connection name is given, then this one will be used.
    1.45 -
    1.46 -If no connection name is given, it will be determined with the configured
    1.47 -method (see \fBonline_detect\fR in \fBmasqmail.conf(5)\fR) and,
    1.48 -if none is available no mail will be delivered.
    1.49 -
    1.50 -The specified route configuration is read and queued mail to matching
    1.51 -remote recipients will be sent.
    1.52 -The \fINAME\fR is defined in the configuration
    1.53 -(see \fBonline_routes.\fINAME\fR).
    1.54 +The route configuration for \fINAME\fP is read and queued mail
    1.55 +to matching remote recipients is sent.
    1.56 +(See \fBonline_routes.\fINAME\fR in the main config file.)
    1.57  
    1.58  You may want to use this option in scripts that run as soon as a link
    1.59  to the internet has been set up (e.g. ip-up).
    1.60  
    1.61 +.B Obsolete behavior:
    1.62 +Up to now: If
    1.63 +.B \-qo
    1.64 +has no argument, the online connection is determinded
    1.65 +by online detect and, if available, mail is sent through it.
    1.66 +If none is available no mail is delivered.
    1.67 +
    1.68 +This behavior is likely to change in future versions
    1.69 +because it is included in \-q.
    1.70 +We could do something more useful instead.
    1.71 +
    1.72  .P
    1.73  The other modes are simple ones:
    1.74  
    1.75 @@ -335,9 +337,9 @@
    1.76  ``Daemon (queue)'' mode. See above.
    1.77  
    1.78  .TP
    1.79 -\fB\-qo [\fIname\fB]\fR
    1.80 +\fB\-qo \fIname
    1.81  
    1.82 -``Single queue run (online)'' mode. See above.
    1.83 +``Single queue run (only named route)'' mode. See above.
    1.84  
    1.85  .TP
    1.86  \fB\-t\fR
     2.1 --- a/src/masqmail.c	Wed Dec 08 17:17:38 2010 -0300
     2.2 +++ b/src/masqmail.c	Wed Dec 08 18:00:22 2010 -0300
     2.3 @@ -371,8 +371,6 @@
     2.4  }
     2.5  
     2.6  /* -qo, -q (without argument), or called as runq */
     2.7 -/* TODO: are -qo and -q exclusively or not?
     2.8 -         And how is this related to being a daemon? */
     2.9  static int
    2.10  run_queue(gboolean do_runq, gboolean do_runq_online, char* route_name)
    2.11  {
    2.12 @@ -390,6 +388,8 @@
    2.13  			conf.online_detect = g_strdup("argument");
    2.14  			set_online_name(route_name);
    2.15  		}
    2.16 +		/* TODO: change behavior of `-qo without argument'?
    2.17 +		         Because that behavior is included in -q. */
    2.18  		ret = queue_run_online();
    2.19  	}
    2.20  	return ret;
    2.21 @@ -567,7 +567,12 @@
    2.22  			set_mode(MODE_RUNQUEUE);
    2.23  			do_runq_online = TRUE;
    2.24  			/* can be NULL, then we use online detection method */
    2.25 +			/* TODO: behavior might change if it is NULL */
    2.26  			route_name = get_optarg(argv, &arg, opt+2);
    2.27 +			if (!route_name) {
    2.28 +				fprintf(stderr, "Please do not use -qo without argument anymore; use -q instead.\n");
    2.29 +				fprintf(stderr, "The behavior for -qo without argument is likely to change.\n");
    2.30 +			}
    2.31  
    2.32  		} else if (strncmp(opt, "q", 1) == 0) {
    2.33  			/* must be after the `qo' check */