<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Lâmôlabs &#187; mail</title>
	<atom:link href="http://www.lamolabs.org/blog/tag/mail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lamolabs.org/blog</link>
	<description>Lame Oh Labs .... Linux &#38; Tech! Is there anything else?</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:00:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Setup a Mail Server on CentOS 5</title>
		<link>http://www.lamolabs.org/blog/226/how-to-setup-a-mail-server-on-centos-5/</link>
		<comments>http://www.lamolabs.org/blog/226/how-to-setup-a-mail-server-on-centos-5/#comments</comments>
		<pubDate>Wed, 20 May 2009 05:51:06 +0000</pubDate>
		<dc:creator>slmingol</dc:creator>
				<category><![CDATA[tutorials]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[rhel]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.lamolabs.org/blog/?p=226</guid>
		<description><![CDATA[<p>This tutorial sets up and configures the following:</p>

<p>Primary packages</p>



sendmail
spamassassin
milter-greylist
GeoIP
clamav
spamassassin-milter
clamav-milter
dovecot




<p>Addons to spamassassin</p>



SPF
DKIM




<p>Optional Extras</p>



spf-milter




<p>NOTE: I&#8217;ll discuss how to setup the spf-milter, towards the end of this post but I now consider this an OPTIONAL package after talking with the maintainer of the city-fan.org repo, Paul Howarth. In talking with Paul, it turns out that spamassassin now has [...]]]></description>
			<content:encoded><![CDATA[<p>This tutorial sets up and configures the following:</p>

<p><strong>Primary packages</strong></p>


<ul>
<li>sendmail</li>
<li>spamassassin</li>
<li>milter-greylist</li>
<li>GeoIP</li>
<li>clamav</li>
<li>spamassassin-milter</li>
<li>clamav-milter</li>
<li>dovecot</li>
</ul>



<p><strong>Addons to spamassassin</strong></p>


<ul>
<li><span class="caps">SPF</span></li>
<li><span class="caps">DKIM</span></li>
</ul>



<p><strong>Optional Extras</strong></p>


<ul>
<li>spf-milter</li>
</ul>



<p><span class="caps">NOTE</span>: I&#8217;ll discuss how to setup the spf-milter, towards the end of this post but I now consider this an <strong><span class="caps">OPTIONAL</span></strong> package after talking with the maintainer of the <a href="http://www.city-fan.org/ftp/contrib/yum-repo/">city-fan.org repo</a>, Paul Howarth. In talking with Paul, it turns out that spamassassin now has the ability to perform <span class="caps">SPF </span>checks based on a sender&#8217;s domain and IP address. This makes installing the spf-milter redundant and unecessary.</p>

<h5>Getting Started</h5>

<p>I found this very helpful <span class="caps">YUM </span>repository, <a href="http://www.city-fan.org/ftp/contrib/yum-repo/">city-fan.org</a> that contains pretty much everything I needed to accomplish this, minus the ClamAV packages. For those I looked to another repository, <a href="http://dag.wieers.com/rpm/packages/rpmforge-release/">rpmforge</a>. To get started, I installed the repo rpm files below.</p>

<h5>Setting up city-fan.org repo</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22622"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p226code22"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># install yum repo package</span>
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.city-fan.org<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>yum-repo<span style="color: #000000; font-weight: bold;">/</span>city-fan.org-release-<span style="color: #000000;">1</span>-7.rhel5.noarch.rpm
&nbsp;
<span style="color: #666666; font-style: italic;"># import repo's GPG Key</span>
rpm <span style="color: #660033;">--import</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.city-fan.org<span style="color: #000000; font-weight: bold;">/</span>ftp<span style="color: #000000; font-weight: bold;">/</span>contrib<span style="color: #000000; font-weight: bold;">/</span>yum-repo<span style="color: #000000; font-weight: bold;">/</span>CITY-FAN.ORG-GPG-KEY
&nbsp;
<span style="color: #666666; font-style: italic;"># perform an initial update</span>
yum update</pre></td></tr></table></div>




<h5>Setting up rpmforge repo</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22623"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p226code23"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># install yum repo package</span>
rpm <span style="color: #660033;">-Uvh</span> http:<span style="color: #000000; font-weight: bold;">//</span>dag.wieers.com<span style="color: #000000; font-weight: bold;">/</span>rpm<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>rpmforge-release<span style="color: #000000; font-weight: bold;">/</span>rpmforge-release-0.3.6-1.el5.rf.i386.rpm
&nbsp;
<span style="color: #666666; font-style: italic;"># import repo's GPG Key</span>
rpm <span style="color: #660033;">--import</span> http:<span style="color: #000000; font-weight: bold;">//</span>dag.wieers.com<span style="color: #000000; font-weight: bold;">/</span>rpm<span style="color: #000000; font-weight: bold;">/</span>packages<span style="color: #000000; font-weight: bold;">/</span>RPM-GPG-KEY.dag.txt
&nbsp;
<span style="color: #666666; font-style: italic;"># perform an initial update</span>
yum update</pre></td></tr></table></div>




<h5>Setting up Spamassassin</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22624"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p226code24"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> spamassassin \
 spamass-milter</pre></td></tr></table></div>




<p><strong>Setup /etc/sysconfig/spamassassin</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22625"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p226code25"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Options to spamd</span>
<span style="color: #007800;">SPAMDOPTIONS</span>=<span style="color: #ff0000;">&quot;-d -c -m5 -H&quot;</span></pre></td></tr></table></div>




<p><strong>Setup /etc/sysconfig/spamass-milter</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22626"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p226code26"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Override for your different local config</span>
<span style="color: #666666; font-style: italic;">#SOCKET=/var/run/spamass-milter/spamass-milter.sock</span>
&nbsp;
<span style="color: #666666; font-style: italic;">### Standard parameters for spamass-milter are:</span>
<span style="color: #666666; font-style: italic;">### -P /var/run/spamass-milter.pid (PID file)</span>
<span style="color: #666666; font-style: italic;">###</span>
<span style="color: #666666; font-style: italic;">### Note that the -f parameter for running the milter in the background</span>
<span style="color: #666666; font-style: italic;">### is not required because the milter runs in a wrapper script that</span>
<span style="color: #666666; font-style: italic;">### backgrounds itself</span>
<span style="color: #666666; font-style: italic;">###</span>
<span style="color: #666666; font-style: italic;">### You may add another parameters here, see spamass-milter(1)</span>
<span style="color: #666666; font-style: italic;">#EXTRA_FLAGS=&quot;-m -r 15&quot;</span></pre></td></tr></table></div>




<p><strong>Add the following to sendmail.mc and re-make sendmail.cf</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22627"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p226code27"><pre class="bash" style="font-family:monospace;">dnl <span style="color: #000000; font-weight: bold;">**</span>
dnl <span style="color: #000000; font-weight: bold;">**</span> <span style="color: #7a0874; font-weight: bold;">enable</span> spamassassin-milter to scan <span style="color: #000000; font-weight: bold;">for</span> spam using spamassassin <span style="color: #000000; font-weight: bold;">**</span>
dnl <span style="color: #000000; font-weight: bold;">**</span>
INPUT_MAIL_FILTER<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span>spamassassin<span style="color: #ff0000;">', `S=unix:/var/run/spamass-milter/spamass-milter.sock, F=, T=C:15m;S:4m;R:4m;E:10m'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>dnl
define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span>confMILTER_MACROS_CONNECT<span style="color: #ff0000;">',`t, b, j, _, {daemon_name}, {if_name}, {if_addr}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>dnl
define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span>confMILTER_MACROS_HELO<span style="color: #ff0000;">',`s, {tls_version}, {cipher}, {cipher_bits}, {cert_subject}, {cert_issuer}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>dnl</pre></td></tr></table></div>




<h5>Setting up <span class="caps">SPF </span>(NOTE: used by spamassassin, <span class="caps">NOT </span>the milter!)</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22628"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p226code28"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># install perl-Mail-SPF</span>
yum <span style="color: #c20cb9; font-weight: bold;">install</span> perl-Mail-SPF
&nbsp;
<span style="color: #666666; font-style: italic;"># restart spamassassin (in order to detect the spf plugin)</span>
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>spamassassin restart</pre></td></tr></table></div>




<p>Spamassassin will automatically detect that <span class="caps">SPF </span>has been installed and will start using it as part of its scoring of each email. You can confirm that it&#8217;s working with this test.</p>


<div class="wp_codebox"><table width="100%" ><tr id="p22629"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p226code29"><pre class="bash" style="font-family:monospace;">spamassassin <span style="color: #660033;">-D</span> <span style="color: #000000; font-weight: bold;">&lt;</span>  <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>doc<span style="color: #000000; font-weight: bold;">/</span>spamassassin-3.2.5<span style="color: #000000; font-weight: bold;">/</span>sample-spam.txt 2<span style="color: #000000; font-weight: bold;">&gt;&amp;</span>1 <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> spf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: config: <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>spamassassin<span style="color: #000000; font-weight: bold;">/</span>25_spf.cf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: config: <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>spamassassin<span style="color: #000000; font-weight: bold;">/</span>60_whitelist_spf.cf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: plugin: loading Mail::SpamAssassin::Plugin::SPF from <span style="color: #000000; font-weight: bold;">@</span>INC
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: checking to see <span style="color: #000000; font-weight: bold;">if</span> the message has a Received-SPF header that we can use
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: using Mail::SPF <span style="color: #000000; font-weight: bold;">for</span> SPF checks
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: no suitable relay <span style="color: #000000; font-weight: bold;">for</span> spf use found, skipping SPF-helo check
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: already checked <span style="color: #000000; font-weight: bold;">for</span> Received-SPF headers, proceeding with DNS based checks
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18108<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: no suitable relay <span style="color: #000000; font-weight: bold;">for</span> spf use found, skipping SPF check
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">18108</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: spf: def_spf_whitelist_from: already checked spf and didn<span style="color: #ff0000;">'t get pass, skipping whitelist check
[18108] dbg: spf: whitelist_from_spf: already checked spf and didn'</span>t get pass, skipping whitelist check</pre></td></tr></table></div>




<h5>Setting up <span class="caps">DKIM</span></h5>

<p>This module implements the various components of the <span class="caps">DKIM </span>and DomainKeys message-signing and verifying standards for Internet mail. It currently tries to implement these specifications:<br />
 * <span class="caps">RFC4871, </span>for <span class="caps">DKIM</span><br />
 * <span class="caps">RFC4870, </span>for DomainKeys</p>


<div class="wp_codebox"><table width="100%" ><tr id="p22630"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p226code30"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> perl-Mail-DKIM</pre></td></tr></table></div>




<p>Spamassassin will automatically detect that <span class="caps">DKIM </span>has been installed and will start using it as part of its scoring of each email. I confirmed that it was working by sending myself an email from my gmail account and copying this email, make sure to include the full headers, into a text file. In my case I called this file test_email.txt.</p>


<div class="wp_codebox"><table width="100%" ><tr id="p22631"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p226code31"><pre class="bash" style="font-family:monospace;">spamassassin <span style="color: #660033;">-D</span> <span style="color: #000000; font-weight: bold;">&lt;</span> ~<span style="color: #000000; font-weight: bold;">/</span>sam2.txt 2<span style="color: #000000; font-weight: bold;">&gt;&amp;</span>1 <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-i</span> dk
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18334<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: config: <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>spamassassin<span style="color: #000000; font-weight: bold;">/</span>25_dkim.cf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18334<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: config: <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>spamassassin<span style="color: #000000; font-weight: bold;">/</span>60_whitelist_dk.cf
<span style="color: #7a0874; font-weight: bold;">&#91;</span>18334<span style="color: #7a0874; font-weight: bold;">&#93;</span> dbg: config: <span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>spamassassin<span style="color: #000000; font-weight: bold;">/</span>60_whitelist_dkim.cf
DKIM-Signature: <span style="color: #007800;">v</span>=<span style="color: #000000;">1</span>; <span style="color: #007800;">a</span>=rsa-sha256; <span style="color: #007800;">c</span>=relaxed<span style="color: #000000; font-weight: bold;">/</span>relaxed;
       	<span style="color: #007800;">bh</span>=8PW6kvDkcUGo7mGimEUrTlMVS5Y1dFw<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">IjjLn1WnNLw</span>=;</pre></td></tr></table></div>




<h5>Setting up GeoIP</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22632"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p226code32"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> GeoIP</pre></td></tr></table></div>




<p>This package will be leveraged by milter-greylist to perform greylisting based on geographic locations of the sender&#8217;s IP address.</p>

<h5>Setting up milter-greylist</h5>

<p>The latest version can be downloaded from this <a href="http://www.mailscanner.info/greylist.html">page</a></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22633"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p226code33"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>www.mailscanner.info<span style="color: #000000; font-weight: bold;">/</span>files<span style="color: #000000; font-weight: bold;">/</span>greylist<span style="color: #000000; font-weight: bold;">/</span>milter-greylist-4.0-4.jkf.el5.i386.rpm
yum <span style="color: #660033;">--nogpgcheck</span> <span style="color: #c20cb9; font-weight: bold;">install</span> milter-greylist-<span style="color: #000000;">4.0</span>-4.jkf.el5.i386.rpm</pre></td></tr></table></div>




<p><span id="more-226"></span><br />
h5. Setting up ClamAV</p>


<div class="wp_codebox"><table width="100%" ><tr id="p22634"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p226code34"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> clamav \
 clamav-db \
 clamav-milter \
 clamd</pre></td></tr></table></div>




<p><strong>Setup /etc/sysconfig/clamav-milter</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22635"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p226code35"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">### Simple config file for clamav-milter, you should</span>
<span style="color: #666666; font-style: italic;">### read the documentation and tweak it as you wish.</span>
&nbsp;
<span style="color: #007800;">CLAMAV_FLAGS</span>=<span style="color: #ff0000;">&quot;--config-file=/etc/clamav-milter.conf&quot;</span></pre></td></tr></table></div>




<p><strong>Setup /etc/clamav-milter.conf</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22636"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
</pre></td><td class="code" id="p226code36"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Example config file for clamav-milter</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Comment or remove the line below.</span>
<span style="color: #666666; font-style: italic;">#Example</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Main options</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Define the interface through which we communicate with sendmail</span>
<span style="color: #666666; font-style: italic;"># This option is mandatory! Possible formats are:</span>
<span style="color: #666666; font-style: italic;"># [[unix|local]:]/path/to/file - to specify a unix domain socket</span>
<span style="color: #666666; font-style: italic;"># inet:port@[hostname|ip-address] - to specify an ipv4 socket</span>
<span style="color: #666666; font-style: italic;"># inet6:port@[hostname|ip-address] - to specify an ipv6 socket</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no default</span>
MilterSocket unix:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clmilter.socket
<span style="color: #666666; font-style: italic;">#MilterSocket inet:7357</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Remove stale socket after unclean shutdown.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#FixStaleSocket yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Run as another user (clamav-milter must be started by root for this option to work)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: unset (don't drop privileges)</span>
User clamav
&nbsp;
<span style="color: #666666; font-style: italic;"># Initialize supplementary group access (clamav-milter must be started by root).</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
AllowSupplementaryGroups <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Waiting for data from clamd will timeout after this time (seconds).</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the timeout.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: 120</span>
<span style="color: #666666; font-style: italic;">#ReadTimeout 300</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't fork into background.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#Foreground yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Chroot to the specified directory.</span>
<span style="color: #666666; font-style: italic;"># Chrooting is performed just after reading the config file and before dropping privileges.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: unset (don't chroot)</span>
<span style="color: #666666; font-style: italic;">#Chroot /newroot</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option allows you to save a process identifier of the listening</span>
<span style="color: #666666; font-style: italic;"># daemon (main thread).</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
<span style="color: #666666; font-style: italic;">#PidFile /var/run/clamav-milter.pid</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Optional path to the global temporary directory.</span>
<span style="color: #666666; font-style: italic;"># Default: system specific (usually /tmp or /var/tmp).</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#TemporaryDirectory /var/tmp</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Clamd options</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Define the clamd socket to connect to for scanning.</span>
<span style="color: #666666; font-style: italic;"># This option is mandatory! Syntax:</span>
<span style="color: #666666; font-style: italic;"># ClamdSocket unix:path</span>
<span style="color: #666666; font-style: italic;"># ClamdSocket tcp:host:port</span>
<span style="color: #666666; font-style: italic;"># The first syntax specifies a local unix socket (needs an absolute path) e.g.:</span>
<span style="color: #666666; font-style: italic;">#     ClamdSocket unix:/var/run/clamd/clamd.socket</span>
<span style="color: #666666; font-style: italic;"># The second syntax specifies a tcp local or remote tcp socket: the</span>
<span style="color: #666666; font-style: italic;"># host can be a hostname or an ip address; the &quot;:port&quot; field is only required</span>
<span style="color: #666666; font-style: italic;"># for IPv6 addresses, otherwise it defaults to 3310</span>
<span style="color: #666666; font-style: italic;">#     ClamdSocket tcp:192.168.0.1</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># This option can be repeated several times with different sockets or even</span>
<span style="color: #666666; font-style: italic;"># with the same socket: clamd servers will be selected in a round-robin fashion.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no default</span>
ClamdSocket unix:<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamd.sock
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Exclusions</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Messages originating from these hosts/networks will not be scanned</span>
<span style="color: #666666; font-style: italic;"># This option takes a host(name)/mask pair in CIRD notation and can be</span>
<span style="color: #666666; font-style: italic;"># repeated several times. If &quot;/mask&quot; is omitted, a host is assumed.</span>
<span style="color: #666666; font-style: italic;"># To specify a locally orignated, non-smtp, email use the keyword &quot;local&quot;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: unset (scan everything regardless of the origin)</span>
<span style="color: #666666; font-style: italic;">#LocalNet local</span>
<span style="color: #666666; font-style: italic;">#LocalNet 192.168.0.0/24</span>
<span style="color: #666666; font-style: italic;">#LocalNet 1111:2222:3333::/48</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option specifies a file which contains a list of basic POSIX regular</span>
<span style="color: #666666; font-style: italic;"># expressions. Addresses (sent to or from - see below) matching these regexes</span>
<span style="color: #666666; font-style: italic;"># will not be scanned.  Optionally each line can start with the string &quot;From:&quot;</span>
<span style="color: #666666; font-style: italic;"># or &quot;To:&quot; (note: no whitespace after the colon) indicating if it is, </span>
<span style="color: #666666; font-style: italic;"># respectively, the sender or recipient that is to be whitelisted.</span>
<span style="color: #666666; font-style: italic;"># If the field is missing, &quot;To:&quot; is assumed.</span>
<span style="color: #666666; font-style: italic;"># Lines starting with #, : or ! are ignored.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default unset (no exclusion applied)</span>
<span style="color: #666666; font-style: italic;">#Whitelist /etc/whitelisted_addresses</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Messages from authenticated SMTP users matching this extended POSIX</span>
<span style="color: #666666; font-style: italic;"># regular expression (egrep-like) will not be scanned.</span>
<span style="color: #666666; font-style: italic;"># Note: this is the AUTH login name!</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: unset (no whitelisting based on SMTP auth)</span>
<span style="color: #666666; font-style: italic;">#SkipAuthenticated ^(tom|dick|henry)$</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Actions</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The following group of options controls the delievery process under</span>
<span style="color: #666666; font-style: italic;"># different circumstances.</span>
<span style="color: #666666; font-style: italic;"># The following actions are available:</span>
<span style="color: #666666; font-style: italic;"># - Accept</span>
<span style="color: #666666; font-style: italic;">#   The message is accepted for delievery</span>
<span style="color: #666666; font-style: italic;"># - Reject</span>
<span style="color: #666666; font-style: italic;">#   Immediately refuse delievery (a 5xx error is returned to the peer)</span>
<span style="color: #666666; font-style: italic;"># - Defer</span>
<span style="color: #666666; font-style: italic;">#   Return a temporary failure message (4xx) to the peer</span>
<span style="color: #666666; font-style: italic;"># - Blackhole (not available for OnFail)</span>
<span style="color: #666666; font-style: italic;">#   Like accept but the message is sent to oblivion</span>
<span style="color: #666666; font-style: italic;"># - Quarantine (not available for OnFail)</span>
<span style="color: #666666; font-style: italic;">#   Like accept but message is quarantined instead of being delivered</span>
<span style="color: #666666; font-style: italic;">#   In sendmail the quarantine queue can be examined via mailq -qQ</span>
<span style="color: #666666; font-style: italic;">#   For Postfix this causes the message to be accepted but placed on hold</span>
<span style="color: #666666; font-style: italic;"># </span>
<span style="color: #666666; font-style: italic;"># Action to be performed on clean messages (mostly useful for testing)</span>
<span style="color: #666666; font-style: italic;"># Default Accept</span>
<span style="color: #666666; font-style: italic;">#OnClean Accept</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Action to be performed on infected messages</span>
<span style="color: #666666; font-style: italic;"># Default: Quarantine</span>
<span style="color: #666666; font-style: italic;">#OnInfected Quarantine</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Action to be performed on error conditions (this includes failure to</span>
<span style="color: #666666; font-style: italic;"># allocate data structures, no scanners available, network timeouts,</span>
<span style="color: #666666; font-style: italic;"># unknown scanner replies and the like)</span>
<span style="color: #666666; font-style: italic;"># Default Defer</span>
<span style="color: #666666; font-style: italic;">#OnFail Defer</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option allows to set a specific rejection reason for infected messages</span>
<span style="color: #666666; font-style: italic;"># and it's therefore only useful together with &quot;OnInfected Reject&quot;</span>
<span style="color: #666666; font-style: italic;"># The string &quot;%v&quot;, if present, will be replaced with the virus name.</span>
<span style="color: #666666; font-style: italic;"># Default: MTA specific</span>
<span style="color: #666666; font-style: italic;">#RejectMsg </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If this option is set to Yes, an &quot;X-Virus-Scanned&quot; and an &quot;X-Virus-Status&quot;</span>
<span style="color: #666666; font-style: italic;"># headers will be attached to each processed message, possibly replacing</span>
<span style="color: #666666; font-style: italic;"># existing headers. </span>
<span style="color: #666666; font-style: italic;"># Default: No</span>
<span style="color: #666666; font-style: italic;">#AddHeader Yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Logging options</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Uncomment this option to enable logging.</span>
<span style="color: #666666; font-style: italic;"># LogFile must be writable for the user running daemon.</span>
<span style="color: #666666; font-style: italic;"># A full path is required.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
LogFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamav-milter.log
&nbsp;
<span style="color: #666666; font-style: italic;"># By default the log file is locked for writing - the lock protects against</span>
<span style="color: #666666; font-style: italic;"># running clamav-milter multiple times.</span>
<span style="color: #666666; font-style: italic;"># This option disables log file locking.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LogFileUnlock yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum size of the log file.</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)</span>
<span style="color: #666666; font-style: italic;"># and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size</span>
<span style="color: #666666; font-style: italic;"># in bytes just don't use modifiers.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: 1M</span>
LogFileMaxSize <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log time with each message.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
LogTime <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Use system logger (can work together with LogFile).</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
LogSyslog <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Specify the type of syslog messages - please refer to 'man syslog'</span>
<span style="color: #666666; font-style: italic;"># for facility names.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: LOG_LOCAL6</span>
<span style="color: #666666; font-style: italic;">#LogFacility LOG_MAIL</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable verbose logging.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LogVerbose yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option allows to tune what is logged when a message is infected.</span>
<span style="color: #666666; font-style: italic;"># Possible values are Off (the default - nothing is logged),</span>
<span style="color: #666666; font-style: italic;"># Basic (minimal info logged), Full (verbose info logged)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
<span style="color: #666666; font-style: italic;">#LogInfected Basic</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Limits</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Messages larger than this value won't be scanned.</span>
<span style="color: #666666; font-style: italic;"># Make sure this value is lower or equal than StreamMaxLength in clamd.conf</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: 25M</span>
<span style="color: #666666; font-style: italic;">#MaxFileSize 10M</span></pre></td></tr></table></div>




<p><strong>Setup /etc/clamd.conf</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22637"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
</pre></td><td class="code" id="p226code37"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Example config file for the Clam AV daemon</span>
<span style="color: #666666; font-style: italic;">## Please read the clamd.conf(5) manual before editing this file.</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># Comment or remove the line below.</span>
<span style="color: #666666; font-style: italic;">#Example</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Uncomment this option to enable logging.</span>
<span style="color: #666666; font-style: italic;"># LogFile must be writable for the user running daemon.</span>
<span style="color: #666666; font-style: italic;"># A full path is required.</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
LogFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamd.log
&nbsp;
<span style="color: #666666; font-style: italic;"># By default the log file is locked for writing - the lock protects against</span>
<span style="color: #666666; font-style: italic;"># running clamd multiple times (if want to run another clamd, please</span>
<span style="color: #666666; font-style: italic;"># copy the configuration file, change the LogFile variable, and run</span>
<span style="color: #666666; font-style: italic;"># the daemon with --config-file option).</span>
<span style="color: #666666; font-style: italic;"># This option disables log file locking.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LogFileUnlock yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum size of the log file.</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># You may use 'M' or 'm' for megabytes (1M = 1m = 1048576 bytes)</span>
<span style="color: #666666; font-style: italic;"># and 'K' or 'k' for kilobytes (1K = 1k = 1024 bytes). To specify the size</span>
<span style="color: #666666; font-style: italic;"># in bytes just don't use modifiers.</span>
<span style="color: #666666; font-style: italic;"># Default: 1M</span>
LogFileMaxSize <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log time with each message.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
LogTime <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Also log clean files. Useful in debugging but drastically increases the</span>
<span style="color: #666666; font-style: italic;"># log size.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LogClean yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Use system logger (can work together with LogFile).</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
LogSyslog <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Specify the type of syslog messages - please refer to 'man syslog'</span>
<span style="color: #666666; font-style: italic;"># for facility names.</span>
<span style="color: #666666; font-style: italic;"># Default: LOG_LOCAL6</span>
<span style="color: #666666; font-style: italic;">#LogFacility LOG_MAIL</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable verbose logging.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LogVerbose yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option allows you to save a process identifier of the listening</span>
<span style="color: #666666; font-style: italic;"># daemon (main thread).</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
PidFile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamd.pid
&nbsp;
<span style="color: #666666; font-style: italic;"># Optional path to the global temporary directory.</span>
<span style="color: #666666; font-style: italic;"># Default: system specific (usually /tmp or /var/tmp).</span>
TemporaryDirectory <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>tmp
&nbsp;
<span style="color: #666666; font-style: italic;"># Path to the database directory.</span>
<span style="color: #666666; font-style: italic;"># Default: hardcoded (depends on installation options)</span>
DatabaseDirectory <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>clamav
&nbsp;
<span style="color: #666666; font-style: italic;"># The daemon can work in local mode, network mode or both. </span>
<span style="color: #666666; font-style: italic;"># Due to security reasons we recommend the local mode.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Path to a local socket file the daemon will listen on.</span>
<span style="color: #666666; font-style: italic;"># Default: disabled (must be specified by a user)</span>
LocalSocket <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>clamav<span style="color: #000000; font-weight: bold;">/</span>clamd.sock
&nbsp;
<span style="color: #666666; font-style: italic;"># Remove stale socket after unclean shutdown.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
FixStaleSocket <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># TCP port address.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
TCPSocket <span style="color: #000000;">3310</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># TCP address.</span>
<span style="color: #666666; font-style: italic;"># By default we bind to INADDR_ANY, probably not wise.</span>
<span style="color: #666666; font-style: italic;"># Enable the following to provide some degree of protection</span>
<span style="color: #666666; font-style: italic;"># from the outside world.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
TCPAddr 127.0.0.1
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum length the queue of pending connections may grow to.</span>
<span style="color: #666666; font-style: italic;"># Default: 15</span>
MaxConnectionQueueLength <span style="color: #000000;">30</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Clamd uses FTP-like protocol to receive data from remote clients.</span>
<span style="color: #666666; font-style: italic;"># If you are using clamav-milter to balance load between remote clamd daemons</span>
<span style="color: #666666; font-style: italic;"># on firewall servers you may need to tune the options below.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Close the connection when the data size limit is exceeded.</span>
<span style="color: #666666; font-style: italic;"># The value should match your MTA's limit for a maximum attachment size.</span>
<span style="color: #666666; font-style: italic;"># Default: 25M</span>
<span style="color: #666666; font-style: italic;">#StreamMaxLength 10M</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Limit port range.</span>
<span style="color: #666666; font-style: italic;"># Default: 1024</span>
<span style="color: #666666; font-style: italic;">#StreamMinPort 30000</span>
<span style="color: #666666; font-style: italic;"># Default: 2048</span>
<span style="color: #666666; font-style: italic;">#StreamMaxPort 32000</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of threads running at the same time.</span>
<span style="color: #666666; font-style: italic;"># Default: 10</span>
MaxThreads <span style="color: #000000;">50</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Waiting for data from a client socket will timeout after this time (seconds).</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the timeout.</span>
<span style="color: #666666; font-style: italic;"># Default: 120</span>
ReadTimeout <span style="color: #000000;">300</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option specifies the time (in seconds) after which clamd should</span>
<span style="color: #666666; font-style: italic;"># timeout if a client doesn't provide any initial command after connecting.</span>
<span style="color: #666666; font-style: italic;"># Default: 5</span>
<span style="color: #666666; font-style: italic;">#CommandReadTimeout 5</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option specifies how long to wait (in miliseconds) if the send buffer is full.</span>
<span style="color: #666666; font-style: italic;"># Keep this value low to prevent clamd hanging</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: 500</span>
<span style="color: #666666; font-style: italic;">#SendBufTimeout 200</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of queued items (including those being processed by MaxThreads threads)</span>
<span style="color: #666666; font-style: italic;"># It is recommended to have this value at least twice MaxThreads if possible.</span>
<span style="color: #666666; font-style: italic;"># WARNING: you shouldn't increase this too much to avoid running out  of file descriptors,</span>
<span style="color: #666666; font-style: italic;"># the following condition should hold:</span>
<span style="color: #666666; font-style: italic;"># MaxThreads*MaxRecursion + (MaxQueue - MaxThreads) + 6&lt; RLIMIT_NOFILE (usual max is 1024)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: 100</span>
<span style="color: #666666; font-style: italic;">#MaxQueue 200</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Waiting for a new job will timeout after this time (seconds).</span>
<span style="color: #666666; font-style: italic;"># Default: 30</span>
<span style="color: #666666; font-style: italic;">#IdleTimeout 60</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't scan files and directories matching regex</span>
<span style="color: #666666; font-style: italic;"># This directive can be used multiple times</span>
<span style="color: #666666; font-style: italic;"># Default: scan all</span>
<span style="color: #666666; font-style: italic;">#ExcludePath ^/proc/</span>
<span style="color: #666666; font-style: italic;">#ExcludePath ^/sys/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum depth directories are scanned at.</span>
<span style="color: #666666; font-style: italic;"># Default: 15</span>
<span style="color: #666666; font-style: italic;">#MaxDirectoryRecursion 20</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Follow directory symlinks.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#FollowDirectorySymlinks yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Follow regular file symlinks.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#FollowFileSymlinks yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Perform a database check.</span>
<span style="color: #666666; font-style: italic;"># Default: 600 (10 min)</span>
<span style="color: #666666; font-style: italic;">#SelfCheck 600</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Execute a command when virus is found. In the command string %v will</span>
<span style="color: #666666; font-style: italic;"># be replaced with the virus name.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#VirusEvent /usr/local/bin/send_sms 123456789 &quot;VIRUS ALERT: %v&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Run as another user (clamd must be started by root for this option to work)</span>
<span style="color: #666666; font-style: italic;"># Default: don't drop privileges</span>
User clamav
&nbsp;
<span style="color: #666666; font-style: italic;"># Initialize supplementary group access (clamd must be started by root).</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
AllowSupplementaryGroups <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Stop daemon when libclamav reports out of memory condition.</span>
<span style="color: #666666; font-style: italic;">#ExitOnOOM yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't fork into background.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#Foreground yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable debug messages in libclamav.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#Debug yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Do not remove temporary files (for debug purposes).</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#LeaveTemporaryFiles yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Detect Possibly Unwanted Applications.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#DetectPUA yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Exclude a specific PUA category. This directive can be used multiple times.</span>
<span style="color: #666666; font-style: italic;"># See http://www.clamav.net/support/pua for the complete list of PUA</span>
<span style="color: #666666; font-style: italic;"># categories.</span>
<span style="color: #666666; font-style: italic;"># Default: Load all categories (if DetectPUA is activated)</span>
<span style="color: #666666; font-style: italic;">#ExcludePUA NetTool</span>
<span style="color: #666666; font-style: italic;">#ExcludePUA PWTool</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Only include a specific PUA category. This directive can be used multiple</span>
<span style="color: #666666; font-style: italic;"># times.</span>
<span style="color: #666666; font-style: italic;"># Default: Load all categories (if DetectPUA is activated)</span>
<span style="color: #666666; font-style: italic;">#IncludePUA Spy</span>
<span style="color: #666666; font-style: italic;">#IncludePUA Scanner</span>
<span style="color: #666666; font-style: italic;">#IncludePUA RAT</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># In some cases (eg. complex malware, exploits in graphic files, and others),</span>
<span style="color: #666666; font-style: italic;"># ClamAV uses special algorithms to provide accurate detection. This option</span>
<span style="color: #666666; font-style: italic;"># controls the algorithmic detection.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#AlgorithmicDetection yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Executable files</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># PE stands for Portable Executable - it's an executable file format used</span>
<span style="color: #666666; font-style: italic;"># in all 32 and 64-bit versions of Windows operating systems. This option allows</span>
<span style="color: #666666; font-style: italic;"># ClamAV to perform a deeper analysis of executable files and it's also</span>
<span style="color: #666666; font-style: italic;"># required for decompression of popular executable packers such as UPX, FSG,</span>
<span style="color: #666666; font-style: italic;"># and Petite.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
ScanPE <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Executable and Linking Format is a standard format for UN*X executables.</span>
<span style="color: #666666; font-style: italic;"># This option allows you to control the scanning of ELF files.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
ScanELF <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># With this option clamav will try to detect broken executables (both PE and</span>
<span style="color: #666666; font-style: italic;"># ELF) and mark them as Broken.Executable.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
DetectBrokenExecutables <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Documents</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option enables scanning of OLE2 files, such as Microsoft Office</span>
<span style="color: #666666; font-style: italic;"># documents and .msi files.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
ScanOLE2 <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option enables scanning within PDF files.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#ScanPDF yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Mail files</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable internal e-mail scanner.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
ScanMail <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If an email contains URLs ClamAV can download and scan them.</span>
<span style="color: #666666; font-style: italic;"># WARNING: This option may open your system to a DoS attack.</span>
<span style="color: #666666; font-style: italic;">#	   Never use it on loaded servers.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#MailFollowURLs no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Scan RFC1341 messages split over many emails.</span>
<span style="color: #666666; font-style: italic;"># You will need to periodically clean up $TemporaryDirectory/clamav-partial directory.</span>
<span style="color: #666666; font-style: italic;"># WARNING: This option may open your system to a DoS attack.</span>
<span style="color: #666666; font-style: italic;">#	   Never use it on loaded servers.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#ScanPartialMessages yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;"># With this option enabled ClamAV will try to detect phishing attempts by using</span>
<span style="color: #666666; font-style: italic;"># signatures.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#PhishingSignatures yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Scan URLs found in mails for phishing attempts using heuristics.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#PhishingScanURLs yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Always block SSL mismatches in URLs, even if the URL isn't in the database.</span>
<span style="color: #666666; font-style: italic;"># This can lead to false positives.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#PhishingAlwaysBlockSSLMismatch no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Always block cloaked URLs, even if URL isn't in database.</span>
<span style="color: #666666; font-style: italic;"># This can lead to false positives.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#PhishingAlwaysBlockCloak no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Allow heuristic match to take precedence.</span>
<span style="color: #666666; font-style: italic;"># When enabled, if a heuristic scan (such as phishingScan) detects</span>
<span style="color: #666666; font-style: italic;"># a possible virus/phish it will stop scan immediately. Recommended, saves CPU</span>
<span style="color: #666666; font-style: italic;"># scan-time.</span>
<span style="color: #666666; font-style: italic;"># When disabled, virus/phish detected by heuristic scans will be reported only at</span>
<span style="color: #666666; font-style: italic;"># the end of a scan. If an archive contains both a heuristically detected</span>
<span style="color: #666666; font-style: italic;"># virus/phish, and a real malware, the real malware will be reported</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Keep this disabled if you intend to handle &quot;*.Heuristics.*&quot; viruses </span>
<span style="color: #666666; font-style: italic;"># differently from &quot;real&quot; malware.</span>
<span style="color: #666666; font-style: italic;"># If a non-heuristically-detected virus (signature-based) is found first, </span>
<span style="color: #666666; font-style: italic;"># the scan is interrupted immediately, regardless of this config option.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#HeuristicScanPrecedence yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Data Loss Prevention (DLP)</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable the DLP module</span>
<span style="color: #666666; font-style: italic;"># Default: No</span>
<span style="color: #666666; font-style: italic;">#StructuredDataDetection yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option sets the lowest number of Credit Card numbers found in a file</span>
<span style="color: #666666; font-style: italic;"># to generate a detect.</span>
<span style="color: #666666; font-style: italic;"># Default: 3</span>
<span style="color: #666666; font-style: italic;">#StructuredMinCreditCardCount 5</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option sets the lowest number of Social Security Numbers found</span>
<span style="color: #666666; font-style: italic;"># in a file to generate a detect.</span>
<span style="color: #666666; font-style: italic;"># Default: 3</span>
<span style="color: #666666; font-style: italic;">#StructuredMinSSNCount 5</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># With this option enabled the DLP module will search for valid</span>
<span style="color: #666666; font-style: italic;"># SSNs formatted as xxx-yy-zzzz</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#StructuredSSNFormatNormal yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># With this option enabled the DLP module will search for valid</span>
<span style="color: #666666; font-style: italic;"># SSNs formatted as xxxyyzzzz</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#StructuredSSNFormatStripped yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## HTML</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Perform HTML normalisation and decryption of MS Script Encoder code.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
<span style="color: #666666; font-style: italic;">#ScanHTML yes</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Archives</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ClamAV can scan within archives and compressed files.</span>
<span style="color: #666666; font-style: italic;"># Default: yes</span>
ScanArchive <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Mark encrypted archives as viruses (Encrypted.Zip, Encrypted.RAR).</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
ArchiveBlockEncrypted no
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Limits</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The options below protect your system against Denial of Service attacks</span>
<span style="color: #666666; font-style: italic;"># using archive bombs.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># This option sets the maximum amount of data to be scanned for each input file.</span>
<span style="color: #666666; font-style: italic;"># Archives and other containers are recursively extracted and scanned up to this</span>
<span style="color: #666666; font-style: italic;"># value.</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit</span>
<span style="color: #666666; font-style: italic;"># Note: disabling this limit or setting it too high may result in severe damage</span>
<span style="color: #666666; font-style: italic;"># to the system.</span>
<span style="color: #666666; font-style: italic;"># Default: 100M</span>
<span style="color: #666666; font-style: italic;">#MaxScanSize 150M</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Files larger than this limit won't be scanned. Affects the input file itself</span>
<span style="color: #666666; font-style: italic;"># as well as files contained inside it (when the input file is an archive, a</span>
<span style="color: #666666; font-style: italic;"># document or some other kind of container).</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># Note: disabling this limit or setting it too high may result in severe damage</span>
<span style="color: #666666; font-style: italic;"># to the system.</span>
<span style="color: #666666; font-style: italic;"># Default: 25M</span>
<span style="color: #666666; font-style: italic;">#MaxFileSize 30M</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Nested archives are scanned recursively, e.g. if a Zip archive contains a RAR</span>
<span style="color: #666666; font-style: italic;"># file, all files within it will also be scanned. This options specifies how</span>
<span style="color: #666666; font-style: italic;"># deeply the process should be continued.</span>
<span style="color: #666666; font-style: italic;"># Note: disabling this limit or setting it too high may result in severe damage</span>
<span style="color: #666666; font-style: italic;"># to the system.</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># Default: 16</span>
<span style="color: #666666; font-style: italic;">#MaxRecursion 10</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Number of files to be scanned within an archive, a document, or any other</span>
<span style="color: #666666; font-style: italic;"># container file.</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># Note: disabling this limit or setting it too high may result in severe damage</span>
<span style="color: #666666; font-style: italic;"># to the system.</span>
<span style="color: #666666; font-style: italic;"># Default: 10000</span>
<span style="color: #666666; font-style: italic;">#MaxFiles 15000</span>
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Clamuko settings</span>
<span style="color: #666666; font-style: italic;">## WARNING: This is experimental software. It is very likely it will hang</span>
<span style="color: #666666; font-style: italic;">##	    up your system!!!</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable Clamuko. Dazuko (/dev/dazuko) must be configured and running.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#ClamukoScanOnAccess yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set access mask for Clamuko.</span>
<span style="color: #666666; font-style: italic;"># Default: no</span>
<span style="color: #666666; font-style: italic;">#ClamukoScanOnOpen yes</span>
<span style="color: #666666; font-style: italic;">#ClamukoScanOnClose yes</span>
<span style="color: #666666; font-style: italic;">#ClamukoScanOnExec yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set the include paths (all files inside them will be scanned). You can have</span>
<span style="color: #666666; font-style: italic;"># multiple ClamukoIncludePath directives but each directory must be added</span>
<span style="color: #666666; font-style: italic;"># in a seperate line.</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
<span style="color: #666666; font-style: italic;">#ClamukoIncludePath /home</span>
<span style="color: #666666; font-style: italic;">#ClamukoIncludePath /students</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set the exclude paths. All subdirectories are also excluded.</span>
<span style="color: #666666; font-style: italic;"># Default: disabled</span>
<span style="color: #666666; font-style: italic;">#ClamukoExcludePath /home/bofh</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't scan files larger than ClamukoMaxFileSize</span>
<span style="color: #666666; font-style: italic;"># Value of 0 disables the limit.</span>
<span style="color: #666666; font-style: italic;"># Default: 5M</span>
<span style="color: #666666; font-style: italic;">#ClamukoMaxFileSize 10M</span></pre></td></tr></table></div>




<h5>Setting up Dovecot</h5>


<div class="wp_codebox"><table width="100%" ><tr id="p22638"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p226code38"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> dovecot</pre></td></tr></table></div>




<p><strong>Setup /etc/dovecot.conf</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22639"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
</pre></td><td class="code" id="p226code39"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## Dovecot configuration file</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># &quot;dovecot -n&quot; command gives a clean output of the changed settings. Use it</span>
<span style="color: #666666; font-style: italic;"># instead of copy&amp;pasting this file when posting to the Dovecot mailing list.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># '#' character and everything after it is treated as comments. Extra spaces</span>
<span style="color: #666666; font-style: italic;"># and tabs are ignored. If you want to use either of these explicitly, put the</span>
<span style="color: #666666; font-style: italic;"># value inside quotes, eg.: key = &quot;# char and trailing whitespace  &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Default values are shown for each setting, it's not required to uncomment</span>
<span style="color: #666666; font-style: italic;"># any of the lines.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Base directory where to store runtime data.</span>
<span style="color: #666666; font-style: italic;">#base_dir = /var/run/dovecot/</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Protocols we want to be serving: imap imaps pop3 pop3s managesieve</span>
<span style="color: #666666; font-style: italic;"># If you only want to use dovecot-auth, you can set this to &quot;none&quot;.</span>
<span style="color: #666666; font-style: italic;">#protocols = imap imaps pop3 pop3s</span>
protocols = imap imaps pop3 pop3s
&nbsp;
<span style="color: #666666; font-style: italic;"># A space separated list of IP or host addresses where to listen in for</span>
<span style="color: #666666; font-style: italic;"># connections. &quot;*&quot; listens in all IPv4 interfaces. &quot;[::]&quot; listens in all IPv6</span>
<span style="color: #666666; font-style: italic;"># interfaces. Use &quot;*, [::]&quot; for listening both IPv4 and IPv6.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># If you want to specify ports for each service, you will need to configure</span>
<span style="color: #666666; font-style: italic;"># these settings inside the protocol imap/pop3/managesieve { ... } section, </span>
<span style="color: #666666; font-style: italic;"># so you can specify different ports for IMAP/POP3/MANAGESIEVE. For example:</span>
<span style="color: #666666; font-style: italic;">#   protocol imap {</span>
<span style="color: #666666; font-style: italic;">#     listen = *:10143</span>
<span style="color: #666666; font-style: italic;">#     ssl_listen = *:10943</span>
<span style="color: #666666; font-style: italic;">#     ..</span>
<span style="color: #666666; font-style: italic;">#   }</span>
<span style="color: #666666; font-style: italic;">#   protocol pop3 {</span>
<span style="color: #666666; font-style: italic;">#     listen = *:10100</span>
<span style="color: #666666; font-style: italic;">#     ..</span>
<span style="color: #666666; font-style: italic;">#   }</span>
<span style="color: #666666; font-style: italic;">#   protocol managesieve {</span>
<span style="color: #666666; font-style: italic;">#     listen = *:12000</span>
<span style="color: #666666; font-style: italic;">#     ..</span>
<span style="color: #666666; font-style: italic;">#   }</span>
<span style="color: #666666; font-style: italic;">#listen = *, [::]</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Disable LOGIN command and all other plaintext authentications unless</span>
<span style="color: #666666; font-style: italic;"># SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP</span>
<span style="color: #666666; font-style: italic;"># matches the local IP (ie. you're connecting from the same computer), the</span>
<span style="color: #666666; font-style: italic;"># connection is considered secure and plaintext authentication is allowed.</span>
<span style="color: #666666; font-style: italic;">#disable_plaintext_auth = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Should all IMAP and POP3 processes be killed when Dovecot master process</span>
<span style="color: #666666; font-style: italic;"># shuts down. Setting this to &quot;no&quot; means that Dovecot can be upgraded without</span>
<span style="color: #666666; font-style: italic;"># forcing existing client connections to close (although that could also be</span>
<span style="color: #666666; font-style: italic;"># a problem if the upgrade is eg. because of a security fix). This however</span>
<span style="color: #666666; font-style: italic;"># means that after master process has died, the client processes can't write</span>
<span style="color: #666666; font-style: italic;"># to log files anymore.</span>
<span style="color: #666666; font-style: italic;">#shutdown_clients = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Logging</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log file to use for error messages, instead of sending them to syslog.</span>
<span style="color: #666666; font-style: italic;"># /dev/stderr can be used to log into stderr.</span>
<span style="color: #666666; font-style: italic;">#log_path = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log file to use for informational and debug messages.</span>
<span style="color: #666666; font-style: italic;"># Default is the same as log_path.</span>
<span style="color: #666666; font-style: italic;">#info_log_path = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Prefix for each line written to log file. % codes are in strftime(3)</span>
<span style="color: #666666; font-style: italic;"># format.</span>
<span style="color: #666666; font-style: italic;">#log_timestamp = &quot;%b %d %H:%M:%S &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Syslog facility to use if you're logging to syslog. Usually if you don't</span>
<span style="color: #666666; font-style: italic;"># want to use &quot;mail&quot;, you'll use local0..local7. Also other standard</span>
<span style="color: #666666; font-style: italic;"># facilities are supported.</span>
<span style="color: #666666; font-style: italic;">#syslog_facility = mail</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## SSL settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># IP or host address where to listen in for SSL connections. Remember to also</span>
<span style="color: #666666; font-style: italic;"># add imaps and/or pop3s to protocols setting. Defaults to same as &quot;listen&quot;</span>
<span style="color: #666666; font-style: italic;"># setting if not specified.</span>
<span style="color: #666666; font-style: italic;">#ssl_listen =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># SSL/TLS support: yes, no, required. &lt;doc/wiki/SSL&gt;</span>
<span style="color: #666666; font-style: italic;">#ssl = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># PEM encoded X.509 SSL/TLS certificate and private key. They're opened before</span>
<span style="color: #666666; font-style: italic;"># dropping root privileges, so keep the key file unreadable by anyone but</span>
<span style="color: #666666; font-style: italic;"># root. Included doc/mkcert.sh can be used to easily generate self-signed</span>
<span style="color: #666666; font-style: italic;"># certificate, just make sure to update the domains in dovecot-openssl.cnf</span>
ssl_cert_file = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>certs<span style="color: #000000; font-weight: bold;">/</span>dovecot.pem
ssl_key_file = <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pki<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>dovecot.pem
&nbsp;
<span style="color: #666666; font-style: italic;"># If key file is password protected, give the password here. Alternatively</span>
<span style="color: #666666; font-style: italic;"># give it when starting dovecot with -p parameter. Since this file is often</span>
<span style="color: #666666; font-style: italic;"># world-readable, you may want to place this setting instead to a different</span>
<span style="color: #666666; font-style: italic;"># root owned 0600 file by using !include_try &lt;path&gt;.</span>
<span style="color: #666666; font-style: italic;">#ssl_key_password =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># File containing trusted SSL certificate authorities. Set this only if you</span>
<span style="color: #666666; font-style: italic;"># intend to use ssl_verify_client_cert=yes. The CAfile should contain the</span>
<span style="color: #666666; font-style: italic;"># CA-certificate(s) followed by the matching CRL(s).</span>
<span style="color: #666666; font-style: italic;">#ssl_ca_file = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Request client to send a certificate. If you also want to require it, set</span>
<span style="color: #666666; font-style: italic;"># ssl_require_client_cert=yes in auth section.</span>
<span style="color: #666666; font-style: italic;">#ssl_verify_client_cert = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Which field from certificate to use for username. commonName and</span>
<span style="color: #666666; font-style: italic;"># x500UniqueIdentifier are the usual choices. You'll also need to set</span>
<span style="color: #666666; font-style: italic;"># ssl_username_from_cert=yes.</span>
<span style="color: #666666; font-style: italic;">#ssl_cert_username_field = commonName</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># How often to regenerate the SSL parameters file. Generation is quite CPU</span>
<span style="color: #666666; font-style: italic;"># intensive operation. The value is in hours, 0 disables regeneration</span>
<span style="color: #666666; font-style: italic;"># entirely.</span>
<span style="color: #666666; font-style: italic;">#ssl_parameters_regenerate = 168</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># SSL ciphers to use</span>
<span style="color: #666666; font-style: italic;">#ssl_cipher_list = ALL:!LOW:!SSLv2</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Show protocol level SSL errors.</span>
<span style="color: #666666; font-style: italic;">#verbose_ssl = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Login processes</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># &lt;doc/wiki/LoginProcess.txt&gt;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Directory where authentication process places authentication UNIX sockets</span>
<span style="color: #666666; font-style: italic;"># which login needs to be able to connect to. The sockets are created when</span>
<span style="color: #666666; font-style: italic;"># running as root, so you don't have to worry about permissions. Note that</span>
<span style="color: #666666; font-style: italic;"># everything in this directory is deleted when Dovecot is started.</span>
<span style="color: #666666; font-style: italic;">#login_dir = /var/run/dovecot/login</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># chroot login process to the login_dir. Only reason not to do this is if you</span>
<span style="color: #666666; font-style: italic;"># wish to run the whole Dovecot without roots. &lt;doc/wiki/Rootless.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#login_chroot = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># User to use for the login process. Create a completely new user for this,</span>
<span style="color: #666666; font-style: italic;"># and don't use it anywhere else. The user must also belong to a group where</span>
<span style="color: #666666; font-style: italic;"># only it has access, it's used to control access for authentication process.</span>
<span style="color: #666666; font-style: italic;"># Note that this user is NOT used to access mails. &lt;doc/wiki/UserIds.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#login_user = dovecot</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set max. process size in megabytes. If you don't use</span>
<span style="color: #666666; font-style: italic;"># login_process_per_connection you might need to grow this.</span>
<span style="color: #666666; font-style: italic;">#login_process_size = 64</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Should each login be processed in it's own process (yes), or should one</span>
<span style="color: #666666; font-style: italic;"># login process be allowed to process multiple connections (no)? Yes is more</span>
<span style="color: #666666; font-style: italic;"># secure, espcially with SSL/TLS enabled. No is faster since there's no need</span>
<span style="color: #666666; font-style: italic;"># to create processes all the time.</span>
<span style="color: #666666; font-style: italic;">#login_process_per_connection = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Number of login processes to keep for listening new connections.</span>
<span style="color: #666666; font-style: italic;">#login_processes_count = 3</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of login processes to create. The listening process count</span>
<span style="color: #666666; font-style: italic;"># usually stays at login_processes_count, but when multiple users start logging</span>
<span style="color: #666666; font-style: italic;"># in at the same time more extra processes are created. To prevent fork-bombing</span>
<span style="color: #666666; font-style: italic;"># we check only once in a second if new processes should be created - if all</span>
<span style="color: #666666; font-style: italic;"># of them are used at the time, we double their amount until the limit set by</span>
<span style="color: #666666; font-style: italic;"># this setting is reached.</span>
<span style="color: #666666; font-style: italic;">#login_max_processes_count = 128</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of connections allowed per each login process. This setting</span>
<span style="color: #666666; font-style: italic;"># is used only if login_process_per_connection=no. Once the limit is reached,</span>
<span style="color: #666666; font-style: italic;"># the process notifies master so that it can create a new login process.</span>
<span style="color: #666666; font-style: italic;">#login_max_connections = 256</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Greeting message for clients.</span>
<span style="color: #666666; font-style: italic;">#login_greeting = Dovecot ready.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Space separated list of trusted network ranges. Connections from these</span>
<span style="color: #666666; font-style: italic;"># IPs are allowed to override their IP addresses and ports (for logging and</span>
<span style="color: #666666; font-style: italic;"># for authentication checks). disable_plaintext_auth is also ignored for</span>
<span style="color: #666666; font-style: italic;"># these networks. Typically you'd specify your IMAP proxy servers here.</span>
<span style="color: #666666; font-style: italic;">#login_trusted_networks =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Space-separated list of elements we want to log. The elements which have</span>
<span style="color: #666666; font-style: italic;"># a non-empty variable value are joined together to form a comma-separated</span>
<span style="color: #666666; font-style: italic;"># string.</span>
<span style="color: #666666; font-style: italic;">#login_log_format_elements = user=&lt;%u&gt; method=%m rip=%r lip=%l %c</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Login log format. %$ contains login_log_format_elements string, %s contains</span>
<span style="color: #666666; font-style: italic;"># the data we want to log.</span>
<span style="color: #666666; font-style: italic;">#login_log_format = %$: %s</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Mailbox locations and namespaces</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Location for users' mailboxes. This is the same as the old default_mail_env</span>
<span style="color: #666666; font-style: italic;"># setting. The default is empty, which means that Dovecot tries to find the</span>
<span style="color: #666666; font-style: italic;"># mailboxes automatically. This won't work if the user doesn't have any mail</span>
<span style="color: #666666; font-style: italic;"># yet, so you should explicitly tell Dovecot the full location.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># If you're using mbox, giving a path to the INBOX file (eg. /var/mail/%u)</span>
<span style="color: #666666; font-style: italic;"># isn't enough. You'll also need to tell Dovecot where the other mailboxes are</span>
<span style="color: #666666; font-style: italic;"># kept. This is called the &quot;root mail directory&quot;, and it must be the first</span>
<span style="color: #666666; font-style: italic;"># path given in the mail_location setting.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># There are a few special variables you can use, eg.:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#   %u - username</span>
<span style="color: #666666; font-style: italic;">#   %n - user part in user@domain, same as %u if there's no domain</span>
<span style="color: #666666; font-style: italic;">#   %d - domain part in user@domain, empty if there's no domain</span>
<span style="color: #666666; font-style: italic;">#   %h - home directory</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># See doc/wiki/Variables.txt for full list. Some examples:</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#   mail_location = maildir:~/Maildir</span>
<span style="color: #666666; font-style: italic;">#   mail_location = mbox:~/mail:INBOX=/var/mail/%u</span>
<span style="color: #666666; font-style: italic;">#   mail_location = mbox:/var/mail/%d/%1n/%n:INDEX=/var/indexes/%d/%1n/%n</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># &lt;doc/wiki/MailLocation.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#mail_location =</span>
mail_location = mbox:~<span style="color: #000000; font-weight: bold;">/</span>Mail:<span style="color: #007800;">INBOX</span>=<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/%</span>u<span style="color: #000000; font-weight: bold;">/</span>Mail<span style="color: #000000; font-weight: bold;">/</span>INBOX
&nbsp;
<span style="color: #666666; font-style: italic;"># If you need to set multiple mailbox locations or want to change default</span>
<span style="color: #666666; font-style: italic;"># namespace settings, you can do it by defining namespace sections.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You can have private, shared and public namespaces. Private namespaces</span>
<span style="color: #666666; font-style: italic;"># are for user's personal mails. Shared namespaces are for accessing other</span>
<span style="color: #666666; font-style: italic;"># users' mailboxes that have been shared. Public namespaces are for shared</span>
<span style="color: #666666; font-style: italic;"># mailboxes that are managed by sysadmin. If you create any shared or public</span>
<span style="color: #666666; font-style: italic;"># namespaces you'll typically want to enable ACL plugin also, otherwise all</span>
<span style="color: #666666; font-style: italic;"># users can access all the shared mailboxes, assuming they have permissions</span>
<span style="color: #666666; font-style: italic;"># on filesystem level to do so.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># REMEMBER: If you add any namespaces, the default namespace must be added</span>
<span style="color: #666666; font-style: italic;"># explicitly, ie. mail_location does nothing unless you have a namespace</span>
<span style="color: #666666; font-style: italic;"># without a location setting. Default namespace is simply done by having a</span>
<span style="color: #666666; font-style: italic;"># namespace with empty prefix.</span>
<span style="color: #666666; font-style: italic;">#namespace private {</span>
   <span style="color: #666666; font-style: italic;"># Hierarchy separator to use. You should use the same separator for all</span>
   <span style="color: #666666; font-style: italic;"># namespaces or some clients get confused. '/' is usually a good one.</span>
   <span style="color: #666666; font-style: italic;"># The default however depends on the underlying mail storage format.</span>
   <span style="color: #666666; font-style: italic;">#separator = </span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Prefix required to access this namespace. This needs to be different for</span>
   <span style="color: #666666; font-style: italic;"># all namespaces. For example &quot;Public/&quot;.</span>
   <span style="color: #666666; font-style: italic;">#prefix = </span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Physical location of the mailbox. This is in same format as</span>
   <span style="color: #666666; font-style: italic;"># mail_location, which is also the default for it.</span>
   <span style="color: #666666; font-style: italic;">#location =</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># There can be only one INBOX, and this setting defines which namespace</span>
   <span style="color: #666666; font-style: italic;"># has it.</span>
   <span style="color: #666666; font-style: italic;">#inbox = no</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># If namespace is hidden, it's not advertised to clients via NAMESPACE</span>
   <span style="color: #666666; font-style: italic;"># extension. You'll most likely also want to set list=no. This is mostly</span>
   <span style="color: #666666; font-style: italic;"># useful when converting from another server with different namespaces which</span>
   <span style="color: #666666; font-style: italic;"># you want to deprecate but still keep working. For example you can create</span>
   <span style="color: #666666; font-style: italic;"># hidden namespaces with prefixes &quot;~/mail/&quot;, &quot;~%u/mail/&quot; and &quot;mail/&quot;.</span>
   <span style="color: #666666; font-style: italic;">#hidden = yes</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Show the mailboxes under this namespace with LIST command. This makes the</span>
   <span style="color: #666666; font-style: italic;"># namespace visible for clients that don't support NAMESPACE extension.</span>
   <span style="color: #666666; font-style: italic;"># &quot;children&quot; value lists child mailboxes, but hides the namespace prefix.</span>
   <span style="color: #666666; font-style: italic;">#list = yes</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Namespace handles its own subscriptions. If set to &quot;no&quot;, the parent</span>
   <span style="color: #666666; font-style: italic;"># namespace handles them (empty prefix should always have this as &quot;yes&quot;)</span>
   <span style="color: #666666; font-style: italic;">#subscriptions = yes</span>
<span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Example shared namespace configuration</span>
<span style="color: #666666; font-style: italic;">#namespace shared {</span>
   <span style="color: #666666; font-style: italic;">#separator = /</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Mailboxes are visible under &quot;shared/user@domain/&quot;</span>
   <span style="color: #666666; font-style: italic;"># %%n, %%d and %%u are expanded to the destination user.</span>
   <span style="color: #666666; font-style: italic;">#prefix = shared/%%u/</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Mail location for other users' mailboxes. Note that %variables and ~/</span>
   <span style="color: #666666; font-style: italic;"># expands to the logged in user's data. %%n, %%d, %%u and %%h expand to the</span>
   <span style="color: #666666; font-style: italic;"># destination user's data.</span>
   <span style="color: #666666; font-style: italic;">#location = maildir:%%h/Maildir:INDEX=~/Maildir/shared/%%u</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># Use the default namespace for saving subscriptions.</span>
   <span style="color: #666666; font-style: italic;">#subscriptions = no</span>
&nbsp;
   <span style="color: #666666; font-style: italic;"># List the shared/ namespace only if there are visible shared mailboxes.</span>
   <span style="color: #666666; font-style: italic;">#list = children</span>
<span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># System user and group used to access mails. If you use multiple, userdb</span>
<span style="color: #666666; font-style: italic;"># can override these by returning uid or gid fields. You can use either numbers</span>
<span style="color: #666666; font-style: italic;"># or names. &lt;doc/wiki/UserIds&gt;</span>
<span style="color: #666666; font-style: italic;">#mail_uid =</span>
<span style="color: #666666; font-style: italic;">#mail_gid =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Group to enable temporarily for privileged operations. Currently this is</span>
<span style="color: #666666; font-style: italic;"># used only with INBOX when either its initial creation or dotlocking fails.</span>
<span style="color: #666666; font-style: italic;"># Typically this is set to &quot;mail&quot; to give access to /var/mail.</span>
<span style="color: #666666; font-style: italic;">#mail_privileged_group =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Grant access to these supplementary groups for mail processes. Typically</span>
<span style="color: #666666; font-style: italic;"># these are used to set up access to shared mailboxes. Note that it may be</span>
<span style="color: #666666; font-style: italic;"># dangerous to set these if users can create symlinks (e.g. if &quot;mail&quot; group is</span>
<span style="color: #666666; font-style: italic;"># set here, ln -s /var/mail ~/mail/var could allow a user to delete others'</span>
<span style="color: #666666; font-style: italic;"># mailboxes, or ln -s /secret/shared/box ~/mail/mybox would allow reading it).</span>
<span style="color: #666666; font-style: italic;">#mail_access_groups =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Allow full filesystem access to clients. There's no access checks other than</span>
<span style="color: #666666; font-style: italic;"># what the operating system does for the active UID/GID. It works with both</span>
<span style="color: #666666; font-style: italic;"># maildir and mboxes, allowing you to prefix mailboxes names with eg. /path/</span>
<span style="color: #666666; font-style: italic;"># or ~user/.</span>
<span style="color: #666666; font-style: italic;">#mail_full_filesystem_access = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Mail processes</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Enable mail process debugging. This can help you figure out why Dovecot</span>
<span style="color: #666666; font-style: italic;"># isn't finding your mails.</span>
<span style="color: #666666; font-style: italic;">#mail_debug = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Log prefix for mail processes. See doc/wiki/Variables.txt for list of</span>
<span style="color: #666666; font-style: italic;"># possible variables you can use.</span>
<span style="color: #666666; font-style: italic;">#mail_log_prefix = &quot;%Us(%u): &quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Max. number of lines a mail process is allowed to log per second before it's</span>
<span style="color: #666666; font-style: italic;"># throttled. 0 means unlimited. Typically there's no need to change this</span>
<span style="color: #666666; font-style: italic;"># unless you're using mail_log plugin, which may log a lot. This setting is</span>
<span style="color: #666666; font-style: italic;"># ignored while mail_debug=yes to avoid pointless throttling.</span>
<span style="color: #666666; font-style: italic;">#mail_log_max_lines_per_sec = 10</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't use mmap() at all. This is required if you store indexes to shared</span>
<span style="color: #666666; font-style: italic;"># filesystems (NFS or clustered filesystem).</span>
<span style="color: #666666; font-style: italic;">#mmap_disable = no</span>
mmap_disable = <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL</span>
<span style="color: #666666; font-style: italic;"># since version 3, so this should be safe to use nowadays by default.</span>
<span style="color: #666666; font-style: italic;">#dotlock_use_excl = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Don't use fsync() or fdatasync() calls. This makes the performance better</span>
<span style="color: #666666; font-style: italic;"># at the cost of potential data loss if the server (or the file server)</span>
<span style="color: #666666; font-style: italic;"># goes down.</span>
<span style="color: #666666; font-style: italic;">#fsync_disable = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Mail storage exists in NFS. Set this to yes to make Dovecot flush NFS caches</span>
<span style="color: #666666; font-style: italic;"># whenever needed. If you're using only a single mail server this isn't needed.</span>
<span style="color: #666666; font-style: italic;">#mail_nfs_storage = no</span>
mail_nfs_storage = <span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #666666; font-style: italic;"># Mail index files also exist in NFS. Setting this to yes requires</span>
<span style="color: #666666; font-style: italic;"># mmap_disable=yes and fsync_disable=no.</span>
<span style="color: #666666; font-style: italic;">#mail_nfs_index = no</span>
mail_nfs_index = <span style="color: #c20cb9; font-weight: bold;">yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Locking method for index files. Alternatives are fcntl, flock and dotlock.</span>
<span style="color: #666666; font-style: italic;"># Dotlocking uses some tricks which may create more disk I/O than other locking</span>
<span style="color: #666666; font-style: italic;"># methods. NFS users: flock doesn't work, remember to change mmap_disable.</span>
<span style="color: #666666; font-style: italic;">#lock_method = fcntl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Drop all privileges before exec()ing the mail process. This is mostly</span>
<span style="color: #666666; font-style: italic;"># meant for debugging, otherwise you don't get core dumps. It could be a small</span>
<span style="color: #666666; font-style: italic;"># security risk if you use single UID for multiple users, as the users could</span>
<span style="color: #666666; font-style: italic;"># ptrace() each others processes then.</span>
<span style="color: #666666; font-style: italic;">#mail_drop_priv_before_exec = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Show more verbose process titles (in ps). Currently shows user name and</span>
<span style="color: #666666; font-style: italic;"># IP address. Useful for seeing who are actually using the IMAP processes</span>
<span style="color: #666666; font-style: italic;"># (eg. shared mailboxes or if same uid is used for multiple accounts).</span>
<span style="color: #666666; font-style: italic;">#verbose_proctitle = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Valid UID range for users, defaults to 500 and above. This is mostly</span>
<span style="color: #666666; font-style: italic;"># to make sure that users can't log in as daemons or other system users.</span>
<span style="color: #666666; font-style: italic;"># Note that denying root logins is hardcoded to dovecot binary and can't</span>
<span style="color: #666666; font-style: italic;"># be done even if first_valid_uid is set to 0.</span>
<span style="color: #666666; font-style: italic;">#first_valid_uid = 500</span>
<span style="color: #666666; font-style: italic;">#last_valid_uid = 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Valid GID range for users, defaults to non-root/wheel. Users having</span>
<span style="color: #666666; font-style: italic;"># non-valid GID as primary group ID aren't allowed to log in. If user</span>
<span style="color: #666666; font-style: italic;"># belongs to supplementary groups with non-valid GIDs, those groups are</span>
<span style="color: #666666; font-style: italic;"># not set.</span>
<span style="color: #666666; font-style: italic;">#first_valid_gid = 1</span>
<span style="color: #666666; font-style: italic;">#last_valid_gid = 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of running mail processes. When this limit is reached,</span>
<span style="color: #666666; font-style: italic;"># new users aren't allowed to log in.</span>
<span style="color: #666666; font-style: italic;">#max_mail_processes = 512</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set max. process size in megabytes. Most of the memory goes to mmap()ing</span>
<span style="color: #666666; font-style: italic;"># files, so it shouldn't harm much even if this limit is set pretty high.</span>
<span style="color: #666666; font-style: italic;">#mail_process_size = 256</span>
mail_process_size = <span style="color: #000000;">0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum allowed length for mail keyword name. It's only forced when trying</span>
<span style="color: #666666; font-style: italic;"># to create new keywords.</span>
<span style="color: #666666; font-style: italic;">#mail_max_keyword_length = 50</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># ':' separated list of directories under which chrooting is allowed for mail</span>
<span style="color: #666666; font-style: italic;"># processes (ie. /var/mail will allow chrooting to /var/mail/foo/bar too).</span>
<span style="color: #666666; font-style: italic;"># This setting doesn't affect login_chroot, mail_chroot or auth chroot</span>
<span style="color: #666666; font-style: italic;"># settings. If this setting is empty, &quot;/./&quot; in home dirs are ignored.</span>
<span style="color: #666666; font-style: italic;"># WARNING: Never add directories here which local users can modify, that</span>
<span style="color: #666666; font-style: italic;"># may lead to root exploit. Usually this should be done only if you don't</span>
<span style="color: #666666; font-style: italic;"># allow shell access for users. &lt;doc/wiki/Chrooting.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#valid_chroot_dirs = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Default chroot directory for mail processes. This can be overridden for</span>
<span style="color: #666666; font-style: italic;"># specific users in user database by giving /./ in user's home directory</span>
<span style="color: #666666; font-style: italic;"># (eg. /home/./user chroots into /home). Note that usually there is no real</span>
<span style="color: #666666; font-style: italic;"># need to do chrooting, Dovecot doesn't allow users to access files outside</span>
<span style="color: #666666; font-style: italic;"># their mail directory anyway. If your home directories are prefixed with</span>
<span style="color: #666666; font-style: italic;"># the chroot directory, append &quot;/.&quot; to mail_chroot. &lt;doc/wiki/Chrooting.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#mail_chroot = </span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Mailbox handling optimizations</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># The minimum number of mails in a mailbox before updates are done to cache</span>
<span style="color: #666666; font-style: italic;"># file. This allows optimizing Dovecot's behavior to do less disk writes at</span>
<span style="color: #666666; font-style: italic;"># the cost of more disk reads.</span>
<span style="color: #666666; font-style: italic;">#mail_cache_min_mail_count = 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># When IDLE command is running, mailbox is checked once in a while to see if</span>
<span style="color: #666666; font-style: italic;"># there are any new mails or other changes. This setting defines the minimum</span>
<span style="color: #666666; font-style: italic;"># time in seconds to wait between those checks. Dovecot can also use dnotify,</span>
<span style="color: #666666; font-style: italic;"># inotify and kqueue to find out immediately when changes occur.</span>
<span style="color: #666666; font-style: italic;">#mailbox_idle_check_interval = 30</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Save mails with CR+LF instead of plain LF. This makes sending those mails</span>
<span style="color: #666666; font-style: italic;"># take less CPU, especially with sendfile() syscall with Linux and FreeBSD.</span>
<span style="color: #666666; font-style: italic;"># But it also creates a bit more disk I/O which may just make it slower.</span>
<span style="color: #666666; font-style: italic;"># Also note that if other software reads the mboxes/maildirs, they may handle</span>
<span style="color: #666666; font-style: italic;"># the extra CRs wrong and cause problems.</span>
<span style="color: #666666; font-style: italic;">#mail_save_crlf = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Maildir-specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># By default LIST command returns all entries in maildir beginning with a dot.</span>
<span style="color: #666666; font-style: italic;"># Enabling this option makes Dovecot return only entries which are directories.</span>
<span style="color: #666666; font-style: italic;"># This is done by stat()ing each entry, so it causes more disk I/O.</span>
<span style="color: #666666; font-style: italic;"># (For systems setting struct dirent-&gt;d_type, this check is free and it's</span>
<span style="color: #666666; font-style: italic;"># done always regardless of this setting)</span>
<span style="color: #666666; font-style: italic;">#maildir_stat_dirs = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># When copying a message, do it with hard links whenever possible. This makes</span>
<span style="color: #666666; font-style: italic;"># the performance much better, and it's unlikely to have any side effects.</span>
<span style="color: #666666; font-style: italic;">#maildir_copy_with_hardlinks = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># When copying a message, try to preserve the base filename. Only if the</span>
<span style="color: #666666; font-style: italic;"># destination mailbox already contains the same name (ie. the mail is being</span>
<span style="color: #666666; font-style: italic;"># copied there twice), a new name is given. The destination filename check is</span>
<span style="color: #666666; font-style: italic;"># done only by looking at dovecot-uidlist file, so if something outside</span>
<span style="color: #666666; font-style: italic;"># Dovecot does similar filename preserving copies, you may run into problems.</span>
<span style="color: #666666; font-style: italic;"># NOTE: This setting requires maildir_copy_with_hardlinks = yes to work.</span>
<span style="color: #666666; font-style: italic;">#maildir_copy_preserve_filename = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## mbox-specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Which locking methods to use for locking mbox. There are four available:</span>
<span style="color: #666666; font-style: italic;">#  dotlock: Create &lt;mailbox&gt;.lock file. This is the oldest and most NFS-safe</span>
<span style="color: #666666; font-style: italic;">#           solution. If you want to use /var/mail/ like directory, the users</span>
<span style="color: #666666; font-style: italic;">#           will need write access to that directory.</span>
<span style="color: #666666; font-style: italic;">#  dotlock_try: Same as dotlock, but if it fails because of permissions or</span>
<span style="color: #666666; font-style: italic;">#               because there isn't enough disk space, just skip it.</span>
<span style="color: #666666; font-style: italic;">#  fcntl  : Use this if possible. Works with NFS too if lockd is used.</span>
<span style="color: #666666; font-style: italic;">#  flock  : May not exist in all systems. Doesn't work with NFS.</span>
<span style="color: #666666; font-style: italic;">#  lockf  : May not exist in all systems. Doesn't work with NFS.</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># You can use multiple locking methods; if you do the order they're declared</span>
<span style="color: #666666; font-style: italic;"># in is important to avoid deadlocks if other MTAs/MUAs are using multiple</span>
<span style="color: #666666; font-style: italic;"># locking methods as well. Some operating systems don't allow using some of</span>
<span style="color: #666666; font-style: italic;"># them simultaneously.</span>
<span style="color: #666666; font-style: italic;">#mbox_read_locks = fcntl</span>
<span style="color: #666666; font-style: italic;">#mbox_write_locks = fcntl</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum time in seconds to wait for lock (all of them) before aborting.</span>
<span style="color: #666666; font-style: italic;">#mbox_lock_timeout = 300</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If dotlock exists but the mailbox isn't modified in any way, override the</span>
<span style="color: #666666; font-style: italic;"># lock file after this many seconds.</span>
<span style="color: #666666; font-style: italic;">#mbox_dotlock_change_timeout = 120</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># When mbox changes unexpectedly we have to fully read it to find out what</span>
<span style="color: #666666; font-style: italic;"># changed. If the mbox is large this can take a long time. Since the change</span>
<span style="color: #666666; font-style: italic;"># is usually just a newly appended mail, it'd be faster to simply read the</span>
<span style="color: #666666; font-style: italic;"># new mails. If this setting is enabled, Dovecot does this but still safely</span>
<span style="color: #666666; font-style: italic;"># fallbacks to re-reading the whole mbox file whenever something in mbox isn't</span>
<span style="color: #666666; font-style: italic;"># how it's expected to be. The only real downside to this setting is that if</span>
<span style="color: #666666; font-style: italic;"># some other MUA changes message flags, Dovecot doesn't notice it immediately.</span>
<span style="color: #666666; font-style: italic;"># Note that a full sync is done with SELECT, EXAMINE, EXPUNGE and CHECK </span>
<span style="color: #666666; font-style: italic;"># commands.</span>
<span style="color: #666666; font-style: italic;">#mbox_dirty_syncs = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Like mbox_dirty_syncs, but don't do full syncs even with SELECT, EXAMINE,</span>
<span style="color: #666666; font-style: italic;"># EXPUNGE or CHECK commands. If this is set, mbox_dirty_syncs is ignored.</span>
<span style="color: #666666; font-style: italic;">#mbox_very_dirty_syncs = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Delay writing mbox headers until doing a full write sync (EXPUNGE and CHECK</span>
<span style="color: #666666; font-style: italic;"># commands and when closing the mailbox). This is especially useful for POP3</span>
<span style="color: #666666; font-style: italic;"># where clients often delete all mails. The downside is that our changes</span>
<span style="color: #666666; font-style: italic;"># aren't immediately visible to other MUAs.</span>
<span style="color: #666666; font-style: italic;">#mbox_lazy_writes = yes</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If mbox size is smaller than this (in kilobytes), don't write index files.</span>
<span style="color: #666666; font-style: italic;"># If an index file already exists it's still read, just not updated.</span>
<span style="color: #666666; font-style: italic;">#mbox_min_index_size = 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## dbox-specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum dbox file size in kilobytes until it's rotated.</span>
<span style="color: #666666; font-style: italic;">#dbox_rotate_size = 2048</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Minimum dbox file size in kilobytes before it's rotated</span>
<span style="color: #666666; font-style: italic;"># (overrides dbox_rotate_days)</span>
<span style="color: #666666; font-style: italic;">#dbox_rotate_min_size = 16</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum dbox file age in days until it's rotated. Day always begins from</span>
<span style="color: #666666; font-style: italic;"># midnight, so 1 = today, 2 = yesterday, etc. 0 = check disabled.</span>
<span style="color: #666666; font-style: italic;">#dbox_rotate_days = 0</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## IMAP specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
protocol imap <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Login executable location.</span>
  <span style="color: #666666; font-style: italic;">#login_executable = /usr/libexec/dovecot/imap-login</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># IMAP executable location. Changing this allows you to execute other</span>
  <span style="color: #666666; font-style: italic;"># binaries before the imap process is executed.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># This would write rawlogs into ~/dovecot.rawlog/ directory:</span>
  <span style="color: #666666; font-style: italic;">#   mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># This would attach gdb into the imap process and write backtraces into</span>
  <span style="color: #666666; font-style: italic;"># /tmp/gdbhelper.* files:</span>
  <span style="color: #666666; font-style: italic;">#   mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;">#mail_executable = /usr/libexec/dovecot/imap</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Maximum IMAP command line length in bytes. Some clients generate very long</span>
  <span style="color: #666666; font-style: italic;"># command lines with huge mailboxes, so you may need to raise this if you get</span>
  <span style="color: #666666; font-style: italic;"># &quot;Too long argument&quot; or &quot;IMAP command line too large&quot; errors often.</span>
  <span style="color: #666666; font-style: italic;">#imap_max_line_length = 65536</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Maximum number of IMAP connections allowed for a user from each IP address.</span>
  <span style="color: #666666; font-style: italic;"># NOTE: The username is compared case-sensitively.</span>
  <span style="color: #666666; font-style: italic;">#mail_max_userip_connections = 10</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Support for dynamically loadable plugins. mail_plugins is a space separated</span>
  <span style="color: #666666; font-style: italic;"># list of plugins to load.</span>
  <span style="color: #666666; font-style: italic;">#mail_plugins = </span>
  <span style="color: #666666; font-style: italic;">#mail_plugin_dir = /usr/lib/dovecot/imap</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># IMAP logout format string:</span>
  <span style="color: #666666; font-style: italic;">#  %i - total number of bytes read from client</span>
  <span style="color: #666666; font-style: italic;">#  %o - total number of bytes sent to client</span>
  <span style="color: #666666; font-style: italic;">#imap_logout_format = bytes=%i/%o</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Override the IMAP CAPABILITY response.</span>
  <span style="color: #666666; font-style: italic;">#imap_capability = </span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># ID field names and values to send to clients. Using * as the value makes</span>
  <span style="color: #666666; font-style: italic;"># Dovecot use the default value. The following fields have default values</span>
  <span style="color: #666666; font-style: italic;"># currently: name, version, os, os-version, support-url, support-email.</span>
  <span style="color: #666666; font-style: italic;">#imap_id_send = </span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># ID fields sent by client to log. * means everything.</span>
  <span style="color: #666666; font-style: italic;">#imap_id_log =</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Workarounds for various client bugs:</span>
  <span style="color: #666666; font-style: italic;">#   delay-newmail:</span>
  <span style="color: #666666; font-style: italic;">#     Send EXISTS/RECENT new mail notifications only when replying to NOOP</span>
  <span style="color: #666666; font-style: italic;">#     and CHECK commands. Some clients ignore them otherwise, for example OSX</span>
  <span style="color: #666666; font-style: italic;">#     Mail (&lt;v2.1). Outlook Express breaks more badly though, without this it</span>
  <span style="color: #666666; font-style: italic;">#     may show user &quot;Message no longer in server&quot; errors. Note that OE6 still</span>
  <span style="color: #666666; font-style: italic;">#     breaks even with this workaround if synchronization is set to</span>
  <span style="color: #666666; font-style: italic;">#     &quot;Headers Only&quot;.</span>
  <span style="color: #666666; font-style: italic;">#   netscape-eoh:</span>
  <span style="color: #666666; font-style: italic;">#     Netscape 4.x breaks if message headers don't end with the empty &quot;end of</span>
  <span style="color: #666666; font-style: italic;">#     headers&quot; line. Normally all messages have this, but setting this</span>
  <span style="color: #666666; font-style: italic;">#     workaround makes sure that Netscape never breaks by adding the line if</span>
  <span style="color: #666666; font-style: italic;">#     it doesn't exist. This is done only for FETCH BODY[HEADER.FIELDS..]</span>
  <span style="color: #666666; font-style: italic;">#     commands. Note that RFC says this shouldn't be done.</span>
  <span style="color: #666666; font-style: italic;">#   tb-extra-mailbox-sep:</span>
  <span style="color: #666666; font-style: italic;">#     With mbox storage a mailbox can contain either mails or submailboxes,</span>
  <span style="color: #666666; font-style: italic;">#     but not both. Thunderbird separates these two by forcing server to</span>
  <span style="color: #666666; font-style: italic;">#     accept '/' suffix in mailbox names in subscriptions list.</span>
  <span style="color: #666666; font-style: italic;"># The list is space-separated.</span>
  <span style="color: #666666; font-style: italic;">#imap_client_workarounds = </span>
  imap_client_workarounds = delay-newmail outlook-idle netscape-eoh tb-extra-mailbox-sep
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## POP3 specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
protocol pop3 <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Login executable location.</span>
  <span style="color: #666666; font-style: italic;">#login_executable = /usr/libexec/dovecot/pop3-login</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># POP3 executable location. See IMAP's mail_executable above for examples</span>
  <span style="color: #666666; font-style: italic;"># how this could be changed.</span>
  <span style="color: #666666; font-style: italic;">#mail_executable = /usr/libexec/dovecot/pop3</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Don't try to set mails non-recent or seen with POP3 sessions. This is</span>
  <span style="color: #666666; font-style: italic;"># mostly intended to reduce disk I/O. With maildir it doesn't move files</span>
  <span style="color: #666666; font-style: italic;"># from new/ to cur/, with mbox it doesn't write Status-header.</span>
  <span style="color: #666666; font-style: italic;">#pop3_no_flag_updates = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Support LAST command which exists in old POP3 specs, but has been removed</span>
  <span style="color: #666666; font-style: italic;"># from new ones. Some clients still wish to use this though. Enabling this</span>
  <span style="color: #666666; font-style: italic;"># makes RSET command clear all \Seen flags from messages.</span>
  <span style="color: #666666; font-style: italic;">#pop3_enable_last = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># If mail has X-UIDL header, use it as the mail's UIDL.</span>
  <span style="color: #666666; font-style: italic;">#pop3_reuse_xuidl = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Keep the mailbox locked for the entire POP3 session.</span>
  <span style="color: #666666; font-style: italic;">#pop3_lock_session = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># POP3 UIDL (unique mail identifier) format to use. You can use following</span>
  <span style="color: #666666; font-style: italic;"># variables, along with the variable modifiers described in</span>
  <span style="color: #666666; font-style: italic;"># doc/wiki/Variables.txt (e.g. %Uf for the filename in uppercase)</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;">#  %v - Mailbox's IMAP UIDVALIDITY</span>
  <span style="color: #666666; font-style: italic;">#  %u - Mail's IMAP UID</span>
  <span style="color: #666666; font-style: italic;">#  %m - MD5 sum of the mailbox headers in hex (mbox only)</span>
  <span style="color: #666666; font-style: italic;">#  %f - filename (maildir only)</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># If you want UIDL compatibility with other POP3 servers, use:</span>
  <span style="color: #666666; font-style: italic;">#  UW's ipop3d         : %08Xv%08Xu</span>
  <span style="color: #666666; font-style: italic;">#  Courier             : %f or %v-%u (both might be used simultaneosly)</span>
  <span style="color: #666666; font-style: italic;">#  Cyrus (&lt;= 2.1.3)    : %u</span>
  <span style="color: #666666; font-style: italic;">#  Cyrus (&gt;= 2.1.4)    : %v.%u</span>
  <span style="color: #666666; font-style: italic;">#  Dovecot v0.99.x     : %v.%u</span>
  <span style="color: #666666; font-style: italic;">#  tpop3d              : %Mf</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Note that Outlook 2003 seems to have problems with %v.%u format which was</span>
  <span style="color: #666666; font-style: italic;"># Dovecot's default, so if you're building a new server it would be a good</span>
  <span style="color: #666666; font-style: italic;"># idea to change this. %08Xu%08Xv should be pretty fail-safe.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;">#pop3_uidl_format = %08Xu%08Xv</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># POP3 logout format string:</span>
  <span style="color: #666666; font-style: italic;">#  %i - total number of bytes read from client</span>
  <span style="color: #666666; font-style: italic;">#  %o - total number of bytes sent to client</span>
  <span style="color: #666666; font-style: italic;">#  %t - number of TOP commands</span>
  <span style="color: #666666; font-style: italic;">#  %p - number of bytes sent to client as a result of TOP command</span>
  <span style="color: #666666; font-style: italic;">#  %r - number of RETR commands</span>
  <span style="color: #666666; font-style: italic;">#  %b - number of bytes sent to client as a result of RETR command</span>
  <span style="color: #666666; font-style: italic;">#  %d - number of deleted messages</span>
  <span style="color: #666666; font-style: italic;">#  %m - number of messages (before deletion)</span>
  <span style="color: #666666; font-style: italic;">#  %s - mailbox size in bytes (before deletion)</span>
  <span style="color: #666666; font-style: italic;">#pop3_logout_format = top=%t/%p, retr=%r/%b, del=%d/%m, size=%s</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Maximum number of POP3 connections allowed for a user from each IP address.</span>
  <span style="color: #666666; font-style: italic;"># NOTE: The username is compared case-sensitively.</span>
  <span style="color: #666666; font-style: italic;">#mail_max_userip_connections = 3</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Support for dynamically loadable plugins. mail_plugins is a space separated</span>
  <span style="color: #666666; font-style: italic;"># list of plugins to load.</span>
  <span style="color: #666666; font-style: italic;">#mail_plugins = </span>
  <span style="color: #666666; font-style: italic;">#mail_plugin_dir = /usr/lib/dovecot/pop3</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Workarounds for various client bugs:</span>
  <span style="color: #666666; font-style: italic;">#   outlook-no-nuls:</span>
  <span style="color: #666666; font-style: italic;">#     Outlook and Outlook Express hang if mails contain NUL characters.</span>
  <span style="color: #666666; font-style: italic;">#     This setting replaces them with 0x80 character.</span>
  <span style="color: #666666; font-style: italic;">#   oe-ns-eoh:</span>
  <span style="color: #666666; font-style: italic;">#     Outlook Express and Netscape Mail breaks if end of headers-line is</span>
  <span style="color: #666666; font-style: italic;">#     missing. This option simply sends it if it's missing.</span>
  <span style="color: #666666; font-style: italic;"># The list is space-separated.</span>
  <span style="color: #666666; font-style: italic;">#pop3_client_workarounds = </span>
  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## MANAGESIEVE specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
protocol managesieve <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Login executable location.</span>
  <span style="color: #666666; font-style: italic;">#login_executable = /usr/libexec/dovecot/managesieve-login</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># MANAGESIEVE executable location. See IMAP's mail_executable above for </span>
  <span style="color: #666666; font-style: italic;"># examples how this could be changed.</span>
  <span style="color: #666666; font-style: italic;">#mail_executable = /usr/libexec/dovecot/managesieve</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Maximum MANAGESIEVE command line length in bytes. This setting is </span>
  <span style="color: #666666; font-style: italic;"># directly borrowed from IMAP. But, since long command lines are very</span>
  <span style="color: #666666; font-style: italic;"># unlikely with MANAGESIEVE, changing this will not be very useful.  </span>
  <span style="color: #666666; font-style: italic;">#managesieve_max_line_length = 65536</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># If, for some inobvious reason, the sieve_storage remains unset, the </span>
  <span style="color: #666666; font-style: italic;"># managesieve daemon uses the specification of the mail_location to find out </span>
  <span style="color: #666666; font-style: italic;"># where to store the sieve files (see explaination in README.managesieve). </span>
  <span style="color: #666666; font-style: italic;"># The example below, when uncommented, overrides any global mail_location </span>
  <span style="color: #666666; font-style: italic;"># specification and stores all the scripts in '~/mail/sieve' if sieve_storage </span>
  <span style="color: #666666; font-style: italic;"># is unset. However, you should always use the sieve_storage setting.</span>
  <span style="color: #666666; font-style: italic;"># mail_location = mbox:~/mail</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># To fool managesieve clients that are focused on timesieved you can</span>
  <span style="color: #666666; font-style: italic;"># specify the IMPLEMENTATION capability that the dovecot reports to clients </span>
  <span style="color: #666666; font-style: italic;"># (default: dovecot).</span>
  <span style="color: #666666; font-style: italic;">#managesieve_implementation_string = Cyrus timsieved v2.2.13</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## LDA specific settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
protocol lda <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Address to use when sending rejection mails.</span>
  postmaster_address = postmaster<span style="color: #000000; font-weight: bold;">@</span>example.com
&nbsp;
  <span style="color: #666666; font-style: italic;"># Hostname to use in various parts of sent mails, eg. in Message-Id.</span>
  <span style="color: #666666; font-style: italic;"># Default is the system's real hostname.</span>
  <span style="color: #666666; font-style: italic;">#hostname = </span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Support for dynamically loadable plugins. mail_plugins is a space separated</span>
  <span style="color: #666666; font-style: italic;"># list of plugins to load.</span>
  <span style="color: #666666; font-style: italic;">#mail_plugins = </span>
  <span style="color: #666666; font-style: italic;">#mail_plugin_dir = /usr/lib/dovecot/lda</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># If user is over quota, return with temporary failure instead of</span>
  <span style="color: #666666; font-style: italic;"># bouncing the mail.</span>
  <span style="color: #666666; font-style: italic;">#quota_full_tempfail = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Format to use for logging mail deliveries. You can use variables:</span>
  <span style="color: #666666; font-style: italic;">#  %$ - Delivery status message (e.g. &quot;saved to INBOX&quot;)</span>
  <span style="color: #666666; font-style: italic;">#  %m - Message-ID</span>
  <span style="color: #666666; font-style: italic;">#  %s - Subject</span>
  <span style="color: #666666; font-style: italic;">#  %f - From address</span>
  <span style="color: #666666; font-style: italic;">#deliver_log_format = msgid=%m: %$</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Binary to use for sending mails.</span>
  <span style="color: #666666; font-style: italic;">#sendmail_path = /usr/lib/sendmail</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Subject: header to use for rejection mails. You can use the same variables</span>
  <span style="color: #666666; font-style: italic;"># as for rejection_reason below.</span>
  <span style="color: #666666; font-style: italic;">#rejection_subject = Rejected: %s</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Human readable error message for rejection mails. You can use variables:</span>
  <span style="color: #666666; font-style: italic;">#  %n = CRLF, %r = reason, %s = original subject, %t = recipient</span>
  <span style="color: #666666; font-style: italic;">#rejection_reason = Your message to &lt;%t&gt; was automatically rejected:%n%r</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># UNIX socket path to master authentication server to find users.</span>
  <span style="color: #666666; font-style: italic;">#auth_socket_path = /var/run/dovecot/auth-master</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Authentication processes</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Executable location</span>
<span style="color: #666666; font-style: italic;">#auth_executable = /usr/libexec/dovecot/dovecot-auth</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Set max. process size in megabytes.</span>
<span style="color: #666666; font-style: italic;">#auth_process_size = 256</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Authentication cache size in kilobytes. 0 means it's disabled.</span>
<span style="color: #666666; font-style: italic;"># Note that bsdauth, PAM and vpopmail require cache_key to be set for caching</span>
<span style="color: #666666; font-style: italic;"># to be used.</span>
<span style="color: #666666; font-style: italic;">#auth_cache_size = 0</span>
<span style="color: #666666; font-style: italic;"># Time to live in seconds for cached data. After this many seconds the cached</span>
<span style="color: #666666; font-style: italic;"># record is no longer used, *except* if the main database lookup returns</span>
<span style="color: #666666; font-style: italic;"># internal failure. We also try to handle password changes automatically: If</span>
<span style="color: #666666; font-style: italic;"># user's previous authentication was successful, but this one wasn't, the</span>
<span style="color: #666666; font-style: italic;"># cache isn't used. For now this works only with plaintext authentication.</span>
<span style="color: #666666; font-style: italic;">#auth_cache_ttl = 3600</span>
<span style="color: #666666; font-style: italic;"># TTL for negative hits (user not found). 0 disables caching them completely.</span>
<span style="color: #666666; font-style: italic;">#auth_cache_negative_ttl = 3600</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Space separated list of realms for SASL authentication mechanisms that need</span>
<span style="color: #666666; font-style: italic;"># them. You can leave it empty if you don't want to support multiple realms.</span>
<span style="color: #666666; font-style: italic;"># Many clients simply use the first one listed here, so keep the default realm</span>
<span style="color: #666666; font-style: italic;"># first.</span>
<span style="color: #666666; font-style: italic;">#auth_realms =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Default realm/domain to use if none was specified. This is used for both</span>
<span style="color: #666666; font-style: italic;"># SASL realms and appending @domain to username in plaintext logins.</span>
<span style="color: #666666; font-style: italic;">#auth_default_realm = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># List of allowed characters in username. If the user-given username contains</span>
<span style="color: #666666; font-style: italic;"># a character not listed in here, the login automatically fails. This is just</span>
<span style="color: #666666; font-style: italic;"># an extra check to make sure user can't exploit any potential quote escaping</span>
<span style="color: #666666; font-style: italic;"># vulnerabilities with SQL/LDAP databases. If you want to allow all characters,</span>
<span style="color: #666666; font-style: italic;"># set this value to empty.</span>
<span style="color: #666666; font-style: italic;">#auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Username character translations before it's looked up from databases. The</span>
<span style="color: #666666; font-style: italic;"># value contains series of from -&gt; to characters. For example &quot;#@/@&quot; means</span>
<span style="color: #666666; font-style: italic;"># that '#' and '/' characters are translated to '@'.</span>
<span style="color: #666666; font-style: italic;">#auth_username_translation =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Username formatting before it's looked up from databases. You can use</span>
<span style="color: #666666; font-style: italic;"># the standard variables here, eg. %Lu would lowercase the username, %n would</span>
<span style="color: #666666; font-style: italic;"># drop away the domain if it was given, or &quot;%n-AT-%d&quot; would change the '@' into</span>
<span style="color: #666666; font-style: italic;"># &quot;-AT-&quot;. This translation is done after auth_username_translation changes.</span>
<span style="color: #666666; font-style: italic;">#auth_username_format =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If you want to allow master users to log in by specifying the master</span>
<span style="color: #666666; font-style: italic;"># username within the normal username string (ie. not using SASL mechanism's</span>
<span style="color: #666666; font-style: italic;"># support for it), you can specify the separator character here. The format</span>
<span style="color: #666666; font-style: italic;"># is then &lt;username&gt;&lt;separator&gt;&lt;master username&gt;. UW-IMAP uses &quot;*&quot; as the</span>
<span style="color: #666666; font-style: italic;"># separator, so that could be a good choice.</span>
<span style="color: #666666; font-style: italic;">#auth_master_user_separator =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Username to use for users logging in with ANONYMOUS SASL mechanism</span>
<span style="color: #666666; font-style: italic;">#auth_anonymous_username = anonymous</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># More verbose logging. Useful for figuring out why authentication isn't</span>
<span style="color: #666666; font-style: italic;"># working.</span>
<span style="color: #666666; font-style: italic;">#auth_verbose = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Even more verbose logging for debugging purposes. Shows for example SQL</span>
<span style="color: #666666; font-style: italic;"># queries.</span>
<span style="color: #666666; font-style: italic;">#auth_debug = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># In case of password mismatches, log the passwords and used scheme so the</span>
<span style="color: #666666; font-style: italic;"># problem can be debugged. Enabling this also enables auth_debug.</span>
<span style="color: #666666; font-style: italic;">#auth_debug_passwords = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Maximum number of dovecot-auth worker processes. They're used to execute</span>
<span style="color: #666666; font-style: italic;"># blocking passdb and userdb queries (eg. MySQL and PAM). They're</span>
<span style="color: #666666; font-style: italic;"># automatically created and destroyed as needed.</span>
<span style="color: #666666; font-style: italic;">#auth_worker_max_count = 30</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Host name to use in GSSAPI principal names. The default is to use the</span>
<span style="color: #666666; font-style: italic;"># name returned by gethostname(). Use &quot;$ALL&quot; to allow all keytab entries.</span>
<span style="color: #666666; font-style: italic;">#auth_gssapi_hostname =</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Kerberos keytab to use for the GSSAPI mechanism. Will use the system </span>
<span style="color: #666666; font-style: italic;"># default (usually /etc/krb5.keytab) if not specified.</span>
<span style="color: #666666; font-style: italic;">#auth_krb5_keytab = </span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Do NTLM and GSS-SPNEGO authentication using Samba's winbind daemon and</span>
<span style="color: #666666; font-style: italic;"># ntlm_auth helper. &lt;doc/wiki/Authentication/Mechanisms/Winbind.txt&gt;</span>
<span style="color: #666666; font-style: italic;">#auth_use_winbind = no</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Path for Samba's ntlm_auth helper binary.</span>
<span style="color: #666666; font-style: italic;">#auth_winbind_helper_path = /usr/bin/ntlm_auth</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Number of seconds to delay before replying to failed authentications.</span>
<span style="color: #666666; font-style: italic;">#auth_failure_delay = 2</span>
&nbsp;
auth default <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Space separated list of wanted authentication mechanisms:</span>
  <span style="color: #666666; font-style: italic;">#   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey</span>
  <span style="color: #666666; font-style: italic;">#   gss-spnego</span>
  <span style="color: #666666; font-style: italic;"># NOTE: See also disable_plaintext_auth setting.</span>
  mechanisms = plain
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Password database is used to verify user's password (and nothing more).</span>
  <span style="color: #666666; font-style: italic;"># You can have multiple passdbs and userdbs. This is useful if you want to</span>
  <span style="color: #666666; font-style: italic;"># allow both system users (/etc/passwd) and virtual users to login without</span>
  <span style="color: #666666; font-style: italic;"># duplicating the system users into virtual database.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/PasswordDatabase.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># By adding master=yes setting inside a passdb you make the passdb a list</span>
  <span style="color: #666666; font-style: italic;"># of &quot;master users&quot;, who can log in as anyone else. Unless you're using PAM,</span>
  <span style="color: #666666; font-style: italic;"># you probably still want the destination user to be looked up from passdb</span>
  <span style="color: #666666; font-style: italic;"># that it really exists. This can be done by adding pass=yes setting to the</span>
  <span style="color: #666666; font-style: italic;"># master passdb. &lt;doc/wiki/Authentication.MasterUsers.txt&gt;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Users can be temporarily disabled by adding a passdb with deny=yes.</span>
  <span style="color: #666666; font-style: italic;"># If the user is found from that database, authentication will fail.</span>
  <span style="color: #666666; font-style: italic;"># The deny passdb should always be specified before others, so it gets</span>
  <span style="color: #666666; font-style: italic;"># checked first. Here's an example:</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#passdb passwd-file {</span>
    <span style="color: #666666; font-style: italic;"># File contains a list of usernames, one per line</span>
    <span style="color: #666666; font-style: italic;">#args = /etc/dovecot.deny</span>
    <span style="color: #666666; font-style: italic;">#deny = yes</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># PAM authentication. Preferred nowadays by most systems. </span>
  <span style="color: #666666; font-style: italic;"># Note that PAM can only be used to verify if user's password is correct,</span>
  <span style="color: #666666; font-style: italic;"># so it can't be used as userdb. If you don't want to use a separate user</span>
  <span style="color: #666666; font-style: italic;"># database (passwd usually), you can use static userdb.</span>
  <span style="color: #666666; font-style: italic;"># REMEMBER: You'll need /etc/pam.d/dovecot file created for PAM</span>
  <span style="color: #666666; font-style: italic;"># authentication to actually work. &lt;doc/wiki/PasswordDatabase.PAM.txt&gt;</span>
  passdb pam <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #666666; font-style: italic;"># [session=yes] [setcred=yes] [failure_show_msg=yes] [max_requests=&lt;n&gt;]</span>
    <span style="color: #666666; font-style: italic;"># [cache_key=&lt;key&gt;] [&lt;service name&gt;]</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># session=yes makes Dovecot open and immediately close PAM session. Some</span>
    <span style="color: #666666; font-style: italic;"># PAM plugins need this to work, such as pam_mkhomedir.</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># setcred=yes makes Dovecot establish PAM credentials if some PAM plugins</span>
    <span style="color: #666666; font-style: italic;"># need that. They aren't ever deleted though, so this isn't enabled by</span>
    <span style="color: #666666; font-style: italic;"># default.</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># max_requests specifies how many PAM lookups to do in one process before</span>
    <span style="color: #666666; font-style: italic;"># recreating the process. The default is 100, because many PAM plugins</span>
    <span style="color: #666666; font-style: italic;"># leak memory.</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># cache_key can be used to enable authentication caching for PAM</span>
    <span style="color: #666666; font-style: italic;"># (auth_cache_size also needs to be set). It isn't enabled by default</span>
    <span style="color: #666666; font-style: italic;"># because PAM modules can do all kinds of checks besides checking password,</span>
    <span style="color: #666666; font-style: italic;"># such as checking IP address. Dovecot can't know about these checks</span>
    <span style="color: #666666; font-style: italic;"># without some help. cache_key is simply a list of variables (see</span>
    <span style="color: #666666; font-style: italic;"># doc/wiki/Variables.txt) which must match for the cached data to be used.</span>
    <span style="color: #666666; font-style: italic;"># Here are some examples:</span>
    <span style="color: #666666; font-style: italic;">#   %u - Username must match. Probably sufficient for most uses.</span>
    <span style="color: #666666; font-style: italic;">#   %u%r - Username and remote IP address must match.</span>
    <span style="color: #666666; font-style: italic;">#   %u%s - Username and service (ie. IMAP, POP3) must match.</span>
    <span style="color: #666666; font-style: italic;"># </span>
    <span style="color: #666666; font-style: italic;"># The service name can contain variables, for example %Ls expands to</span>
    <span style="color: #666666; font-style: italic;"># pop3 or imap.</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># Some examples:</span>
    <span style="color: #666666; font-style: italic;">#   args = session=yes %Ls</span>
    <span style="color: #666666; font-style: italic;">#   args = cache_key=%u dovecot</span>
    <span style="color: #666666; font-style: italic;">#args = dovecot</span>
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># System users (NSS, /etc/passwd, or similiar)</span>
  <span style="color: #666666; font-style: italic;"># In many systems nowadays this uses Name Service Switch, which is</span>
  <span style="color: #666666; font-style: italic;"># configured in /etc/nsswitch.conf. &lt;doc/wiki/AuthDatabase.Passwd.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb passwd {</span>
    <span style="color: #666666; font-style: italic;"># [blocking=yes] - See userdb passwd for explanation</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Shadow passwords for system users (NSS, /etc/shadow or similiar).</span>
  <span style="color: #666666; font-style: italic;"># Deprecated by PAM nowadays.</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/PasswordDatabase.Shadow.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb shadow {</span>
    <span style="color: #666666; font-style: italic;"># [blocking=yes] - See userdb passwd for explanation</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># PAM-like authentication for OpenBSD.</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/PasswordDatabase.BSDAuth.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb bsdauth {</span>
    <span style="color: #666666; font-style: italic;"># [cache_key=&lt;key&gt;] - See cache_key in PAM for explanation.</span>
    <span style="color: #666666; font-style: italic;">#args =</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># passwd-like file with specified location</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/AuthDatabase.PasswdFile.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb passwd-file {</span>
    <span style="color: #666666; font-style: italic;"># [scheme=&lt;default password scheme&gt;] [username_format=&lt;format&gt;]</span>
    <span style="color: #666666; font-style: italic;"># &lt;Path for passwd-file&gt;</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># checkpassword executable authentication</span>
  <span style="color: #666666; font-style: italic;"># NOTE: You will probably want to use &quot;userdb prefetch&quot; with this.</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/AuthDatabase.CheckPassword.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb checkpassword {</span>
    <span style="color: #666666; font-style: italic;"># Path for checkpassword binary</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># SQL database &lt;doc/wiki/AuthDatabase.SQL.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb sql {</span>
    <span style="color: #666666; font-style: italic;"># Path for SQL configuration file, see doc/dovecot-sql-example.conf</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># LDAP database &lt;doc/wiki/AuthDatabase.LDAP.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb ldap {</span>
    <span style="color: #666666; font-style: italic;"># Path for LDAP configuration file, see doc/dovecot-ldap-example.conf</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># vpopmail authentication &lt;doc/wiki/AuthDatabase.VPopMail.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#passdb vpopmail {</span>
    <span style="color: #666666; font-style: italic;"># [cache_key=&lt;key&gt;] - See cache_key in PAM for explanation.</span>
    <span style="color: #666666; font-style: italic;"># [quota_template=&lt;template&gt;] - %q expands to Maildir++ quota</span>
    <span style="color: #666666; font-style: italic;">#   (eg. quota_template=quota_rule=*:backend=%q)</span>
    <span style="color: #666666; font-style: italic;">#args =</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># User database specifies where mails are located and what user/group IDs</span>
  <span style="color: #666666; font-style: italic;"># own them. For single-UID configuration use &quot;static&quot;.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/UserDatabase.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># &quot;prefetch&quot; user database means that the passdb already provided the</span>
  <span style="color: #666666; font-style: italic;"># needed information and there's no need to do a separate userdb lookup.</span>
  <span style="color: #666666; font-style: italic;"># This can be made to work with SQL and LDAP databases, see their example</span>
  <span style="color: #666666; font-style: italic;"># configuration files for more information how to do it.</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/UserDatabase.Prefetch.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb prefetch {</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># System users (NSS, /etc/passwd, or similiar). In many systems nowadays this</span>
  <span style="color: #666666; font-style: italic;"># uses Name Service Switch, which is configured in /etc/nsswitch.conf.</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/AuthDatabase.Passwd.txt&gt;</span>
  userdb <span style="color: #c20cb9; font-weight: bold;">passwd</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #666666; font-style: italic;"># [blocking=yes] - By default the lookups are done in the main dovecot-auth</span>
    <span style="color: #666666; font-style: italic;"># process. This setting causes the lookups to be done in auth worker</span>
    <span style="color: #666666; font-style: italic;"># proceses. Useful with remote NSS lookups that may block.</span>
    <span style="color: #666666; font-style: italic;"># NOTE: Be sure to use this setting with nss_ldap or users might get</span>
    <span style="color: #666666; font-style: italic;"># logged in as each others!</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># passwd-like file with specified location</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/AuthDatabase.PasswdFile.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb passwd-file {</span>
    <span style="color: #666666; font-style: italic;"># [username_format=&lt;format&gt;] &lt;Path for passwd-file&gt;</span>
    <span style="color: #666666; font-style: italic;">#args =</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># checkpassword executable user database lookup</span>
  <span style="color: #666666; font-style: italic;"># &lt;doc/wiki/AuthDatabase.CheckPassword.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb checkpassword {</span>
    <span style="color: #666666; font-style: italic;"># Path for checkpassword binary</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># static settings generated from template &lt;doc/wiki/UserDatabase.Static.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb static {</span>
    <span style="color: #666666; font-style: italic;"># Template for the fields. Can return anything a userdb could normally</span>
    <span style="color: #666666; font-style: italic;"># return. For example:</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;">#  args = uid=500 gid=500 home=/var/mail/%u</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;"># If you use deliver, it needs to look up users only from the userdb. This</span>
    <span style="color: #666666; font-style: italic;"># of course doesn't work with static because there is no list of users.</span>
    <span style="color: #666666; font-style: italic;"># Normally static userdb handles this by doing a passdb lookup. This works</span>
    <span style="color: #666666; font-style: italic;"># with most passdbs, with PAM being the most notable exception. If you do</span>
    <span style="color: #666666; font-style: italic;"># the user verification another way, you can add allow_all_users=yes to</span>
    <span style="color: #666666; font-style: italic;"># the args in which case the passdb lookup is skipped.</span>
    <span style="color: #666666; font-style: italic;">#</span>
    <span style="color: #666666; font-style: italic;">#args =</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># SQL database &lt;doc/wiki/AuthDatabase.SQL.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb sql {</span>
    <span style="color: #666666; font-style: italic;"># Path for SQL configuration file, see doc/dovecot-sql-example.conf</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># LDAP database &lt;doc/wiki/AuthDatabase.LDAP.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb ldap {</span>
    <span style="color: #666666; font-style: italic;"># Path for LDAP configuration file, see doc/dovecot-ldap-example.conf</span>
    <span style="color: #666666; font-style: italic;">#args = </span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># vpopmail &lt;doc/wiki/AuthDatabase.VPopMail.txt&gt;</span>
  <span style="color: #666666; font-style: italic;">#userdb vpopmail {</span>
  <span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># User to use for the process. This user needs access to only user and</span>
  <span style="color: #666666; font-style: italic;"># password databases, nothing else. Only shadow and pam authentication</span>
  <span style="color: #666666; font-style: italic;"># requires roots, so use something else if possible. Note that passwd</span>
  <span style="color: #666666; font-style: italic;"># authentication with BSDs internally accesses shadow files, which also</span>
  <span style="color: #666666; font-style: italic;"># requires roots. Note that this user is NOT used to access mails.</span>
  <span style="color: #666666; font-style: italic;"># That user is specified by userdb above.</span>
  user = root
&nbsp;
  <span style="color: #666666; font-style: italic;"># Directory where to chroot the process. Most authentication backends don't</span>
  <span style="color: #666666; font-style: italic;"># work if this is set, and there's no point chrooting if auth_user is root.</span>
  <span style="color: #666666; font-style: italic;"># Note that valid_chroot_dirs isn't needed to use this setting.</span>
  <span style="color: #666666; font-style: italic;">#chroot = </span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Number of authentication processes to create</span>
  <span style="color: #666666; font-style: italic;">#count = 1</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Require a valid SSL client certificate or the authentication fails.</span>
  <span style="color: #666666; font-style: italic;">#ssl_require_client_cert = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Take the username from client's SSL certificate, using </span>
  <span style="color: #666666; font-style: italic;"># X509_NAME_get_text_by_NID() which returns the subject's DN's</span>
  <span style="color: #666666; font-style: italic;"># CommonName. </span>
  <span style="color: #666666; font-style: italic;">#ssl_username_from_cert = no</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># It's possible to export the authentication interface to other programs:</span>
  <span style="color: #666666; font-style: italic;">#socket listen {</span>
    <span style="color: #666666; font-style: italic;">#master {</span>
      <span style="color: #666666; font-style: italic;"># Master socket provides access to userdb information. It's typically</span>
      <span style="color: #666666; font-style: italic;"># used to give Dovecot's local delivery agent access to userdb so it</span>
      <span style="color: #666666; font-style: italic;"># can find mailbox locations.</span>
      <span style="color: #666666; font-style: italic;">#path = /var/run/dovecot/auth-master</span>
      <span style="color: #666666; font-style: italic;">#mode = 0600</span>
      <span style="color: #666666; font-style: italic;"># Default user/group is the one who started dovecot-auth (root)</span>
      <span style="color: #666666; font-style: italic;">#user = </span>
      <span style="color: #666666; font-style: italic;">#group = </span>
    <span style="color: #666666; font-style: italic;">#}</span>
    <span style="color: #666666; font-style: italic;">#client {</span>
      <span style="color: #666666; font-style: italic;"># The client socket is generally safe to export to everyone. Typical use</span>
      <span style="color: #666666; font-style: italic;"># is to export it to your SMTP server so it can do SMTP AUTH lookups</span>
      <span style="color: #666666; font-style: italic;"># using it.</span>
      <span style="color: #666666; font-style: italic;">#path = /var/run/dovecot/auth-client</span>
      <span style="color: #666666; font-style: italic;">#mode = 0660</span>
    <span style="color: #666666; font-style: italic;">#}</span>
  <span style="color: #666666; font-style: italic;">#}</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># If you wish to use another authentication server than dovecot-auth, you can</span>
<span style="color: #666666; font-style: italic;"># use connect sockets. They are assumed to be already running, Dovecot's master</span>
<span style="color: #666666; font-style: italic;"># process only tries to connect to them. They don't need any other settings</span>
<span style="color: #666666; font-style: italic;"># than the path for the master socket, as the configuration is done elsewhere.</span>
<span style="color: #666666; font-style: italic;"># Note that the client sockets must exist in the login_dir.</span>
<span style="color: #666666; font-style: italic;">#auth external {</span>
<span style="color: #666666; font-style: italic;">#  socket connect {</span>
<span style="color: #666666; font-style: italic;">#    master {</span>
<span style="color: #666666; font-style: italic;">#      path = /var/run/dovecot/auth-master</span>
<span style="color: #666666; font-style: italic;">#    }</span>
<span style="color: #666666; font-style: italic;">#  }</span>
<span style="color: #666666; font-style: italic;">#}</span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Dictionary server settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Dictionary can be used by some plugins to store key=value lists.</span>
<span style="color: #666666; font-style: italic;"># Currently this is only used by dict quota backend. The dictionary can be</span>
<span style="color: #666666; font-style: italic;"># used either directly or though a dictionary server. The following dict block</span>
<span style="color: #666666; font-style: italic;"># maps dictionary names to URIs when the server is used. These can then be</span>
<span style="color: #666666; font-style: italic;"># referenced using URIs in format &quot;proxy::&lt;name&gt;&quot;.</span>
&nbsp;
dict <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;">#quota = mysql:/etc/dovecot-dict-quota.conf </span>
  <span style="color: #666666; font-style: italic;">#expire = db:/var/lib/dovecot/expire.db</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf</span>
<span style="color: #666666; font-style: italic;">#dict_db_config = </span>
&nbsp;
<span style="color: #666666; font-style: italic;">##</span>
<span style="color: #666666; font-style: italic;">## Plugin settings</span>
<span style="color: #666666; font-style: italic;">##</span>
&nbsp;
plugin <span style="color: #7a0874; font-weight: bold;">&#123;</span>
  <span style="color: #666666; font-style: italic;"># Here you can give some extra environment variables to mail processes.</span>
  <span style="color: #666666; font-style: italic;"># This is mostly meant for passing parameters to plugins. %variable</span>
  <span style="color: #666666; font-style: italic;"># expansion is done for all values.</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Quota plugin. Multiple backends are supported:</span>
  <span style="color: #666666; font-style: italic;">#   dirsize: Find and sum all the files found from mail directory.</span>
  <span style="color: #666666; font-style: italic;">#            Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.</span>
  <span style="color: #666666; font-style: italic;">#   dict: Keep quota stored in dictionary (eg. SQL)</span>
  <span style="color: #666666; font-style: italic;">#   maildir: Maildir++ quota</span>
  <span style="color: #666666; font-style: italic;">#   fs: Read-only support for filesystem quota</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Quota limits are set using &quot;quota_rule&quot; parameters, either in here or in</span>
  <span style="color: #666666; font-style: italic;"># userdb. It's also possible to give mailbox-specific limits, for example:</span>
  <span style="color: #666666; font-style: italic;">#   quota_rule = *:storage=1048576</span>
  <span style="color: #666666; font-style: italic;">#   quota_rule2 = Trash:storage=102400</span>
  <span style="color: #666666; font-style: italic;"># User has now 1GB quota, but when saving to Trash mailbox the user gets</span>
  <span style="color: #666666; font-style: italic;"># additional 100MB.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># Multiple quota roots are also possible, for example:</span>
  <span style="color: #666666; font-style: italic;">#   quota = dict:user::proxy::quota</span>
  <span style="color: #666666; font-style: italic;">#   quota2 = dict:domain:%d:proxy::quota_domain</span>
  <span style="color: #666666; font-style: italic;">#   quota_rule = *:storage=102400</span>
  <span style="color: #666666; font-style: italic;">#   quota2_rule = *:storage=1048576</span>
  <span style="color: #666666; font-style: italic;"># Gives each user their own 100MB quota and one shared 1GB quota within</span>
  <span style="color: #666666; font-style: italic;"># the domain.</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># You can execute a given command when user exceeds a specified quota limit.</span>
  <span style="color: #666666; font-style: italic;"># Each quota root has separate limits. Only the command for the first</span>
  <span style="color: #666666; font-style: italic;"># exceeded limit is excecuted, so put the highest limit first.</span>
  <span style="color: #666666; font-style: italic;"># Note that % needs to be escaped as %%, otherwise &quot;% &quot; expands to empty.</span>
  <span style="color: #666666; font-style: italic;">#   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95</span>
  <span style="color: #666666; font-style: italic;">#   quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80</span>
  <span style="color: #666666; font-style: italic;">#quota = maildir</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># ACL plugin. vfile backend reads ACLs from &quot;dovecot-acl&quot; file from maildir</span>
  <span style="color: #666666; font-style: italic;"># directory. You can also optionally give a global ACL directory path where</span>
  <span style="color: #666666; font-style: italic;"># ACLs are applied to all users' mailboxes. The global ACL directory contains</span>
  <span style="color: #666666; font-style: italic;"># one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter</span>
  <span style="color: #666666; font-style: italic;"># specifies how many seconds to wait between stat()ing dovecot-acl file</span>
  <span style="color: #666666; font-style: italic;"># to see if it changed.</span>
  <span style="color: #666666; font-style: italic;">#acl = vfile:/etc/dovecot-acls:cache_secs=300</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># To let users LIST mailboxes shared by other users, Dovecot needs a</span>
  <span style="color: #666666; font-style: italic;"># shared mailbox dictionary. For example:</span>
  <span style="color: #666666; font-style: italic;">#acl_shared_dict = file:/var/lib/dovecot/shared-mailboxes</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Convert plugin. If set, specifies the source storage path which is</span>
  <span style="color: #666666; font-style: italic;"># converted to destination storage (mail_location) when the user logs in.</span>
  <span style="color: #666666; font-style: italic;"># The existing mail directory is renamed to &lt;dir&gt;-converted.</span>
  <span style="color: #666666; font-style: italic;">#convert_mail = mbox:%h/mail</span>
  <span style="color: #666666; font-style: italic;"># Skip mailboxes which we can't open successfully instead of aborting.</span>
  <span style="color: #666666; font-style: italic;">#convert_skip_broken_mailboxes = no</span>
  <span style="color: #666666; font-style: italic;"># Skip directories beginning with '.'</span>
  <span style="color: #666666; font-style: italic;">#convert_skip_dotdirs = no</span>
  <span style="color: #666666; font-style: italic;"># If source storage has mailbox names with destination storage's hierarchy</span>
  <span style="color: #666666; font-style: italic;"># separators, replace them with this character.</span>
  <span style="color: #666666; font-style: italic;">#convert_alt_hierarchy_char = _</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Trash plugin. When saving a message would make user go over quota, this</span>
  <span style="color: #666666; font-style: italic;"># plugin automatically deletes the oldest mails from configured mailboxes</span>
  <span style="color: #666666; font-style: italic;"># until the message can be saved within quota limits. The configuration file</span>
  <span style="color: #666666; font-style: italic;"># is a text file where each line is in format: &lt;priority&gt; &lt;mailbox name&gt;</span>
  <span style="color: #666666; font-style: italic;"># Mails are first deleted in lowest -&gt; highest priority number order</span>
  <span style="color: #666666; font-style: italic;">#trash = /etc/dovecot-trash.conf</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Expire plugin. Mails are expunged from mailboxes after being there the</span>
  <span style="color: #666666; font-style: italic;"># configurable time. The first expiration date for each mailbox is stored in</span>
  <span style="color: #666666; font-style: italic;"># a dictionary so it can be quickly determined which mailboxes contain</span>
  <span style="color: #666666; font-style: italic;"># expired mails. The actual expunging is done in a nightly cronjob, which</span>
  <span style="color: #666666; font-style: italic;"># you must set up:</span>
  <span style="color: #666666; font-style: italic;">#   dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool</span>
  <span style="color: #666666; font-style: italic;">#expire = Trash 7 Spam 30</span>
  <span style="color: #666666; font-style: italic;">#expire_dict = proxy::expire</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Lazy expunge plugin. Currently works only with maildirs. When a user</span>
  <span style="color: #666666; font-style: italic;"># expunges mails, the mails are moved to a mailbox in another namespace</span>
  <span style="color: #666666; font-style: italic;"># (1st). When a mailbox is deleted, the mailbox is moved to another namespace</span>
  <span style="color: #666666; font-style: italic;"># (2nd) as well. Also if the deleted mailbox had any expunged messages,</span>
  <span style="color: #666666; font-style: italic;"># they're moved to a 3rd namespace. The mails won't be counted in quota,</span>
  <span style="color: #666666; font-style: italic;"># and they're not deleted automatically (use a cronjob or something).</span>
  <span style="color: #666666; font-style: italic;">#lazy_expunge = .EXPUNGED/ .DELETED/ .DELETED/.EXPUNGED/</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Events to log. Also available: flag_change append</span>
  <span style="color: #666666; font-style: italic;">#mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename</span>
  <span style="color: #666666; font-style: italic;"># Group events within a transaction to one line.</span>
  <span style="color: #666666; font-style: italic;">#mail_log_group_events = </span>
  <span style="color: #666666; font-style: italic;"># Available fields: uid, box, msgid, from, subject, size, vsize, flags</span>
  <span style="color: #666666; font-style: italic;"># size and vsize are available only for expunge and copy events.</span>
  <span style="color: #666666; font-style: italic;">#mail_log_fields = uid box msgid size</span>
&nbsp;
  <span style="color: #666666; font-style: italic;"># Sieve plugin (http://wiki.dovecot.org/LDA/Sieve) and ManageSieve service</span>
  <span style="color: #666666; font-style: italic;"># </span>
  <span style="color: #666666; font-style: italic;"># Location of the active script. When ManageSieve is used this is actually </span>
  <span style="color: #666666; font-style: italic;"># a symlink pointing to the active script in the sieve storage directory. </span>
  <span style="color: #666666; font-style: italic;">#sieve=~/.dovecot.sieve</span>
  <span style="color: #666666; font-style: italic;">#</span>
  <span style="color: #666666; font-style: italic;"># The path to the directory where the personal Sieve scripts are stored. For </span>
  <span style="color: #666666; font-style: italic;"># ManageSieve this is where the uploaded scripts are stored.</span>
  <span style="color: #666666; font-style: italic;">#sieve_dir=~/sieve</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></td></tr></table></div>




<h4>Optional Extras</h4>

<h5>Setting up <span class="caps">SPF</span></h5>

<p><strong>Method 1: use the C based <span class="caps">SPF </span>milter, &#8220;smf-spf&#8221;</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22640"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p226code40"><pre class="bash" style="font-family:monospace;">yum <span style="color: #c20cb9; font-weight: bold;">install</span> smf-spf</pre></td></tr></table></div>




<p><strong>Add the following to sendmail.mc and re-make sendmail.cf</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22641"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p226code41"><pre class="bash" style="font-family:monospace;">dnl <span style="color: #000000; font-weight: bold;">**</span>
dnl <span style="color: #000000; font-weight: bold;">**</span> <span style="color: #7a0874; font-weight: bold;">enable</span> smf-spf <span style="color: #7a0874; font-weight: bold;">&#40;</span>Sender Policy Framework<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">**</span>
dnl <span style="color: #000000; font-weight: bold;">**</span>
define<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span>confMILTER_MACROS_HELO<span style="color: #ff0000;">', confMILTER_MACROS_HELO`, {verify}'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>dnl
INPUT_MAIL_FILTER<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000; font-weight: bold;">`</span>smf-spf<span style="color: #ff0000;">', `S=unix:/var/run/smfs/smf-spf.sock, T=S:30s;R:1m'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>dnl</pre></td></tr></table></div>




<p><strong>Starting it up</strong></p>


<div class="wp_codebox"><table width="100%" ><tr id="p22642"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p226code42"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>smf-spf restart
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> restart</pre></td></tr></table></div>




<p>Don&#8217;t forget to run chkconfig if you want to make smf-spf start up permanentally between reboots.</p><div id="wherego_related"><h3>Readers who viewed this page, also viewed:</h3><ul><li><a href="http://www.lamolabs.org/blog/1766/pushing-pulling-files-around-using-tar-ssh-scp-rsync/" rel="bookmark" class="wherego_title">Pushing &#038; Pulling Files Around Using tar, ssh, scp, &#038; rsync</a></li><li><a href="http://www.lamolabs.org/blog/949/remote-installing-centos-5-using-vnc/" rel="bookmark" class="wherego_title">Remote Installing CentOS 5 using VNC</a></li><li><a href="http://www.lamolabs.org/blog/1134/delicious-bookmarks-for-may-19th-through-may-21st/" rel="bookmark" class="wherego_title">Delicious Bookmarks for May 19th through May 21st</a></li><li><a href="http://www.lamolabs.org/blog/370/installing-python-25-on-centos-5/" rel="bookmark" class="wherego_title">Installing Python 2.5 on CentOS 5</a></li><li><a href="http://www.lamolabs.org/blog/2708/one-liner-getting-remote-desktop-sharing-compiz-to-play-nice-under-ubuntu-9-04-with-gnome/" rel="bookmark" class="wherego_title">[one-liner]: Getting Remote Desktop Sharing &#038; Compiz to play nice under Ubuntu 9.04 with GNOME</a></li><li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/where-did-they-go-from-here/">Where did they go from here?</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://www.lamolabs.org/blog/226/how-to-setup-a-mail-server-on-centos-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
