annotate admin/config-transition @ 304:d5ce2ba71e7b

manual formating of Received: hdrs; changed hdr for local receival Now the Received: headers are much friendlier to read. About folding: We must fold any line at 998 chars before transfer. We should fold the lines we produce at 78 chars. That is what RFC 2821 requests. We should think about it, somewhen. The header for locally (i.e. non-SMTP) received mail is changed to the format postfix uses. This matches RFC 2821 better. The `from' clause should contain a domain or IP, not a user name. Also, the `with' clause should contain a registered standard protocol name, which ``local'' is not.
author markus schnalke <meillo@marmaro.de>
date Thu, 09 Dec 2010 18:28:11 -0300
parents e758296de02d
children f10a56dc7481
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
219
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
70 # route files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
71
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
72 check["pop3_login"] = "route" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
73 POP-before-SMTP login function was removed completely. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
74 SMTP AUTH supersedes it today. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
75 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
76 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
77
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
78 check["do_ssl"] = "route" SUBSEP "Ignored by masqmail" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
79 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
80 We still don't know the rationale behind this option. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
81 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
82 "
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
83
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
84 # get files
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
85
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
86 # already covered by the get.* and online_gets.* options in the conf
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
87 # file. This check is just to make sure, because one might only check
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
88 # the get file.
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
89 # We don't check for the other get file options, which are:
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
90 # protocol server port wrapper user pass address return_path do_keep
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
91 # do_uidl do_uidl_dele max_size max_size_delete max_count resolve_list
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
92
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
93 check["protocol.*pop"] = "get" SUBSEP "Removed in 0.3.0" SUBSEP "\
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
94 The POP3 client was removed from masqmail. \
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
95 Use a dedicated POP3 client, e.g. fetchmail, instead. \
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
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
99 ######## END OF CHECK DEFINITIONS ########
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
100 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
101
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
102 function checkcomment() {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
103 if (/^[ \t]*\#/) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
104 return " (in a comment)"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
105 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
106 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
107
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
108 {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
109 for (key in check) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
110 if (\$0 !~ key) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
111 continue;
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
112 }
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
113 # we have a match
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
114 split(check[key], a, SUBSEP); # array index starts with 1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
115 printf("%s:%d: [%s] %s%s\n", FILENAME, NR, a[1], key, checkcomment());
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
116 cmd = "fold -sw 70 | sed 's,^,\t,'"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
117 if (verbose) {
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
118 print "\t>>>> " \$0 " <<<<"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
119 print a[3] | cmd
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
120 close(cmd)
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
121 print "\t" a[2]
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
122 print ""
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
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
127 !
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
128
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
129
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
130 verbose=0
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
131 if [ X"$1" = X"-v" ] ; then
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
132 verbose=1
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
133 shift
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
134 fi
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
135
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
136 for i do
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
137 awk -f "$awkscript" "verbose=$verbose" "$i"
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
138 done
c5d319418813 added config-transition
meillo@marmaro.de
parents:
diff changeset
139