1# External SMTP server23It is possible to use maddy as an IMAP server only and have it interface with4external SMTP server using standard protocols.56Here is the minimal configuration that creates a local IMAP index, credentials7database and IMAP endpoint:8```9# Credentials DB.10table.pass_table local_authdb {11 table sql_table {12 driver sqlite313 dsn credentials.db14 table_name passwords15 }16}1718# IMAP storage/index.19storage.imapsql local_mailboxes {20 driver sqlite321 dsn imapsql.db22}2324# IMAP endpoint using these above.25imap tls://0.0.0.0:993 tcp://0.0.0.0:143 {26 auth &local_authdb27 storage &local_mailboxes28}29```3031To accept local messages from an external SMTP server32it is possible to create an LMTP endpoint:33```34# LMTP endpoint on Unix socket delivering to IMAP storage35# in previous config snippet.36lmtp unix:/run/maddy/lmtp.sock {37 hostname mx.maddy.test3839 deliver_to &local_mailboxes40}41```4243Look up documentation for your SMTP server on how to make it44send messages using LMTP to /run/maddy/lmtp.sock.4546To handle authentication for Submission (client-server SMTP) SMTP server47needs to access credentials database used by maddy. maddy implements48server side of Dovecot authentication protocol so you can use49it if SMTP server implements "Dovecot SASL" client.5051To create a Dovecot-compatible sasld endpoint, add the following configuration52block:53```54# Dovecot-compatible sasld endpoint using data from local_authdb.55dovecot_sasld unix:/run/maddy/auth-client.sock {56 auth &local_authdb57}58```