Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / sendmail / cf / cf / knecht.mc
1 divert(-1)
2 #
3 # Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
4 #       All rights reserved.
5 # Copyright (c) 1983 Eric P. Allman.  All rights reserved.
6 # Copyright (c) 1988, 1993
7 #       The Regents of the University of California.  All rights reserved.
8 #
9 # By using this file, you agree to the terms and conditions set
10 # forth in the LICENSE file which can be found at the top level of
11 # the sendmail distribution.
12 #
13 #
14
15 #
16 #  This is specific to Eric's home machine.
17 #
18 #       Run daemon with -bd -q5m
19 #
20
21 divert(0)
22 VERSIONID(`$Id: knecht.mc,v 8.55 2001/08/01 22:20:40 eric Exp $')
23 OSTYPE(bsd4.4)
24 DOMAIN(generic)
25
26 define(`ALIAS_FILE', ``/etc/mail/aliases, /var/listmanager/aliases'')
27 define(`confFORWARD_PATH', `$z/.forward.$w:$z/.forward+$h:$z/.forward')
28 define(`confDEF_USER_ID', `mailnull')
29 define(`confHOST_STATUS_DIRECTORY', `.hoststat')
30 define(`confTO_ICONNECT', `10s')
31 define(`confCOPY_ERRORS_TO', `Postmaster')
32 define(`confTO_QUEUEWARN', `8h')
33 define(`confMIN_QUEUE_AGE', `27m')
34 define(`confTRUSTED_USERS', ``www listmgr'')
35 define(`confPRIVACY_FLAGS', ``authwarnings,noexpn,novrfy'')
36
37 define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')
38 define(`confCACERT_PATH', `CERT_DIR')
39 define(`confCACERT', `CERT_DIR/CAcert.pem')
40 define(`confSERVER_CERT', `CERT_DIR/MYcert.pem')
41 define(`confSERVER_KEY', `CERT_DIR/MYkey.pem')
42 define(`confCLIENT_CERT', `CERT_DIR/MYcert.pem')
43 define(`confCLIENT_KEY', `CERT_DIR/MYkey.pem')
44
45 FEATURE(access_db)
46 FEATURE(local_lmtp)
47 FEATURE(virtusertable)
48
49 FEATURE(`nocanonify', `canonify_hosts')
50 CANONIFY_DOMAIN(`sendmail.org')
51 CANONIFY_DOMAIN_FILE(`/etc/mail/canonify-domains')
52
53 dnl #  at most 10 queue runners
54 define(`confMAX_QUEUE_CHILDREN', `20')
55
56 define(`confMAX_RUNNERS_PER_QUEUE', `5')
57
58 dnl #  run at most 10 concurrent processes for initial submission
59 define(`confFAST_SPLIT', `10')
60
61 dnl #  10 runners, split into at most 15 recipients per envelope
62 QUEUE_GROUP(`mqueue', `P=/var/spool/mqueue, R=5, r=15, F=f')
63
64 MAILER(local)
65 MAILER(smtp)
66
67 LOCAL_CONFIG
68 #
69 #  Regular expression to reject:
70 #    * numeric-only localparts from aol.com and msn.com
71 #    * localparts starting with a digit from juno.com
72 #
73 Kcheckaddress regex -a@MATCH
74    ^([0-9]+<@(aol|msn)\.com|[0-9][^<]*<@juno\.com)\.?>
75
76 #
77 #  Names that won't be allowed in a To: line (local-part and domains)
78 #
79 C{RejectToLocalparts}   friend you
80 C{RejectToDomains}      public.com
81
82 LOCAL_RULESETS
83 HTo: $>CheckTo
84
85 SCheckTo
86 R$={RejectToLocalparts}@$*      $#error $: "553 Header error"
87 R$*@$={RejectToDomains}         $#error $: "553 Header error"
88
89 HMessage-Id: $>CheckMessageId
90
91 SCheckMessageId
92 R< $+ @ $+ >                    $@ OK
93 R$*                             $#error $: "554 Header error"
94
95 HReceived: $>CheckReceived
96
97 SCheckReceived
98 R$* ......................................................... $*
99                                 $#error $: "554 Header error"
100
101 #
102 # Reject certain senders
103 #       Regex match to catch things in quotes
104 #
105 HFrom: $>+CheckFrom
106 KCheckFrom regex -a@MATCH
107         [^a-z]?(Net-Pa)[^a-z]
108
109 SCheckFrom
110 R$*                             $: $( CheckFrom $1 $)
111 R@MATCH                         $#error $: "553 Header error"
112
113 LOCAL_RULESETS
114 SLocal_check_mail
115 # check address against various regex checks
116 R$*                             $: $>Parse0 $>3 $1
117 R$+                             $: $(checkaddress $1 $)
118 R@MATCH                         $#error $: "553 Header error"
119
120 #
121 #  Following code from Anthony Howe <achowe@snert.com>.  The check
122 #  for the Outlook Express marker may hit some legal messages, but
123 #  the Content-Disposition is clearly illegal.
124 #
125
126 #########################################################################
127 #
128 # w32.sircam.worm@mm
129 #
130 # There are serveral patterns that appear common ONLY to SirCam worm and
131 # not to Outlook Express, which claims to have sent the worm.  There are
132 # four headers that always appear together and in this order:
133 #
134 #  X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
135 #  X-Mailer: Microsoft Outlook Express 5.50.4133.2400
136 #  Content-Type: multipart/mixed; boundary="----27AA9124_Outlook_Express_message_boundary"
137 #  Content-Disposition: Multipart message
138 #
139 # Empirical study of the worm message headers vs. true Outlook Express
140 # (5.50.4133.2400 & 5.50.4522.1200) messages with multipart/mixed attachments
141 # shows Outlook Express does:
142 #
143 #  a) NOT supply a Content-Disposition header for multipart/mixed messages.
144 #  b) NOT specify the header X-MimeOLE header name in all-caps
145 #  c) NOT specify boundary tag with the expression "_Outlook_Express_message_boundary"
146 #
147 # The solution below catches any one of this three issues. This is not an ideal
148 # solution, but a temporary measure. A correct solution would be to check for
149 # the presence of ALL three header attributes. Also the solution is incomplete
150 # since Outlook Express 5.0 and 4.0 were not compared.
151 #
152 # NOTE regex keys are first dequoted and spaces removed before matching.
153 # This caused me no end of grief.
154 #
155 #########################################################################
156
157 LOCAL_RULESETS
158
159 KSirCamWormMarker regex -f -aSUSPECT multipart/mixed;boundary=----.+_Outlook_Express_message_boundary
160 HContent-Type:          $>CheckContentType
161
162 SCheckContentType
163 R$+                     $: $(SirCamWormMarker $1 $)
164 RSUSPECT                $#error $: "553 Possible virus, see http://www.symantec.com/avcenter/venc/data/w32.sircam.worm@mm.html"
165
166 HContent-Disposition:   $>CheckContentDisposition
167
168 SCheckContentDisposition
169 R$-                     $@ OK
170 R$- ; $+                $@ OK
171 R$*                     $#error $: "553 Illegal Content-Disposition"