annotate contrib/config-transition @ 222:8cddc65765bd

added support for STARTTLS wrappers added the route config option `instant_helo' which causes masqmail, as SMTP client, not to wait for the server's 220 greeting. Instead if says EHLO right at once. You'll need this for STARTTLS wrappers that usually eat the greeting line.
author meillo@marmaro.de
date Fri, 23 Jul 2010 10:57:53 +0200
parents c5d319418813
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
219
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
1 #!/bin/sh
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
2 #
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
3 # check masqmail config files for options that are obsolete
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
4 # -v enables verbose output
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
5 #
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
6 # 2010 markus schnalke <meillo@marmaro.de>
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
7
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
8 if [ $# -eq 0 ] ; then
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
9 echo "usage: config-transition [-v] CONFIGFILE..." >&2
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
10 exit 1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
11 fi
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
12
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
13 awkscript="/tmp/masqmail-config-transition-$$"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
14
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
15 trap 'rm -f "$awkscript"; exit' INT QUIT TERM EXIT
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
16
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
17 cat >"$awkscript" <<!
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
18 # Because of the Here-document, escape (with backslash) these characters:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
19 # backslash, dollar, backtick
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
20 BEGIN {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
21
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
22 ######## START OF CHECKS ########
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
23
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
24 # Rules look like this:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
25 #
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
26 # check["regexp"] = "conf-kind" SUBSEP "version-info" SUBSEP "verbose-description"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
27 #
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
28 # Meaning of the strings:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
29 # - regexp: is also used as the name in the normal listing
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
30 # - conf-kind: in which kind of config the option appears (conf, route, get)
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
31 # - version-info: when it was removed
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
32 # - verbose-description: how to do it now
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
33
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
34
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
35 # conf file
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
36
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
37 check["remote_port"] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
38 Use 'mail_host' in the route configuration instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
39 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
40
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
41 check["mbox_default.*maildir"] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
42 Native maildir support was removed completely. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
43 Use an MDA, e.g. procmail, to deliver to Maildir mail folder. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
44 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
45
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
46 check["maildir_users"] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
47 Native maildir support was removed completely. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
48 Use an MDA, e.g. procmail, to deliver to Maildir mail folder. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
49 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
50
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
51 check["mserver_iface"] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
52 Native mserver support was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
53 Use the mservdetect tool with online_detect=pipe instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
54 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
55
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
56 check["get\\\\."] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
57 The POP3 client was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
58 Use a dedicated POP3 client, e.g. fetchmail, instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
59 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
60
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
61 check["online_gets\\\\."] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
62 The POP3 client was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
63 Use a dedicated POP3 client, e.g. fetchmail, instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
64 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
65
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
66 # route files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
67
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
68 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
69 POP-before-SMTP login function was removed completely. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
70 SMTP AUTH supersedes it today. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
71 If you though rely on it, stay with masqmail-0.2.x or run an arbitrary POP client before. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
72 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
73
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
74 check["do_ssl"] = "route" SUBSEP "Ignored by masqmail" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
75 Please report to the mailing list at <masqmail@marmaro.de> that you used this option. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
76 We still don't know the rationale behind this option. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
77 All we have is a comment in the code saying: This option is used by sqilconf. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
78 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
79
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
80 # get files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
81
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
82 # already covered by the get.* and online_gets.* options in the conf
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
83 # file. This check is just to make sure, because one might only check
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
84 # the get file.
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
85 # We don't check for the other get file options, which are:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
86 # protocol server port wrapper user pass address return_path do_keep
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
87 # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
88
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
89 check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
90 The POP3 client was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
91 Use a dedicated POP3 client, e.g. fetchmail, instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
92 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
93
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
94
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
95 ######## END OF CHECK DEFINITIONS ########
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
96 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
97
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
98 function checkcomment() {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
99 if (/^[ \t]*\#/) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
100 return " (in a comment)"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
101 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
102 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
103
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
104 {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
105 for (key in check) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
106 if (\$0 !~ key) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
107 continue;
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
108 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
109 # we have a match
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
110 split(check[key], a, SUBSEP); # array index starts with 1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
111 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment());
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
112 cmd = "fold -sw 70 | sed 's,^,\t,'"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
113 if (verbose) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
114 print "\t>>>> " \$0 " <<<<"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
115 print a[3] | cmd
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
116 close(cmd)
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
117 print "\t" a[2]
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
118 print ""
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
119 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
120 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
121 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
122
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
123 !
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
124
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
125
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
126 verbose=0
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
127 if [ X"$1" = X"-v" ] ; then
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
128 verbose=1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
129 shift
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
130 fi
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
131
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
132 for i do
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
133 awk -f "$awkscript" "verbose=$verbose" "$i"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
134 done
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
135