This patch patches qmail-qmqpc.[c8] to allow specification of serves on
the command line. This allows the individual process to control the servers
used, rather than the central /var/qmail/control/qmqpservers. This offers
a simple means to extend ezmlm servers. The patch is for qmail-1.03.
qmail-qmqpc \- queue a mail message via QMQP
.SH SYNOPSIS
.B qmail-qmqpc
+[
+.I server
+[...] ]
.SH DESCRIPTION
.B qmail-qmqpc
offers the same interface as
.B qmail-queue
is replaced with a symbolic link to
.BR qmail-qmqpc .
+
+If one or more server IP addresses
+are specified on the command line,
+.B qmail-qmqpc
+will ignore the control files and instead use the QMQP servers specified on the
+command line.
+
.SH "CONTROL FILES"
.TP 5
.I qmqpservers
.B qmail-qmqpc
will try each address in turn until it establishes a QMQP connection
or runs out of addresses.
+
.SH "SEE ALSO"
qmail-control(5),
qmail-queue(8),
stralloc servers = {0};
-main()
+main(argc,argv)
+int argc;
+char **argv;
{
int i;
int j;
sig_pipeignore();
- if (chdir(auto_qmail) == -1) die_home();
- if (control_init() == -1) die_control();
- if (control_readfile(&servers,"control/qmqpservers",0) != 1) die_control();
+ if (!argv[1]) { /* std behavior */
+ if (chdir(auto_qmail) == -1) die_home();
+ if (control_init() == -1) die_control();
+ if (control_readfile(&servers,"control/qmqpservers",0) != 1) die_control();
- getmess();
+ getmess();
- i = 0;
- for (j = 0;j < servers.len;++j)
- if (!servers.s[j]) {
- doit(servers.s + i);
- i = j + 1;
- }
+ i = 0;
+ for (j = 0;j < servers.len;++j)
+ if (!servers.s[j]) {
+ doit(servers.s + i);
+ i = j + 1;
+ }
+ } else { /* servers on cmd line */
+
+ getmess();
+
+ i = 1;
+ while (argv[i])
+ doit(argv[i++]);
+ }
_exit(lasterror);
}