bee29de4cf6f81cb32b2e0ee48cbcf1c6b293af8
[mgsmtp.git] / mgsmtp_server_example.ini
1 ; MegaBrutal's SMTP Server (MgSMTP)
2 ; Copyright (C) 2010-2011 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 ; Below you can enable "domain-specific mailboxes", which allows you to set up a limited
461 ; form of virtual hosting. Assume your mail server is receiving e-mails for
462 ; yourdomain.com and otherdomain.com. Both of these domains are supplied at
463 ; "Server\Name" or "Server\Alias". Then you'd like to run 2 separate mailboxes for
464 ; info@yourdomain.com and info@otherdomain.com. If you simply create a file named
465 ; "info" in the "mail" directory, then both of the mentioned e-mail addresses will
466 ; address that single mailbox, while you want separate mailboxes.
467 ; The "DomainSpecific" option enables a feature that allows you to create mailboxes
468 ; those are only valid for a specific alias domain. To use it, create mailbox files in
469 ; the "mail" directory by supplying their domains as well: create files named
470 ; "info@yourdomain.com" and "info@otherdomain.com".
471 ; Note that this is not standard - it is not ensured that your e-mail client will be
472 ; able to read your mailbox files, or your POP3/IMAP server (if you have such - really,
473 ; if you have a suitable open-source POP3 or IMAP server for Windows, please tell me!)
474 ; will handle such mailboxes. The POP3 protocol, in fact, doesn't support virtual
475 ; hosting at all.
476
477 DomainSpecific = Off
478
479
480 ; Enable or disable the rewriting feature globally. If disabled, none of the
481 ; "RewriteTo" lines will be in effect. (See below.)
482
483 Rewrite = Off
484
485
486 ; Global "RewritePassThru" setting. It will be applied to all mailboxes on which you
487 ; don't set a "ForwardHeaders" value explicitly. (See individual mailboxes for
488 ; explanation.)
489
490 RewritePassThru = On
491
492
493 ; Default "RewriteTo" setting. Please only fill it if you really find it necessary.
494 ; In most cases, you'd better provide RewriteTo lists for individual mailboxes only.
495
496 ;RewriteTo =
497
498
499 ; Enable or disable the forwarding feature globally. If disabled, none of the
500 ; "ForwardTo" lines will be in effect. (See below.)
501
502 Forward = Off
503
504
505 ; Global "ForwardHeaders" setting. It will be applied to all mailboxes on which you
506 ; don't set a "ForwardHeaders" value explicitly. (See individual mailboxes for
507 ; explanation.)
508
509 ForwardHeaders = On
510
511
512 ; Default "Remail" setting for mailboxes. (See below.)
513
514 Remail = On
515
516
517 ; Default "StoreLocalCopy" setting for mailboxes. (See below.)
518
519 StoreLocalCopy = On
520
521
522 ; Default "ForwardTo" setting. Please only fill it if you really find it necessary.
523 ; In most cases, you'd better provide ForwardTo lists for individual mailboxes only.
524
525 ;ForwardTo =
526
527
528 ; "Mailbox\<name>" sections define settings for specific mailboxes. Note, it is not
529 ; mandatory to have such sections for all existing mailboxes. If there is nothing
530 ; specific to set for a mailbox, then it's useless to have a section for it here.
531 ; If you have sections for non-existent mailboxes, those will be ignored.
532
533 ; Here's an example section for a hypothethical mailbox named "foobar":
534
535 ;[Mailbox\foobar]
536 ;Quota = 8388608
537 ;Alias = moo,cow
538
539 ; Obviously, the "Quota" setting sets the quota for the specific mailbox. The "Alias"
540 ; list adds aliases to the mailbox, so it will be accessed by multiple names.
541
542 ; Rewriting and forwarding:
543
544 ;[Mailbox\info]
545 ;RewriteTo = you@gmail.com
546 ;RewritePassThru = On
547
548 ; The "info" mailbox above utilizes rewriting. Whenever the mail server receives an
549 ; e-mail for this mailbox, MgSMTP will also add "you@gmail.com" to the envelope as
550 ; recipient, as if the client would have sent the e-mail to that address too. (The
551 ; client doesn't need to have relay rights, rights are not checked upon rewriting.)
552 ; "RewritePassThru" controls whether the original recipient should be kept: if it's
553 ; "Off", the e-mail won't be delivered to the "info" mailbox, it will only be sent to
554 ; "you@gmail.com".
555 ; Be aware that rewriting is not recursive!
556 ; Also, since rewriting takes effect when an e-mail is received from a client,
557 ; rewriting won't be applied to internally generated e-mails (such as DSNs, forwarded
558 ; messages).
559
560 ;[Mailbox\monkey]
561 ;ForwardTo = you@gmail.com
562 ;ForwardHeaders = On
563 ;StoreLocalCopy = On
564
565 ; The "monkey" mailbox utilizes forwarding. When MgSMTP is about to deliver a message
566 ; to this mailbox, the message will be copied, and the copy will be sent to
567 ; "you@gmail.com". If "ForwardHeaders" is enabled, MgSMTP will add an "X-Forwarded-For"
568 ; and an "X-Forwarded-To" header to make this event traceable.
569 ; If "StoreLocalCopy" is disabled, the message won't be delivered to the originally
570 ; addressed "monkey" mailbox, it will be just forwarded on-the-fly.
571 ; In the case of forwarding, the original Return-Path will be used for the copied
572 ; message.
573
574 ;[Mailbox\donkey]
575 ;ForwardTo = you@gmail.com
576 ;ForwardHeaders = On
577 ;StoreLocalCopy = On
578 ;Remail = On
579
580 ; The "donkey" mailbox utilizes remailing. Remailing is pretty much like forwarding,
581 ; except that the Return-Path of the copied message will be replaced by the address
582 ; of the actual mailbox ("donkey@yourdomain.com", in this case). This has several
583 ; advantages:
584 ; - incidental failure notices will arrive to "donkey", instead of the unsuspecting
585 ; sender of the original message who should not be aware of the remailing (assume
586 ; "donkey" still visits his mailbox here as well for time to time, so he'll see his
587 ; failure notices);
588 ; - if the target domain uses the SPF SPAM filtering technique (GMail does, for
589 ; example), the result will depend on your domain's SPF record (which is controlled
590 ; by you, hopefully), and not on the original sender's one, which supposedly won't
591 ; designate your host as a permitted sender for their domain.
592 ; Remailing won't be applied to DSNs (or any e-mails with empty Return-Path), because
593 ; supplying a Return-Path for such a message could easily cause a remailing loop. Such
594 ; messages will be simply forwarded instead.
595
596 ; Note: Both "RewriteTo" and "ForwardTo" keys are lists, so you can supply multiple
597 ; addresses separated by commas. E.g.:
598 ; ForwardTo = jane@nowhere.com,jack@somewhereelse.com
599
600 ; ESSENTIAL DIFFERENCES BETWEEN REWRITING AND FORWARDING/REMAILING:
601 ; In the case of rewriting, the original message's envelope will get modified before the
602 ; server receives the e-mail. This means, rewriting happens before the message gets to
603 ; the spool. No headers can be added to track what was rewritten to what. The message
604 ; will seem like it was just relayed through your SMTP server, as if it was addressed to
605 ; the rewritten address originally.
606 ; On the other hand, forwarding happens after the message has been stored in the spool.
607 ; It happens when the spool delivers the message to the local recipient. Then the
608 ; message gets copied, and the copy will be sent to the forward addresses. The copy will
609 ; contain "X-Forwarded-*" headers (if "ForwardHeaders" is on), and an additional
610 ; "Received" header. If the original message has been actually stored to the originally
611 ; addressed mailbox as well (depends on "StoreLocalCopy"), a "Delivered-To" header will
612 ; be also present.
613
614 ; Rewriting is not recursive, while forwarding/remailing is. Rewriting won't apply to
615 ; internally generated e-mails (such as DSNs and forwarded messages), while forwarding
616 ; will.
617
618 ; Since forwarding/remailing is more traceable, and remailing also protects you from
619 ; negative SPF results, forwarding or remailing is usually more preferable over
620 ; rewriting. However, rewriting is a much simpler and resource cheaper operation than
621 ; forwarding. I suggest to use rewriting for addresses within your network, or to add
622 ; aliases for domain-specific mailboxes those belong to other alias domains. To forward
623 ; mail to other domains, use forwarding or remailing!
624
625 ; USING BOTH REWRITING AND FORWARDING ON A SINGLE MAILBOX:
626 ; It's possible, but "RewritePassThru" must be enabled to allow forwarding to apply!
627 ; (You can still have "StoreLocalCopy" off, if you don't want your message to be
628 ; actually delivered to the mailbox.)
629
630 ; Domain-specific mailboxes:
631
632 ;[Mailbox\info@otherdomain.com]
633 ;Alias = contact,information
634
635 ; Here are a some rules applying to domain-specific mailboxes:
636 ; - If you have an "info@otherdomain.com" file in your "mail" folder, then it will only
637 ; override the "info" mailbox, unless "info@otherdomain.com" has aliases. So the
638 ; mailbox "sam" will still receive e-mails for all alias domains (assuming there are
639 ; no domain-specific mailboxes with username "sam").
640 ; - If you have both "info" and "info@otherdomain.com" files in your "mail" folder, then
641 ; the former mailbox will still receive e-mails for all alias domains, except
642 ; otherdomain.com.
643 ; - If you have aliases for "info@otherdomain.com", those will be only valid for
644 ; otherdomain.com. The aliases for a domain-specific mailbox will override the normal
645 ; mailboxes with the corresponding names, see the 2nd point above.
646 ; - If you want to add aliases for domain-specific mailboxes those belong to other
647 ; domains (i.e. you want to add "monkey@xxdomain.com" as an alias for
648 ; "donkey@yydomain.com"), the normal "Alias" key won't work! In this case, you need to
649 ; use "RewriteTo" or "ForwardTo".
650
651
652 ; The "Relay" section defines the server's relay rules.
653
654 [Relay]
655
656 ; The "RelayTo" list gives hostnames which the server is designated to relay towards.
657 ; Even hosts those don't have the RELAY right will be allowed to relay towards these
658 ; addresses. (However, those hosts still need to have the STORE right to be eligible
659 ; to relay to "RelayTo" addresses.) In an aspect, MgSMTP considers recipient addresses
660 ; destinating to a host listed on the "RelayTo" list as local.
661 ; You need to use this for setting up backup MX servers.
662 ; It can be also useful if you'd like to receive e-mails for a computer on your LAN.
663
664 ; RelayTo = abcdef.com,ghijkl.org
665
666
667 ; The "NoRelayTo" list is the exact opposite of the "RelayTo" list: it prevents
668 ; relaying to specific domains, even for clients those would be permitted to relay
669 ; otherwise.
670
671 ; NoRelayTo = forumspammer.net
672
673
674 ; The "Relay\Routes" section defines a routing table. You can specify a mask on the
675 ; left sides of each item of the list. On the right side, you can specify a host where
676 ; you would like to relay matching addresses. You can define a host by giving its
677 ; hostname, or by associating a symbolic name you choose. If you use a symbolic name,
678 ; you must expand the settings applying to that host in a distinct section (see below).
679 ; A special character may also be used: "!", it means e-mails for those hosts will be
680 ; relayed to the named host directly.
681
682 ; See this example:
683
684 ;[Relay\Routes]
685 ;donkey.net = monkey.org
686 ;*.lucky.com = !
687 ;foobar.com = foobar.com
688 ;* = MyISP
689
690 ;[Relay\Routes\foobar.com]
691 ;Port = 600
692
693 ;[Relay\Routes\MyISP]
694 ;Host = mail.myisp.net
695 ;Auth = On
696 ;Username = myusername
697 ;Password = mypassword
698
699 ; According to this example, e-mails addressed to host donkey.net will be relayed
700 ; to monkey.org. (So e-mails addressed to anything@donkey.net will be actually sent to
701 ; the MX-es of monkey.org.)
702 ; E-mails destined to whatever.lucky.com will be passed to the MX-es of
703 ; whatever.lucky.com, as it would be normal.
704 ; E-mails destined to foobar.com will be delivered to the MX-es of foobar.com, but
705 ; they will be connected on an alternate port (600).
706 ; Any other e-mails will be relayed through your ISP's SMTP, defined by the symbolic
707 ; name, "MyISP". Settings for "MyISP" are defined in a distinct section. There, the
708 ; real hostname of the ISP's SMTP server is specified. This SMTP server requires user
709 ; authentication, it is indicated by the "Auth" switch, and of course, the username
710 ; and the password need to be revealed as well. MgSMTP will authenticate itself with
711 ; "AUTH LOGIN" at the ISP's SMTP server when it relays e-mails through it.
712 ; Note, you don't have any option to store this password in an encrypted form. So it is
713 ; crucial to deny all unwanted users to view this file.
714
715 ; Here is your default routing table:
716
717 [Relay\Routes]
718 * = !
719
720
721 ; The "Log" section configures MgSMTP's logging behaviour.
722
723 [Log]
724
725 ; Maybe you are glad that there aren't a lot of things to be set here.
726 ; MgSMTP writes its log to "smtp.log" in its own directory. You can override this
727 ; default filename if you want.
728
729 Filename = smtp.log
730
731
732 ; That's all, folks. I told you, it's a minimal-featured SMTP server. But anyway, if
733 ; you miss something, tell me your ideas by sending an e-mail to
734 ; <megabrutal@mgsmtp.eu>.