Mercurial > masqmail
comparison admin/config-transition @ 227:cab46cefa4ce
renamed contrib/ to admin/
because the contents are for system admins
and possibly for advanced users too
author | meillo@marmaro.de |
---|---|
date | Fri, 23 Jul 2010 11:49:44 +0200 |
parents | contrib/config-transition@c5d319418813 |
children | e758296de02d |
comparison
equal
deleted
inserted
replaced
226:7b70bf4f1f42 | 227:cab46cefa4ce |
---|---|
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 | |
66 # route files | |
67 | |
68 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\ | |
69 POP-before-SMTP login function was removed completely. \ | |
70 SMTP AUTH supersedes it today. \ | |
71 If you though rely on it, stay with masqmail-0.2.x or run an arbitrary POP client before. \ | |
72 " | |
73 | |
74 check["do_ssl"] = "route" SUBSEP "Ignored by masqmail" SUBSEP "\ | |
75 Please report to the mailing list at <masqmail@marmaro.de> that you used this option. \ | |
76 We still don't know the rationale behind this option. \ | |
77 All we have is a comment in the code saying: This option is used by sqilconf. \ | |
78 " | |
79 | |
80 # get files | |
81 | |
82 # already covered by the get.* and online_gets.* options in the conf | |
83 # file. This check is just to make sure, because one might only check | |
84 # the get file. | |
85 # We don't check for the other get file options, which are: | |
86 # protocol server port wrapper user pass address return_path do_keep | |
87 # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list | |
88 | |
89 check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\ | |
90 The POP3 client was removed from masqmail. \ | |
91 Use a dedicated POP3 client, e.g. fetchmail, instead. \ | |
92 " | |
93 | |
94 | |
95 ######## END OF CHECK DEFINITIONS ######## | |
96 } | |
97 | |
98 function checkcomment() { | |
99 if (/^[ \t]*\#/) { | |
100 return " (in a comment)" | |
101 } | |
102 } | |
103 | |
104 { | |
105 for (key in check) { | |
106 if (\$0 !~ key) { | |
107 continue; | |
108 } | |
109 # we have a match | |
110 split(check[key], a, SUBSEP); # array index starts with 1 | |
111 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment()); | |
112 cmd = "fold -sw 70 | sed 's,^,\t,'" | |
113 if (verbose) { | |
114 print "\t>>>> " \$0 " <<<<" | |
115 print a[3] | cmd | |
116 close(cmd) | |
117 print "\t" a[2] | |
118 print "" | |
119 } | |
120 } | |
121 } | |
122 | |
123 ! | |
124 | |
125 | |
126 verbose=0 | |
127 if [ X"$1" = X"-v" ] ; then | |
128 verbose=1 | |
129 shift | |
130 fi | |
131 | |
132 for i do | |
133 awk -f "$awkscript" "verbose=$verbose" "$i" | |
134 done | |
135 |