<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Dovecot_basic</id>
	<title>Dovecot basic - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.marcelpost.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Dovecot_basic"/>
	<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Dovecot_basic&amp;action=history"/>
	<updated>2026-06-11T18:12:09Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://www.marcelpost.com/wiki/index.php?title=Dovecot_basic&amp;diff=1388&amp;oldid=prev</id>
		<title>Admin: /* IMAP sync with Gmail */</title>
		<link rel="alternate" type="text/html" href="https://www.marcelpost.com/wiki/index.php?title=Dovecot_basic&amp;diff=1388&amp;oldid=prev"/>
		<updated>2014-04-24T01:57:21Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;IMAP sync with Gmail&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Dovecot basic&lt;br /&gt;
&lt;br /&gt;
* dovecot-imapd&lt;br /&gt;
* exim4&lt;br /&gt;
* fetchmail&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
apt-get install dovecot-imapd exim4 fetchmail&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===setting up exim===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dpkg-reconfigure exim4-config&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
General type of mail configuration: internet site&lt;br /&gt;
&lt;br /&gt;
System mail name: mydomain.com&lt;br /&gt;
&lt;br /&gt;
IP-addresses to listen on for incoming SMTP connections: No value (all interfaces)&lt;br /&gt;
&lt;br /&gt;
Other destinations for which mail is accepted: mydomain.com&lt;br /&gt;
&lt;br /&gt;
Domains to relay mail for: No value (no other domains)&lt;br /&gt;
&lt;br /&gt;
Machines to relay mail for: No value (no other machines)&lt;br /&gt;
&lt;br /&gt;
Keep number of DNS-queries minimal (Dial-on-Demand)? No&lt;br /&gt;
&lt;br /&gt;
Delivery method for local mail: Maildir format in home directory&lt;br /&gt;
&lt;br /&gt;
Split configuration into small files? Yes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==setting up dovecot==&lt;br /&gt;
&lt;br /&gt;
create a new file /etc/dovecot/passwd&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
test:{PLAIN}pass&lt;br /&gt;
bill:{PLAIN}secret&lt;br /&gt;
timo@example.com:{PLAIN}hello123&lt;br /&gt;
dave@example.com:{PLAIN}world234&lt;br /&gt;
joe@elsewhere.org:{PLAIN}whee&lt;br /&gt;
jane@elsewhere.org:{PLAIN}mypass&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To store passwords encypted, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
doveadm pw -s ssha&lt;br /&gt;
Enter new password: foo&lt;br /&gt;
Retype new password: foo&lt;br /&gt;
{SSHA}DNODS3ZrOq1bu2MasNk79LxHhlU9iI03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that you won&amp;#039;t get the same output after {SSHA} as above, because Dovecot uses random salts when creating the SSHA hash. This means that even if multiple users have the same password, you won&amp;#039;t know that because their hashes are different.&lt;br /&gt;
&lt;br /&gt;
The passwd file entry would be:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bill:{SSHA}DNODS3ZrOq1bu2MasNk79LxHhlU9iI03&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the 2.x versions of Dovecot the configuration files have been split up (as opposed to a single dovecot.conf file in 1.x versions).&lt;br /&gt;
&lt;br /&gt;
Below are listed the modifications required on the default dovecot config files (after a fresh installation).&lt;br /&gt;
&lt;br /&gt;
* /etc/dovecot/dovecot.conf&lt;br /&gt;
&lt;br /&gt;
Leave as-is.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* /etc/dovecot/conf.d/10-auth.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
disable_plaintext_auth = no&lt;br /&gt;
auth_mechanisms = plain&lt;br /&gt;
!include auth-system.conf.ext&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* /etc/dovecot/conf.d/10-mail.conf&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
mail_location = maildir:~/Maildir&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* /etc/dovecot/conf.d/auth-passwdfile-conf.ext&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
passdb {&lt;br /&gt;
   driver = passwd-file&lt;br /&gt;
   args = /etc/dovecot/users&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
userdb {&lt;br /&gt;
   driver = passwd-file&lt;br /&gt;
   args = uid=vmail gid=vmail home=/home/vmail/%u&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==setting up fetchmail==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
~/.fetchmailrc&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
poll localhost with proto POP3&lt;br /&gt;
user abc@xyz.org&lt;br /&gt;
pass bill123&lt;br /&gt;
is yyy@gmail.com here&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==IMAP sync with Gmail==&lt;br /&gt;
&lt;br /&gt;
apt-get install offlineimap&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* offlineimaprc example&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[general]&lt;br /&gt;
accounts = Gmail&lt;br /&gt;
maxsyncaccounts = 1&lt;br /&gt;
&lt;br /&gt;
[Account Gmail]&lt;br /&gt;
localrepository = Local&lt;br /&gt;
remoterepository = Remote&lt;br /&gt;
maxage = 365&lt;br /&gt;
&lt;br /&gt;
[Repository Local]&lt;br /&gt;
sep = /&lt;br /&gt;
type = Maildir&lt;br /&gt;
localfolders = /disk/mail/dovecot/varvmail/mydomain.com/gmail/Maildir&lt;br /&gt;
nametrans = lambda folder: re.sub(&amp;#039;Junk&amp;#039;, &amp;#039;[Gmail].Spam&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Drafts&amp;#039;, &amp;#039;[Gmail].Drafts&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Inbox&amp;#039;, &amp;#039;[Gmail].INBOX&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Trash&amp;#039;, &amp;#039;[Gmail].Bin&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Sent&amp;#039;, &amp;#039;[Gmail].Sent Mail&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Flagged&amp;#039;, &amp;#039;[Gmail].Starred&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Trash&amp;#039;, &amp;#039;[Gmail].Trash&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Important&amp;#039;, &amp;#039;[Gmail].Important&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;Archive&amp;#039;, &amp;#039;[Gmail].All Mail&amp;#039;, folder)))))))))&lt;br /&gt;
&lt;br /&gt;
[Repository Remote]&lt;br /&gt;
type = Gmail&lt;br /&gt;
remotehost = imap.gmail.com&lt;br /&gt;
remoteuser = my.email.address@gmail.com&lt;br /&gt;
remotepass = mypassword&lt;br /&gt;
ssl = yes&lt;br /&gt;
maxconnections = 3&lt;br /&gt;
realdelete = no&lt;br /&gt;
## One-way synching.  Perfect for backups.&lt;br /&gt;
readonly = true&lt;br /&gt;
nametrans = lambda folder: re.sub(&amp;#039;.*Spam$&amp;#039;, &amp;#039;Junk&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Drafts$&amp;#039;, &amp;#039;Drafts&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*INBOX$&amp;#039;, &amp;#039;Inbox&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Sent Mail$&amp;#039;, &amp;#039;Sent&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Starred$&amp;#039;, &amp;#039;Flagged&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Trash$&amp;#039;, &amp;#039;Trash&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Bin$&amp;#039;, &amp;#039;Trash&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*Important$&amp;#039;, &amp;#039;Important&amp;#039;,&lt;br /&gt;
                           re.sub(&amp;#039;.*All Mail$&amp;#039;, &amp;#039;Archive&amp;#039;, folder)))))))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
&lt;br /&gt;
host#~: offlineimap -c offlineimaprc&lt;br /&gt;
&lt;br /&gt;
Afterwards I reassign vmail as owner and group to all folders to be sure that messages are not left as root:root.&lt;br /&gt;
&lt;br /&gt;
host#~: chmod -R vmail:vmail /disk/mail/dovecot/varvmail&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>