maddy

Fork https://github.com/foxcpp/maddy

git clone git://git.lin.moe/go/maddy.git

 1# External SMTP server
 2
 3It is possible to use maddy as an IMAP server only and have it interface with
 4external SMTP server using standard protocols.
 5
 6Here is the minimal configuration that creates a local IMAP index, credentials
 7database and IMAP endpoint:
 8```
 9# Credentials DB.
10table.pass_table local_authdb {
11    table sql_table {
12        driver sqlite3
13        dsn credentials.db
14        table_name passwords
15    }
16}
17
18# IMAP storage/index.
19storage.imapsql local_mailboxes {
20    driver sqlite3
21    dsn imapsql.db
22}
23
24# IMAP endpoint using these above.
25imap tls://0.0.0.0:993 tcp://0.0.0.0:143 {
26    auth &local_authdb
27    storage &local_mailboxes
28}
29```
30
31To accept local messages from an external SMTP server
32it is possible to create an LMTP endpoint:
33```
34# LMTP endpoint on Unix socket delivering to IMAP storage
35# in previous config snippet.
36lmtp unix:/run/maddy/lmtp.sock {
37    hostname mx.maddy.test
38
39    deliver_to &local_mailboxes
40}
41```
42
43Look up documentation for your SMTP server on how to make it
44send messages using LMTP to /run/maddy/lmtp.sock.
45
46To handle authentication for Submission (client-server SMTP) SMTP server
47needs to access credentials database used by maddy. maddy implements
48server side of Dovecot authentication protocol so you can use
49it if SMTP server implements "Dovecot SASL" client.
50
51To create a Dovecot-compatible sasld endpoint, add the following configuration
52block:
53```
54# Dovecot-compatible sasld endpoint using data from local_authdb.
55dovecot_sasld unix:/run/maddy/auth-client.sock {
56    auth &local_authdb
57}
58```