masqmail

view 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
line source
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>
8 if [ $# -eq 0 ] ; then
9 echo "usage: config-transition [-v] CONFIGFILE..." >&2
10 exit 1
11 fi
13 awkscript="/tmp/masqmail-config-transition-$$"
15 trap 'rm -f "$awkscript"; exit' INT QUIT TERM EXIT
17 cat >"$awkscript" <<!
18 # Because of the Here-document, escape (with backslash) these characters:
19 # backslash, dollar, backtick
20 BEGIN {
22 ######## START OF CHECKS ########
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
35 # conf file
37 check["remote_port"] = "conf" SUBSEP "Removed in 0.3.0" SUBSEP "\
38 Use 'mail_host' in the route configuration instead. \
39 "
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 "
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 "
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 "
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 "
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 "
66 check["alias_local_caseless"] = "conf" SUBSEP "Renamed in 0.3.1" SUBSEP "\
67 It is now called 'caseless_matching' instead. \
68 "
70 check["online_detect"] = "conf" SUBSEP "Removed in 0.3.2" SUBSEP "\
71 Destilled to online_query. \
72 "
74 check["online_file"] = "conf" SUBSEP "Removed in 0.3.2" SUBSEP "\
75 Use online_query=\"/bin/cat /path/to/file\" instead. \
76 "
78 check["online_pipe"] = "conf" SUBSEP "Renamed in 0.3.2" SUBSEP "\
79 Now known as online_query. online_detect=pipe is not needed anymore. \
80 "
82 # route files
84 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\
85 POP-before-SMTP login function was removed completely. \
86 SMTP AUTH supersedes it today. \
87 If you though rely on it, stay with masqmail-0.2.x or run an arbitrary POP client before. \
88 "
90 check["do_ssl"] = "route" SUBSEP "Ignored by masqmail" SUBSEP "\
91 Please report to the mailing list at <masqmail@marmaro.de> that you used this option. \
92 We still don't know the rationale behind this option. \
93 All we have is a comment in the code saying: This option is used by sqilconf. \
94 "
96 # get files
98 # already covered by the get.* and online_gets.* options in the conf
99 # file. This check is just to make sure, because one might only check
100 # the get file.
101 # We don't check for the other get file options, which are:
102 # protocol server port wrapper user pass address return_path do_keep
103 # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list
105 check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\
106 The POP3 client was removed from masqmail. \
107 Use a dedicated POP3 client, e.g. fetchmail, instead. \
108 "
111 ######## END OF CHECK DEFINITIONS ########
112 }
114 function checkcomment() {
115 if (/^[ \t]*\#/) {
116 return " (in a comment)"
117 }
118 }
120 {
121 for (key in check) {
122 if (\$0 !~ key) {
123 continue;
124 }
125 # we have a match
126 split(check[key], a, SUBSEP); # array index starts with 1
127 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment());
128 cmd = "fold -sw 70 | sed 's,^,\t,'"
129 if (verbose) {
130 print "\t>>>> " \$0 " <<<<"
131 print a[3] | cmd
132 close(cmd)
133 print "\t" a[2]
134 print ""
135 }
136 }
137 }
139 !
142 verbose=0
143 if [ X"$1" = X"-v" ] ; then
144 verbose=1
145 shift
146 fi
148 for i do
149 awk -f "$awkscript" "verbose=$verbose" "$i"
150 done