# HG changeset patch # User meillo@marmaro.de # Date 1303666676 -7200 # Node ID e230bcd0f1c647e91f2fbc053ea4ac551fe1ab1d # Parent f10a56dc74811e9cbf74c1ad448c0b3e62c0f4a0 removed protocol option from route config It was somehow redundant. Now, if `pipe' is set, the protocol will be pipe, otherwise it'll be smtp. That's just natural. diff -r f10a56dc7481 -r e230bcd0f1c6 admin/config-transition --- a/admin/config-transition Sun Apr 24 19:14:38 2011 +0200 +++ b/admin/config-transition Sun Apr 24 19:37:56 2011 +0200 @@ -1,12 +1,11 @@ #!/bin/sh # # check masqmail config files for options that are obsolete -# -v enables verbose output # # 2010 markus schnalke if [ $# -eq 0 ] ; then - echo "usage: config-transition [-v] CONFIGFILE..." >&2 + echo "usage: config-transition CONFIGFILE..." >&2 exit 1 fi @@ -93,6 +92,10 @@ All we have is a comment in the code saying: This option is used by sqilconf. \ " +check["protocol"] = "route" SUBSEP "Removed in 0.3.2" SUBSEP "\ +If pipe is given, pipe will be used, otherwise smtp will be used. \ +" + # get files # already covered by the get.* and online_gets.* options in the conf @@ -126,26 +129,17 @@ split(check[key], a, SUBSEP); # array index starts with 1 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment()); cmd = "fold -sw 70 | sed 's,^,\t,'" - if (verbose) { - print "\t>>>> " \$0 " <<<<" - print a[3] | cmd - close(cmd) - print "\t" a[2] - print "" - } + print "\t>>>> " \$0 " <<<<" + print a[3] | cmd + close(cmd) + print "\t" a[2] + print "" } } ! -verbose=0 -if [ X"$1" = X"-v" ] ; then - verbose=1 - shift -fi - for i do - awk -f "$awkscript" "verbose=$verbose" "$i" + awk -f "$awkscript" "$i" done - diff -r f10a56dc7481 -r e230bcd0f1c6 docs/simple-relay-setup --- a/docs/simple-relay-setup Sun Apr 24 19:14:38 2011 +0200 +++ b/docs/simple-relay-setup Sun Apr 24 19:37:56 2011 +0200 @@ -34,8 +34,6 @@ Addionally you need to create the route config file like: - protocol = smtp - # where to relay to; the address and port of the smart host mail_host = "mail.gmx.net:25" # use a wrapper to enable encryption diff -r f10a56dc7481 -r e230bcd0f1c6 examples/openssl.route --- a/examples/openssl.route Sun Apr 24 19:14:38 2011 +0200 +++ b/examples/openssl.route Sun Apr 24 19:37:56 2011 +0200 @@ -2,8 +2,6 @@ # by Philipp Berndt -protocol = "smtp" - # encryption is done by communicating through openssl # Today usually STARTTLS (RFC-3207) is used: diff -r f10a56dc7481 -r e230bcd0f1c6 man/masqmail.route.5 --- a/man/masqmail.route.5 Sun Apr 24 19:14:38 2011 +0200 +++ b/man/masqmail.route.5 Sun Apr 24 19:37:56 2011 +0200 @@ -9,17 +9,15 @@ This man page describes the syntax of the route configuration files of \fBmasqmail (8)\fR. Their usual locations are in \fI/etc/masqmail/\fR. +Mail will be sent with the SMTP protocol to its destination, unless +`pipe' is given. +In this case the message will be piped to the given program. +See option `pipe' below. + + .SH OPTIONS .TP -\fBprotocol\fR = \fIstring\fR - -\fIstring\fR can be one of `smtp' or `pipe', default is `smtp'. -If set to `smtp', mail will be sent with the SMTP protocol to its destination. -If set to `pipe', you also have to set `pipe' to a command, the message will then be piped to a program. -See option `pipe' below. - -.TP \fBmail_host\fR = \fIstring\fR This is preferably the mail server of your ISP. @@ -305,7 +303,6 @@ .TP \fBpipe\fR = \fIcommand\fR -If set, and protocol is set to `pipe', \fIcommand\fR will be called and the message will be piped to its stdin. Purpose is to use gateways to uucp, fax, sms or whatever else. @@ -315,15 +312,15 @@ .TP \fBpipe_fromline = \fIboolean\fR -If this is set, and protocol is set to `pipe', -a from line will be prepended to the output stream whenever a pipe command is called. +Only if `pipe' is used. +A from line will be prepended to the output stream whenever a pipe command is called. Default is false. .TP \fBpipe_fromhack = \fIboolean\fR -If this is set, and protocol is set to `pipe', -each line beginning with `From ' is replaced with `>From ' whenever a pipe command is called. +Only if `pipe' is used. +Each line beginning with `From ' is replaced with `>From ' whenever a pipe command is called. You probably want this if you have set \fBpipe_fromline\fR above. Default is false. diff -r f10a56dc7481 -r e230bcd0f1c6 src/conf.c --- a/src/conf.c Sun Apr 24 19:14:38 2011 +0200 +++ b/src/conf.c Sun Apr 24 19:37:56 2011 +0200 @@ -620,7 +620,6 @@ route->filename = g_strdup(filename); route->name = g_strdup(filename); /* quick hack */ - route->protocol = g_strdup("smtp"); route->expand_h_sender_address = TRUE; route->is_local_net = is_local_net; @@ -635,9 +634,7 @@ gchar lval[256], rval[2048]; while (read_statement(in, lval, 256, rval, 2048)) { - if (strcmp(lval, "protocol") == 0) - route->protocol = g_strdup(rval); - else if (strcmp(lval, "mail_host") == 0) + if (strcmp(lval, "mail_host") == 0) route->mail_host = parse_interface(rval, 25); else if (strcmp(lval, "helo_name") == 0) route->helo_name = g_strdup(rval); @@ -803,8 +800,6 @@ { if (r->filename) g_free(r->filename); - if (r->protocol) - g_free(r->protocol); if (r->mail_host) { g_free(r->mail_host->address); g_free(r->mail_host); @@ -890,7 +885,6 @@ return NULL; } memset(route, 0, sizeof(connect_route)); - route->protocol = g_strdup("smtp"); route->is_local_net = TRUE; route->name = g_strdup("default local_net_route"); route->expand_h_sender_address = TRUE; diff -r f10a56dc7481 -r e230bcd0f1c6 src/deliver.c --- a/src/deliver.c Sun Apr 24 19:14:38 2011 +0200 +++ b/src/deliver.c Sun Apr 24 19:37:56 2011 +0200 @@ -268,11 +268,6 @@ DEBUG(5) debugf("deliver_msglist_host_pipe entered\n"); - if (route->pipe == NULL) { - logwrite(LOG_ALERT, "no pipe command given for route (protocol is pipe!)\n"); - return FALSE; - } - foreach(msgout_list, msgout_node) { msg_out *msgout = (msg_out *) (msgout_node->data); gboolean flag, ok_fail = FALSE; @@ -475,11 +470,12 @@ gboolean deliver_msglist_host(connect_route * route, GList * msgout_list, gchar * host, GList * res_list) { - DEBUG(5) debugf("protocol = %s\n", route->protocol); - if (strcmp(route->protocol, "pipe") == 0) { + if (route->pipe) { + DEBUG(5) debugf("with pipe\n"); return deliver_msglist_host_pipe(route, msgout_list, host, res_list); } else { + DEBUG(5) debugf("with smtp\n"); return deliver_msglist_host_smtp(route, msgout_list, host, res_list); } } diff -r f10a56dc7481 -r e230bcd0f1c6 src/masqmail.h --- a/src/masqmail.h Sun Apr 24 19:14:38 2011 +0200 +++ b/src/masqmail.h Sun Apr 24 19:37:56 2011 +0200 @@ -81,8 +81,6 @@ gchar *name; gchar *filename; - gchar *protocol; - gboolean is_local_net; gboolean last_route;