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