annotate admin/config-transition @ 310:f10a56dc7481

reworked online_detect to the simpler online_query Only pipe is supported now. Use online_query="/bin/cat /path/to/file" instead of online_detect=file online_file=/path/to/file and online_query="/path/to/some/script foo" instead of online_detect=pipe online_pipe="/path/to/some/script foo" See man page masqmail.conf(5) and admin/config-transition.
author meillo@marmaro.de
date Sun, 24 Apr 2011 19:14:38 +0200
parents e758296de02d
children e230bcd0f1c6
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
243
e758296de02d renamed `alias_local_caseless' to `caseless_matching'
markus schnalke <meillo@marmaro.de>
parents: 227
diff changeset
66 check["alias_local_caseless"] = "conf" SUBSEP "Renamed in 0.3.1" SUBSEP "\
e758296de02d renamed `alias_local_caseless' to `caseless_matching'
markus schnalke <meillo@marmaro.de>
parents: 227
diff changeset
67 It is now called 'caseless_matching' instead. \
e758296de02d renamed `alias_local_caseless' to `caseless_matching'
markus schnalke <meillo@marmaro.de>
parents: 227
diff changeset
68 "
e758296de02d renamed `alias_local_caseless' to `caseless_matching'
markus schnalke <meillo@marmaro.de>
parents: 227
diff changeset
69
310
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
70 check["online_detect"] = "conf" SUBSEP "Removed in 0.3.2" SUBSEP "\
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
71 Destilled to online_query. \
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
72 "
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
73
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
74 check["online_file"] = "conf" SUBSEP "Removed in 0.3.2" SUBSEP "\
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
75 Use online_query=\"/bin/cat /path/to/file\" instead. \
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
76 "
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
77
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
78 check["online_pipe"] = "conf" SUBSEP "Renamed in 0.3.2" SUBSEP "\
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
79 Now known as online_query. online_detect=pipe is not needed anymore. \
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
80 "
f10a56dc7481 reworked online_detect to the simpler online_query
meillo@marmaro.de
parents: 243
diff changeset
81
219
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
82 # route files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
83
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
84 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
85 POP-before-SMTP login function was removed completely. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
86 SMTP AUTH supersedes it today. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
87 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
88 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
89
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
90 check["do_ssl"] = "route" SUBSEP "Ignored by masqmail" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
91 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
92 We still don't know the rationale behind this option. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
93 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
94 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
95
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
96 # get files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
97
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
98 # already covered by the get.* and online_gets.* options in the conf
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
99 # file. This check is just to make sure, because one might only check
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
100 # the get file.
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
101 # We don't check for the other get file options, which are:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
102 # protocol server port wrapper user pass address return_path do_keep
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
103 # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
104
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
105 check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
106 The POP3 client was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
107 Use a dedicated POP3 client, e.g. fetchmail, instead. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
108 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
109
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
110
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
111 ######## END OF CHECK DEFINITIONS ########
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
112 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
113
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
114 function checkcomment() {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
115 if (/^[ \t]*\#/) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
116 return " (in a comment)"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
117 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
118 }
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 for (key in check) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
122 if (\$0 !~ key) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
123 continue;
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
124 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
125 # we have a match
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
126 split(check[key], a, SUBSEP); # array index starts with 1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
127 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment());
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
128 cmd = "fold -sw 70 | sed 's,^,\t,'"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
129 if (verbose) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
130 print "\t>>>> " \$0 " <<<<"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
131 print a[3] | cmd
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
132 close(cmd)
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
133 print "\t" a[2]
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
134 print ""
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
135 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
136 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
137 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
138
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
139 !
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
140
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
141
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
142 verbose=0
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
143 if [ X"$1" = X"-v" ] ; then
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
144 verbose=1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
145 shift
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
146 fi
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
147
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
148 for i do
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
149 awk -f "$awkscript" "verbose=$verbose" "$i"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
150 done
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
151