Block more HTTP request methods
[mgsmtp.git] / mgsmtp_server_example.ini
1 ; MegaBrutal's SMTP Server (MgSMTP)
2 ; Copyright (C) 2010-2015 MegaBrutal
3
4 ; This is an example configuration file for MgSMTP.
5 ; You may inspect it to learn about the configuration options of MgSMTP, and (if
6 ; you find it convenient) you may copy and edit it to make your own configuration
7 ; file.
8
9 ; You should read readme.txt prior reading this file.
10
11 ; The "Server" section contains some basic, general settings for your server.
12
13 [Server]
14
15 ; The "Name" key specifies the hostname as MgSMTP will identify itself. The server
16 ; will report it in greetings, in HELO commands sent to other servers, in failure
17 ; notices, and it'll accept e-mail addresses with the given hostname as local.
18 ; It can be a virtual hostname (such as a No-IP domain pointed to your IP), it's
19 ; not required to be the server's forward-confirmed reverse DNS. In any case,
20 ; however, this hostname must be resolvable to your IP address. Moreover, you
21 ; SHOULD specify your server's FCrDNS, if you can, and your server MUST have a
22 ; valid FCrDNS in any case (even if it's not the one supplied as "Server\Name").
23
24 ; If you have a dynamic IP address, unfortunately you can't use your reverse hostname
25 ; as your server's name because it changes too often, and your server name MUST
26 ; always resolve to your actual IP, as mentioned above.
27
28 ; The "Alias" key is optional. You may use it to specify other destination domains for
29 ; your mail server.
30
31 ; Here's one example:
32
33 ;Name = example.org
34 ;Alias = example.com,example.net
35
36 ; According to the example above, this server will accept e-mails with recipient
37 ; addresses such as foobar@example.org, foobar@example.com, and foobar@example.net
38 ; as ones destinated to this server. All of the listed addresses will address the same
39 ; mailbox: "foobar" - unless domain-specific mailbox support is enabled (see below).
40
41 ; Another example:
42
43 ;Name = mx.mycutedomain.com
44 ;Alias = mycutedomain.com
45
46 ; For example, you'd like to run a mail service for mycutedomain.com on the host named
47 ; mx.mycutedomain.com. You need to add mx.mycutedomain.com as an MX record for
48 ; mycutedomain.com.
49
50 Name =
51
52
53 ; "ListenPort" is a list of port numbers MgSMTP will listen on. More than one port
54 ; numbers may be given, separated by commas. The standard (IANA-assigned) port for
55 ; SMTP service is 25.
56
57 ListenPort = 25
58
59
60 ; Use "TimeOffset" to set the timezone of your SMTP server. It is used to append
61 ; corrections to "Date" headers. Note that MgSMTP only appends a "Date" header to an
62 ; e-mail if it receives it without one present.
63 ; Most e-mail clients use the correction to show the e-mail's send time correctly.
64 ; Such corrections consist of 4 decimal digits, with the 2 more significant ones
65 ; denoting the hours and the 2 least significant ones denoting the minutes of offset.
66 ; This field is interpreted as an integer, so "200" and "+0200" do the same.
67 ; For example, if the server's clock runs in the timezone GMT+2:00, set "+0200" for
68 ; "TimeOffset". Negative numbers are also accepted, of course.
69 ; The "TimeCorrection" key previously used for this purpose is now deprecated, but still
70 ; interpreted if specified. If both "TimeCorrection" and "TimeOffset" keys are present,
71 ; then "TimeCorrection" will be ignored.
72
73 TimeOffset = +0000
74
75
76 ; The "Policies" switch enables or disables the enforcement of policy settings for
77 ; your server. If this option is disabled, MgSMTP will ignore any settings
78 ; specified under the "Policies" section, such as rule tables for hosts and users.
79 ; All hosts will get all rights by default. I really don't recommend to disable
80 ; "Policies", if your server is accessible from any untrusted network. If you
81 ; let your server to operate on the Internet with this option disabled, your mail
82 ; system will act as an open mail relay. Open relays are often used to broadcast SPAM,
83 ; thus they often get blacklisted!
84 ; Still, there is an option to disable policies, because it may be convenient for
85 ; testing and use on trusted networks.
86
87 Policies = On
88
89
90 ; The "Mailbox" switch enables or disables local mailboxes on your mail server.
91 ; If disabled, your server will never accept any e-mails those are addressed for
92 ; this server.
93
94 Mailbox = On
95
96
97 ; The "Relay" switch enables or disables the server's willingness to relay e-mails.
98 ; If you disable this option, your server in no circumstances will accept any
99 ; e-mails those need to be relayed. Even from hosts those are set to have the right
100 ; to relay by the policy settings.
101 ; Note, previously queued e-mails will still be relayed; and DSNs to be relayed may
102 ; still be generated internally.
103
104 Relay = Off
105
106
107 ; The "Log" switch enables or disables logging.
108
109 Log = On
110
111
112 ; The "Policies" section defines the policy settings for the server. Note, if you
113 ; have disabled the "Policies" switch above, the settings below will be ignored.
114
115 [Policies]
116
117 ; If "ReqHELO" is enabled, the server won't process any commands sent by the client
118 ; (except "AUTH") until it identifies itself with the "HELO" or "EHLO" command, as
119 ; the RFC for SMTP recommends it. Since MgSMTP will only use the reverse DNS of a
120 ; host (and its IP) to determine its rights, I don't think it's necessary to require
121 ; a HELO. However, I've never seen any mail delivery systems or e-mail clients those
122 ; don't start conversations with other systems with a HELO, so a client that doesn't
123 ; do so might be considered suspicious.
124
125 ReqHELO = Off
126
127
128 ; If "HideVersion" is enabled, MgSMTP will not reveal its version number in its
129 ; initial greeting. Though it will still report the fact that it's an "MgSMTP"
130 ; instance, however; and it will still reveal its version number in Delivery Status
131 ; Notification e-mails and in "Received" headers.
132
133 HideVersion = Off
134
135
136 ; "Users" enables or disables the user authentication feature. If disabled, the
137 ; software ignores the "Policies\Users" section (see below) completely, and won't
138 ; even report the AUTH feature in responses to EHLO commands.
139 ; If you enable "Users" here, but don't define user accounts below, that will have
140 ; the very same effect as you set "Off" here.
141
142 Users = Off
143
144
145 ; To prevent abuse, you can limit the number of AUTH attempts a client may make in
146 ; one session. After "MaxAuthAttempts" number of failed AUTH negotiations, the client
147 ; will get disconnected. Supply "0" if you don't want to limit AUTH attempts.
148 ; Though the client is free to connect again to make further attempts, but at least it
149 ; will stop some of those malicious bots.
150
151 MaxAuthAttempts = 4
152
153
154 ; The "FCrDNSPolicy" key tells MgSMTP whether to verify if the reverse hostnames of
155 ; connecting clients are forward-confirmed, and if so, how to handle the result.
156 ; Forward-confirmed reverse DNS means, if you take an IP and resolve its reverse name,
157 ; and then you resolve the IP for the resulting hostname, you get the original IP. This
158 ; is the expected situation. But technically it is possible that the results of reverse
159 ; and forward lookups are inconsistent. Basically, if you own a static IP, you may set
160 ; any reverse hostname (PTR record) for it. Even obscure ones like "i.am.the.king" and
161 ; stuff like that - actually it can be any string that the DNS protocol permits, it may
162 ; not even forward resolve at all.
163
164 ; The following values are permitted for "FCrDNSPolicy":
165 ; Naive - don't verify reverse hostnames at all
166 ; Aware - verify reverse hostnames, re-evaluate host rights by IP only if
167 ; an inconsistency is found
168 ; Mean - verify reverse hostnames, re-evaluate host rights by IP only if
169 ; an inconsistency is found, but disallow to acquire additional rights
170 ; Strict - verify reverse hostnames, disconnect the client if an inconsistency
171 ; is found
172
173 ; On LAN, you can go with "Naive". For DMZ hosts, the minimum you should set is "Aware".
174 ; The difference between "Aware" and "Mean" is that the latter won't let the host to
175 ; acquire rights those it wouldn't get if it had a forward-confirmed reverse hostname.
176 ; For example, you banned a host by its hostname, but you didn't ban it by its IP,
177 ; and the FCrDNS test fails on it. Then "Aware" would let the host in, because after
178 ; all it will completely ignore the fact that you've banned the host by hostname, since
179 ; that reverse name is invalid anyway. But "Mean" would take into account that you've
180 ; banned the host by hostname, and it would see that the host would actually get more
181 ; rights after the re-evaluation by IP only, and so it wouldn't let the host to get
182 ; those additional rights.
183 ; Use "Strict" if you wouldn't like to accept e-mails from hosts with invalid reverse
184 ; hostnames at all. In this case, such hosts will get disconnected with a permanent
185 ; failure SMTP reply code (554). Sadly there are legitimate mail servers out there
186 ; those have invalid reverse hostnames, thus banning all of them can be too radical,
187 ; you may lose legitimate e-mails by doing so. If you didn't understand anything of
188 ; this section, read back later.
189
190 ; Again, now in layman's terms: THIS IS A SECURITY MEASURE!
191 ; If you use "Naive", you allow hosts to trick your server to believe they are
192 ; connecting from elsewhere.
193 ; A drastical example is that you set "localhost = AllowStore,AllowRelay" in the
194 ; "Policies\Hosts" table below, thinking that this line only gives RELAY right to
195 ; "127.0.0.1". Then a malicious bot connects your SMTP server which happens to have
196 ; "localhost" as its reverse hostname. If you don't verify the validity of its reverse
197 ; DNS, then MgSMTP will grant it the RELAY right. If you verify its reverse DNS (i.e.
198 ; you have any other setting than "Naive"), you don't let yourself tricked.
199
200 FCrDNSPolicy = Aware
201
202
203 ; The "Policies\Hosts" section defines a list of rights assigned to specific hosts.
204 ; (Actually, it's an ACL.)
205 ; You may use wildcards in the hostnames, and you may also specify IPs. When a
206 ; client connects, MgSMTP will resolve its reverse DNS, and match that hostname and
207 ; the client's IP with the items on the list one by one. If it finds a line that
208 ; matches for either the hostname or the IP, the rights specified in that line will
209 ; be assigned to the connection.
210
211 ; The assigned rights are specified by lists of the following strings:
212 ; AllowStore - the host will be permitted to send messages destined to this server
213 ; DenyStore - the host will not be allowed to send messages to any local mailboxes
214 ; AllowRelay - the host will be permitted to send messages those need to be relayed
215 ; to another server
216 ; DenyRelay - the host can't send any e-mails destined to foreign servers
217 ; Disconnect - the host won't be allowed to communicate this server at all, any
218 ; connection from such host will be closed with a 554 response code
219
220 ; Note, in some cases it may be better to block unwanted systems by firewall settings
221 ; instead of assigning the "Disconnect" option to them.
222
223 ; Here's an example list:
224
225 ;[Policies\Hosts]
226 ;localhost = AllowStore,AllowRelay
227 ;192.168.1.* = AllowStore,AllowRelay
228 ;evil.com = Disconnect
229 ;*.dontlike.net = DenyStore,DenyRelay
230 ;* = AllowStore,DenyRelay
231
232 ; So "localhost" will have all permissions, such as all computers on the LAN
233 ; (assuming they are in the subnet 192.168.1.*). The host, evil.com, on the other
234 ; hand will be disconnected, so it won't be allowed to even greet the server. The
235 ; subdomains of dontlike.net will be allowed to communicate to the server, though
236 ; all messages will be rejected from them politely. Any other hosts will be permitted
237 ; to deliver messages destined to this server, but they won't be allowed to relay
238 ; e-mails through it.
239 ; Note, relaying towards hosts those are listed on the "RelayTo" list (see below, at
240 ; section "Relay") doesn't require the "RELAY" right; however it still requires the
241 ; "STORE" right. Don't worry if you don't get it here, just read on - it's explained
242 ; thoroughly somewhere below.
243
244 ; Here is your default "Policies\Hosts" list, you may change it if you want:
245
246 [Policies\Hosts]
247 localhost = AllowStore,AllowRelay
248 * = AllowStore,DenyRelay
249
250
251 ; The "Policies\Users" section is similar to the above-described "Policies\Hosts"
252 ; section in many ways. The difference, that it assigns rights for specific users,
253 ; who may authenticate themselves with the "AUTH LOGIN" command. Note, rights
254 ; assigned to users will completely override the rights assigned for hosts. What
255 ; does it mean? If a user connects from a host, such as foobar.dontlike.net from the
256 ; above example, she won't have any rights initially. But if she identifies herself
257 ; as user "LBurke", she will have all rights.
258 ; However, a user may even have more restrictive privileges that the connection will
259 ; permit them by default. For example, "Eli" connects from 192.168.1.32 (a host that
260 ; has full rights according to the above example), and authenticates herself. She'll
261 ; lose the "RELAY" right.
262 ; All user accounts must have a password set, see below.
263 ; A user account doesn't need to have a corresponding local mailbox, and generally,
264 ; user accounts have nothing to do with mailboxes.
265 ; Note, it is pointless to supply "Disconnect" in this ACL, because it won't be checked
266 ; and enforced after the user has been greeted. And obviously, if the host the user is
267 ; connecting from has "Disconnect" set in the "Policies\Hosts" ACL, the user won't be
268 ; able to authenticate because they'll get disconnected before they could attempt to.
269
270 ; Here's our example as an illustration:
271
272 ;[Policies\Users]
273 ;LBurke = AllowStore,AllowRelay
274 ;Eli = AllowStore,DenyRelay
275 ;SomeGroup = AllowStore,AllowRelay
276
277 ; And here you may add your own users:
278
279 [Policies\Users]
280
281
282 ; If you add users, you must set their passwords which they can authenticate with, in
283 ; "Policies\Users\<username>" sections. Passwords can be specified by plaintext or by
284 ; their MD5 checksums (the latter is more secure). Also, you can add alias usernames
285 ; for a user. (Though I must admit it's pretty useless since you can't supply distinct
286 ; passwords for them.)
287 ; You can even modify the databytes limit valid for a user - if a user authenticates,
288 ; their databytes limit completely overrides the default databytes limit given in the
289 ; "Spool" section. That means, the user's databytes limit can be either smaller or
290 ; larger than the default. Databytes limit is always specified in bytes. The detailed
291 ; description of "databytes limit" can be found somewhere below, under the "Spool"
292 ; section.
293
294 ; See the example settings for our example users:
295
296 ;[Policies\Users\LBurke]
297 ;Auth = On
298 ;Databytes = 134217728
299 ;PassType = md5
300 ;Password = 7947ba4e6c4bede8896b1c0e28d5f258
301 ;
302 ;[Policies\Users\Eli]
303 ;Auth = On
304 ;PassType = plain
305 ;Password = alwaysthirsty
306 ;
307 ;[Policies\Users\SomeGroup]
308 ;Auth = On
309 ;Databytes = 8388608
310 ;Alias = Monkey,Donkey,Hippo
311 ;PassType = plain
312 ;Password = LuckyAmI
313
314
315 ; The "Spool" section defines the behaviour of the message queue. All e-mails are
316 ; queued in the spool after they are received, even local messages. The reason why
317 ; local messages get queued instead of being delivered to the appropriate mailbox
318 ; immediately, is that mailboxes have to be locked when an e-mail is being delivered
319 ; to them. Thus, the mail server couldn't receive more than one e-mails for the same
320 ; mailbox at the same moment. Queueing even local messages allows the server to accept
321 ; multiple e-mails for the same mailbox at once.
322 ; The queue function can't be disabled.
323
324 [Spool]
325
326 ; The "Databytes" entry specifies the so-called databytes limit for incoming e-mails.
327 ; (I don't really know why is it actually called "databytes limit", but other mail
328 ; servers name it like that.)
329 ; Unlike mailbox quota, databytes limit sets the maximum size of a single e-mail that
330 ; the mail server is willing to process. The databytes limit set here may get
331 ; overridden for specific users who must authenticate themselves with "AUTH LOGIN".
332 ; (See "Policies\Users\<username>" sections above.)
333 ; The databytes limit is specified in bytes.
334
335 Databytes = 16777216
336
337
338 ; The "AllowExceedQuota" switch defines the policies of delivery to local mailboxes.
339 ; Assume that a particular mailbox's quota is almost exceeded. Then the mail server
340 ; receives an e-mail with a size that would surely take the mailbox over quota.
341 ; When "AllowExceedQuota" is enabled, the spool will deliver this e-mail to the
342 ; mailbox, so it allows it to exceed its quota. The next e-mail however will be
343 ; refused by the server with an error message (so that won't get into the spool).
344 ; If "AllowExceedQuota" is disabled, the spool won't let the mailbox to get over
345 ; quota, so it guarantees the mailbox will never be bigger than its quota. In that
346 ; case, the spool will generate a Delivery Status Notification to inform the sender
347 ; of the failure. E-mails may still be accepted by the server for such mailboxes,
348 ; they get the error message later. It is not a common technique.
349 ; If the sender is so kind that it supplies a SIZE declaration in its the MAIL command,
350 ; then the server will check the mailbox's quota and refuse the e-mail if it wouldn't
351 ; fit in, when "AllowExceedQuota" is disabled.
352 ; Note, as I see most mail servers allow their users to exceed their quotas with
353 ; one last e-mail.
354
355 AllowExceedQuota = On
356
357
358 ; "MaxReceivedHeaders" is invented to detect possible mail relay loops. In some cases,
359 ; if a mail server is configured incorrectly, it may relay some e-mails to itself, or
360 ; to another mail server that will relay the e-mail back, thus it will be stuck in an
361 ; infinite mail relay loop. To prevent mail relay loops to go far, MgSMTP counts the
362 ; "Received" headers of e-mails, and rejects messages those have "MaxReceivedHeaders"
363 ; or more number of "Received" headers.
364
365 MaxReceivedHeaders = 16
366
367
368 ; The "DeliveryThreads" key tells the spool how many delivery threads to start.
369 ; These threads constantly watch the spool for e-mails need to be delivered. If your
370 ; server has many messages in the spool, then all your threads get busy, and each
371 ; thread will try to deliver an e-mail. If you have 8 threads for example, then a
372 ; maximum of 8 e-mails will be delivered in paralell.
373 ; NOTE: To avoid collisions of delivery threads, possible first characters of spool
374 ; object names are assigned to specific threads. (Numbers 0-9 and letters A-Z.)
375 ; Thus, one thread will never try to open a spool object that another thread is
376 ; working on. The drawback of this feature is that it maximizes the number of delivery
377 ; threads to 36. If the maximum value is set, each threads will bother only with
378 ; spool objects those names start with one specific number or letter.
379
380 DeliveryThreads = 8
381
382
383 ; The "ThreadWait" key defines the "heartbeat" of your delivery threads. More
384 ; precisely, the threads will wait a "ThreadWait" number of milliseconds after it
385 ; glanced through the spool for deliverable e-mails, before it checks the spool again.
386 ; The more busy is your server, the smaller "ThreadWait" value you should have.
387 ; If your mail server is really busy, I suggest you to set a value less than 1000.
388 ; NOTE: If you find that your server has a pretty large CPU utilization even when it's
389 ; idle (no messages in spool), you should set a higher "ThreadWait" value.
390
391 ThreadWait = 1000
392
393
394 ; The "TryCount" value tells the spool how many times should it try to deliver a queued
395 ; message that has temporary failures. The server should keep trying for several days.
396 ; Use the "TryDelay" value to calculate the actual length of trying in time.
397
398 TryCount = 4320
399
400
401 ; The "TryDelay" value tells the spool the number of MINUTES it has to wait before
402 ; retrying to deliver an e-mail to recipients those failed with temporary errors at
403 ; previous attempts.
404
405 TryDelay = 2
406
407
408 ; The "TempFailNotifyFirst" switch tells MgSMTP whether to send a temporary failure
409 ; notice after the very first attempt of delivery (if that fails with a temporary
410 ; failure). It's not a common setting by the way.
411 ; According to my own experiences, this option comes really handy for testing relay
412 ; configuration, and it is useful when you get noticed that your e-mail delays,
413 ; even if it's because of greylisting on the target server.
414 ; But in some cases it can be very annoying when random folks out there receive
415 ; temporary failure notifications from your mail system at the first place, and in
416 ; the case if they don't know anything about how do SMTP networks work, they can
417 ; easily interpret your temporary failure notification as permanent...
418
419 TempFailNotifyFirst = On
420
421
422 ; MgSMTP sends temporary failure notices of undelivered messages after "TempFailNotify"
423 ; tries. If the setting is 1440 for example, a failure notice will be sent after
424 ; the 1440th try, then the 2880th try, then the 4320th try, and so on. If a number of
425 ; "TryCount" tries has been reached, a permanent failure notice will be sent in any
426 ; way, and the queued message will be administered and deleted as failed.
427
428 TempFailNotify = 1440
429
430
431 ; If "KeepProcessedEnvelopes" is enabled, MgSMTP will move the .DAT files of processed
432 ; e-mails to the "processed" directory, instead of removing them. There you can see
433 ; the final state of the "spool object"/".DAT file"/"envelope", or whatever you would
434 ; like to call it. The .DAT file is actually in INI format, it's quite easy to read and
435 ; understand.
436
437 KeepProcessedEnvelopes = Off
438
439
440 ; If "KeepProcessedEMails" is enabled, MgSMTP will move processed e-mails (stored in
441 ; .EML files) to the "processed" directory, instead of deleting them. Note, this
442 ; option actually allows you to see/archive all e-mails passed through your SMTP
443 ; server. If there are more people using your system, it may involve moral questions.
444 ; Moreover, if there are many large e-mails passing through your server, it may fill
445 ; up a lot of space in a short time.
446
447 KeepProcessedEMails = Off
448
449
450 ; The "Mailbox" section contains settings regarding local mailboxes.
451
452 [Mailbox]
453
454 ; This is the global quota setting - it will apply to any mailboxes those don't have
455 ; a specific quota set. If you set it to "0", the quotas will be unlimited.
456
457 Quota = 67108864
458
459
460 ; Enable plus aliases: allow an alias to be expanded to the mailbox name with a "+" sign.
461 ; E.g.: <foobar+cats@example.com> and <foobar+goats@example.com> will automatically
462 ; address the same mailbox without having to list them on an "Alias" list or anything.
463 ; You can safely make up as many +alias addresses as you want without having to change
464 ; the mail server config.
465 ; FYI: GMail also supports this, e.g. if you send e-mail to <yourgoogleid+alias@gmail.com>,
466 ; you will receive it into your mailbox at <yourgoogleid@gmail.com>.
467 ; If "PlusAliases" is turned off, "+" characters in mailbox addresses will not be treated
468 ; specially in any way.
469
470 PlusAliases = On
471
472
473 ; You have the opportunity to disable some plus aliases - e-mails destinated to such
474 ; aliases will be rejected.
475 ; In this example, e-mails to <you+spam@example.com> and <you+viagranews@example.com>
476 ; will be rejected, while other plus aliases like <you+cats@example.com> will continue
477 ; to work. This is useful when you start to get unsolicited e-mails to one of your
478 ; plus-aliased e-mail addresses, and you want to put an end on it: the best part is that
479 ; it won't affect other aliases for your mailbox.
480 ; "PlusAliasExcept" is the global, mail-server-wide setting, which will be default for
481 ; all mailboxes those don't have this directive, but will be completely overridden if
482 ; set for an individual mailbox.
483 ; "GlobalPlusAliasExcept" will be added to the "PlusAliasExcept" list of all individual
484 ; mailboxes.
485
486 ;PlusAliasExcept = spam,viagranews
487 ;GlobalPlusAliasExcept =
488
489
490 ; Below you can enable "domain-specific mailboxes", which allows you to set up a limited
491 ; form of virtual hosting. Assume your mail server is receiving e-mails for
492 ; yourdomain.com and otherdomain.com. Both of these domains are supplied at
493 ; "Server\Name" or "Server\Alias". Then you'd like to run 2 separate mailboxes for
494 ; info@yourdomain.com and info@otherdomain.com. If you simply create a file named
495 ; "info" in the "mail" directory, then both of the mentioned e-mail addresses will
496 ; address that single mailbox, while you want separate mailboxes.
497 ; The "DomainSpecific" option enables a feature that allows you to create mailboxes
498 ; those are only valid for a specific alias domain. To use it, create mailbox files in
499 ; the "mail" directory by supplying their domains as well: create files named
500 ; "info@yourdomain.com" and "info@otherdomain.com".
501 ; Note that this is not standard - it is not ensured that your e-mail client will be
502 ; able to read your mailbox files, or your POP3/IMAP server (if you have such - really,
503 ; if you have a suitable open-source POP3 or IMAP server for Windows, please tell me!)
504 ; will handle such mailboxes. The POP3 protocol, in fact, doesn't support virtual
505 ; hosting at all.
506
507 DomainSpecific = Off
508
509
510 ; Enable or disable the rewriting feature globally. If disabled, none of the
511 ; "RewriteTo" lines will be in effect. (See below.)
512
513 Rewrite = Off
514
515
516 ; Global "RewritePassThru" setting. It will be applied to all mailboxes on which you
517 ; don't set a "ForwardHeaders" value explicitly. (See individual mailboxes for
518 ; explanation.)
519
520 RewritePassThru = On
521
522
523 ; Default "RewriteTo" setting. Please only fill it if you really find it necessary.
524 ; In most cases, you'd better provide RewriteTo lists for individual mailboxes only.
525
526 ;RewriteTo =
527
528
529 ; Enable or disable the forwarding feature globally. If disabled, none of the
530 ; "ForwardTo" lines will be in effect. (See below.)
531
532 Forward = Off
533
534
535 ; Global "ForwardHeaders" setting. It will be applied to all mailboxes on which you
536 ; don't set a "ForwardHeaders" value explicitly. (See individual mailboxes for
537 ; explanation.)
538
539 ForwardHeaders = On
540
541
542 ; Default "Remail" setting for mailboxes. (See below.)
543
544 Remail = On
545
546
547 ; Default "StoreLocalCopy" setting for mailboxes. (See below.)
548
549 StoreLocalCopy = On
550
551
552 ; Default "ForwardTo" setting. Please only fill it if you really find it necessary.
553 ; In most cases, you'd better provide ForwardTo lists for individual mailboxes only.
554
555 ;ForwardTo =
556
557
558 ; "Mailbox\<name>" sections define settings for specific mailboxes. Note, it is not
559 ; mandatory to have such sections for all existing mailboxes. If there is nothing
560 ; specific to set for a mailbox, then it's useless to have a section for it here.
561 ; If you have sections for non-existent mailboxes, those will be ignored.
562
563 ; Here's an example section for a hypothethical mailbox named "foobar":
564
565 ;[Mailbox\foobar]
566 ;Quota = 8388608
567 ;Alias = moo,cow
568
569 ; Obviously, the "Quota" setting sets the quota for the specific mailbox. The "Alias"
570 ; list adds aliases to the mailbox, so it will be accessed by multiple names.
571
572 ; Rewriting and forwarding:
573
574 ;[Mailbox\info]
575 ;RewriteTo = you@gmail.com
576 ;RewritePassThru = On
577
578 ; The "info" mailbox above utilizes rewriting. Whenever the mail server receives an
579 ; e-mail for this mailbox, MgSMTP will also add "you@gmail.com" to the envelope as
580 ; recipient, as if the client would have sent the e-mail to that address too. (The
581 ; client doesn't need to have relay rights, rights are not checked upon rewriting.)
582 ; "RewritePassThru" controls whether the original recipient should be kept: if it's
583 ; "Off", the e-mail won't be delivered to the "info" mailbox, it will only be sent to
584 ; "you@gmail.com".
585 ; Be aware that rewriting is not recursive!
586 ; Also, since rewriting takes effect when an e-mail is received from a client,
587 ; rewriting won't be applied to internally generated e-mails (such as DSNs, forwarded
588 ; messages).
589
590 ;[Mailbox\monkey]
591 ;ForwardTo = you@gmail.com
592 ;ForwardHeaders = On
593 ;StoreLocalCopy = On
594
595 ; The "monkey" mailbox utilizes forwarding. When MgSMTP is about to deliver a message
596 ; to this mailbox, the message will be copied, and the copy will be sent to
597 ; "you@gmail.com". If "ForwardHeaders" is enabled, MgSMTP will add an "X-Forwarded-For"
598 ; and an "X-Forwarded-To" header to make this event traceable.
599 ; If "StoreLocalCopy" is disabled, the message won't be delivered to the originally
600 ; addressed "monkey" mailbox, it will be just forwarded on-the-fly.
601 ; In the case of forwarding, the original Return-Path will be used for the copied
602 ; message.
603
604 ;[Mailbox\donkey]
605 ;ForwardTo = you@gmail.com
606 ;ForwardHeaders = On
607 ;StoreLocalCopy = On
608 ;Remail = On
609
610 ; The "donkey" mailbox utilizes remailing. Remailing is pretty much like forwarding,
611 ; except that the Return-Path of the copied message will be replaced by the address
612 ; of the actual mailbox ("donkey@yourdomain.com", in this case). This has several
613 ; advantages:
614 ; - incidental failure notices will arrive to "donkey", instead of the unsuspecting
615 ; sender of the original message who should not be aware of the remailing (assume
616 ; "donkey" still visits his mailbox here as well for time to time, so he'll see his
617 ; failure notices);
618 ; - if the target domain uses the SPF SPAM filtering technique (GMail does, for
619 ; example), the result will depend on your domain's SPF record (which is controlled
620 ; by you, hopefully), and not on the original sender's one, which supposedly won't
621 ; designate your host as a permitted sender for their domain.
622 ; Remailing won't be applied to DSNs (or any e-mails with empty Return-Path), because
623 ; supplying a Return-Path for such a message could easily cause a remailing loop. Such
624 ; messages will be simply forwarded instead.
625
626 ; Note: Both "RewriteTo" and "ForwardTo" keys are lists, so you can supply multiple
627 ; addresses separated by commas. E.g.:
628 ; ForwardTo = jane@nowhere.com,jack@somewhereelse.com
629
630 ; ESSENTIAL DIFFERENCES BETWEEN REWRITING AND FORWARDING/REMAILING:
631 ; In the case of rewriting, the original message's envelope will get modified before the
632 ; server receives the e-mail. This means, rewriting happens before the message gets to
633 ; the spool. No headers can be added to track what was rewritten to what. The message
634 ; will seem like it was just relayed through your SMTP server, as if it was addressed to
635 ; the rewritten address originally.
636 ; On the other hand, forwarding happens after the message has been stored in the spool.
637 ; It happens when the spool delivers the message to the local recipient. Then the
638 ; message gets copied, and the copy will be sent to the forward addresses. The copy will
639 ; contain "X-Forwarded-*" headers (if "ForwardHeaders" is on), and an additional
640 ; "Received" header. If the original message has been actually stored to the originally
641 ; addressed mailbox as well (depends on "StoreLocalCopy"), a "Delivered-To" header will
642 ; be also present.
643
644 ; Rewriting is not recursive, while forwarding/remailing is. Rewriting won't apply to
645 ; internally generated e-mails (such as DSNs and forwarded messages), while forwarding
646 ; will.
647
648 ; Since forwarding/remailing is more traceable, and remailing also protects you from
649 ; negative SPF results, forwarding or remailing is usually more preferable over
650 ; rewriting. However, rewriting is a much simpler and resource cheaper operation than
651 ; forwarding. I suggest to use rewriting for addresses within your network, or to add
652 ; aliases for domain-specific mailboxes those belong to other alias domains. To forward
653 ; mail to other domains, use forwarding or remailing!
654
655 ; USING BOTH REWRITING AND FORWARDING ON A SINGLE MAILBOX:
656 ; It's possible, but "RewritePassThru" must be enabled to allow forwarding to apply!
657 ; (You can still have "StoreLocalCopy" off, if you don't want your message to be
658 ; actually delivered to the mailbox.)
659
660 ; Reply addresses and simple distribution lists:
661 ; As the following example shows, with the combination of "ForwardTo" and "ReplyTo",
662 ; it is possible to create simple, static distribution lists, where replies are
663 ; addressed back to the distribution list by default.
664 ; The value of "ReplyTo" will be inserted as a "Reply-To" header to the e-mails being
665 ; forwarded. Note, it will only affect forwarded e-mails: the local copy won't have
666 ; the "Reply-To" header.
667 ; There is a special value for "ReplyTo": "!". When used, it will be substituted with
668 ; the appropriate mailbox address (in this example, it is "party@example.com").
669
670 ;[Mailbox\party]
671 ;ForwardTo = benga@example.com,hugo@example.com,kitty@example.com
672 ;ReplyTo = Party Unit <party@example.com>
673 ; Or:
674 ;ReplyTo = !
675
676 ; Domain-specific mailboxes:
677
678 ;[Mailbox\@mydomain.tld]
679 ;Quota = 0
680 ;ForwardTo = littlekittens@yourdomain.tld
681 ;GlobalPlusAliasExcept = dogs
682
683 ;[Mailbox\info@otherdomain.com]
684 ;Alias = contact,information
685
686 ; Here are a some rules applying to domain-specific mailboxes:
687 ; - If you have an "info@otherdomain.com" file in your "mail" folder, then it will only
688 ; override the "info" mailbox, unless "info@otherdomain.com" has aliases. So the
689 ; mailbox "sam" will still receive e-mails for all alias domains (assuming there are
690 ; no domain-specific mailboxes with username "sam").
691 ; - If you have both "info" and "info@otherdomain.com" files in your "mail" folder, then
692 ; the former mailbox will still receive e-mails for all alias domains, except
693 ; otherdomain.com.
694 ; - If you have aliases for "info@otherdomain.com", those will be only valid for
695 ; otherdomain.com. The aliases for a domain-specific mailbox will override the normal
696 ; mailboxes with the corresponding names, see the 2nd point above.
697 ; - If you want to add aliases for domain-specific mailboxes those belong to other
698 ; domains (i.e. you want to add "monkey@xxdomain.com" as an alias for
699 ; "donkey@yydomain.com"), the normal "Alias" key won't work! In this case, you need to
700 ; use "RewriteTo" or "ForwardTo".
701 ; - Most mailbox-specific settings can be set under [Mailbox\@mydomain.tld] sections,
702 ; which makes them the default for the domain-specific mailboxes belong to the given
703 ; domain. This won't have an effect on mailboxes those are not domain-specific (i.e.
704 ; their mailbox file name doesn't have a "@" sign), even if they are addressed by
705 ; an alias domain.
706
707
708 ; The "Relay" section defines the server's relay rules.
709
710 [Relay]
711
712 ; The "RelayTo" list gives hostnames which the server is designated to relay towards.
713 ; Even hosts those don't have the RELAY right will be allowed to relay towards these
714 ; addresses. (However, those hosts still need to have the STORE right to be eligible
715 ; to relay to "RelayTo" addresses.) In an aspect, MgSMTP considers recipient addresses
716 ; destinating to a host listed on the "RelayTo" list as local.
717 ; You need to use this for setting up backup MX servers.
718 ; It can be also useful if you'd like to receive e-mails for a computer on your LAN.
719
720 ; RelayTo = abcdef.com,ghijkl.org
721
722
723 ; The "NoRelayTo" list is the exact opposite of the "RelayTo" list: it prevents
724 ; relaying to specific domains, even for clients those would be permitted to relay
725 ; otherwise.
726
727 ; NoRelayTo = forumspammer.net
728
729
730 ; The "Relay\Routes" section defines a routing table. You can specify a mask on the
731 ; left sides of each item of the list. On the right side, you can specify a host where
732 ; you would like to relay matching addresses. You can define a host by giving its
733 ; hostname, or by associating a symbolic name you choose. If you use a symbolic name,
734 ; you must expand the settings applying to that host in a distinct section (see below).
735 ; A special character may also be used: "!", it means e-mails for those hosts will be
736 ; relayed to the named host directly.
737
738 ; See this example:
739
740 ;[Relay\Routes]
741 ;donkey.net = monkey.org
742 ;*.lucky.com = !
743 ;foobar.com = foobar.com
744 ;* = MyISP
745
746 ;[Relay\Routes\foobar.com]
747 ;Port = 600
748
749 ;[Relay\Routes\MyISP]
750 ;Host = mail.myisp.net
751 ;Auth = On
752 ;Username = myusername
753 ;Password = mypassword
754
755 ; According to this example, e-mails addressed to host donkey.net will be relayed
756 ; to monkey.org. (So e-mails addressed to anything@donkey.net will be actually sent to
757 ; the MX-es of monkey.org.)
758 ; E-mails destined to whatever.lucky.com will be passed to the MX-es of
759 ; whatever.lucky.com, as it would be normal.
760 ; E-mails destined to foobar.com will be delivered to the MX-es of foobar.com, but
761 ; they will be connected on an alternate port (600).
762 ; Any other e-mails will be relayed through your ISP's SMTP, defined by the symbolic
763 ; name, "MyISP". Settings for "MyISP" are defined in a distinct section. There, the
764 ; real hostname of the ISP's SMTP server is specified. This SMTP server requires user
765 ; authentication, it is indicated by the "Auth" switch, and of course, the username
766 ; and the password need to be revealed as well. MgSMTP will authenticate itself with
767 ; "AUTH LOGIN" at the ISP's SMTP server when it relays e-mails through it.
768 ; Note, you don't have any option to store this password in an encrypted form. So it is
769 ; crucial to deny all unwanted users to view this file.
770
771 ; Here is your default routing table:
772
773 [Relay\Routes]
774 * = !
775
776
777 ; The "Log" section configures MgSMTP's logging behaviour.
778
779 [Log]
780
781 ; Maybe you are glad that there aren't a lot of things to be set here.
782 ; MgSMTP writes its log to "smtp.log" in its own directory. You can override this
783 ; default filename if you want.
784
785 Filename = smtp.log
786
787
788 ; That's all, folks. I told you, it's a minimal-featured SMTP server. But anyway, if
789 ; you miss something, tell me your ideas by sending an e-mail to
790 ; <megabrutal@mgsmtp.eu>.