summaryrefslogtreecommitdiffstats
path: root/doc/wiki/FindMailLocation.txt
blob: ed8d62c0246a337ec937a785122a3d746b3839a5 (plain)
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
Finding Your Mail
=================

Before configuring Dovecot, you'll need to know where your mails are located.
You should already have an SMTP server installed and configured to deliver
mails somewhere, so the easiest way to make Dovecot work is to just use the
same location. Otherwise you could create '~/Maildir' directory and configure
your SMTP server to use the Maildir format.

First send a test mail to yourself (as your own non-root user):

---%<-------------------------------------------------------------------------
echo "Hello me" | mail -s "Dovecot test" $USER
---%<-------------------------------------------------------------------------

Now, find where the mail went. Here's a simple script which checks the most
common locations:

---%<-------------------------------------------------------------------------
for mbox in /var/mail/$USER /var/spool/mail/$USER ~/mbox ~/mail/* ~/*; do
  grep -q "Dovecot test" "$mbox" && echo "mbox: $mbox"
done
grep -q "Dovecot test" ~/Maildir/new/* 2>/dev/null && echo "Maildir: ~/Maildir"
---%<-------------------------------------------------------------------------

mbox
----

In most installations your mail went to '/var/mail/username' file. This file is
called *INBOX* in IMAP world. Since IMAP supports multiple mailboxes, you'll
also have to have a directory for them as well. Usually '~/mail' is a good
choice for this. For installation such as this, the mail location is specified
with (typically in 'conf.d/10-mail.conf'):

---%<-------------------------------------------------------------------------
mail_location = mbox:~/mail:INBOX=/var/mail/%u
---%<-------------------------------------------------------------------------

Where '%u' is replaced with the username that logs in. Similarly if your INBOX
is in '~/mbox', use:

---%<-------------------------------------------------------------------------
mail_location = mbox:~/mail:INBOX=~/mbox
---%<-------------------------------------------------------------------------

Maildir
-------

Maildir exists almost always in '~/Maildir' directory. The mail location is
specified with (typically in 'conf.d/10-mail.conf'):

---%<-------------------------------------------------------------------------
mail_location = maildir:~/Maildir
---%<-------------------------------------------------------------------------

Problems?
---------

If you can't find the mail, you should check your SMTP server logs and
configuration to see where it went or what went wrong.

If you can find the mail, but it's in more exotic location, see if
<MailLocation.txt> can help you to configure it.

(This file was created from the wiki on 2019-06-19 12:42)