state_dir ${stateDir}
$(hostname) = mx.mydomain.com
hostname $(hostname)
$(primary_domain) = mydomain.com
$(local_domains) = $(primary_domain)
tls off
auth.pass_table local_authdb {
table sql_table {
driver sqlite3
dsn credentials.db
table_name passwords
}
}
target.smtp forward_to_vultr {
targets tcp://mediocre-vultr.private-domain.com:587
attempt_starttls no
auth plain "mediocre-desktop" "XXX"
}
target.queue outgoing_queue {
target &forward_to_vultr
autogenerated_msg_domain $(primary_domain)
bounce {
destination postmaster $(local_domains) {
deliver_to &incoming_routing
}
default_destination {
reject 550 5.0.0 "Refusing to send DSNs to non-local addresses"
}
}
}
submission tcp://0.0.0.0:587 {
limits {
all rate 5 1s
}
auth &local_authdb
insecure_auth true
source $(local_domains) {
# If sending to a local domain, route this to the incoming pipeline
# internally
destination postmaster $(local_domains) {
deliver_to &incoming_routing
}
default_destination {
deliver_to &outgoing_queue
}
}
default_source {
reject 501 5.1.8 "Non-local sender domain"
}
}
msgpipeline incoming_routing {
destination postmaster $(primary_domain) {
modify {
replace_rcpt regexp ".+@mydomain.com" "me@mydomain.com"
}
deliver_to &local_mailboxes
}
default_destination {
reject 550 5.1.1 "User doesn't exist"
}
}
smtp tcp://0.0.0.0:25 {
default_source {
destination postmaster $(local_domains) {
deliver_to &incoming_routing
}
default_destination {
reject 550 5.1.1 "User doesn't exist"
}
}
}
storage.imapsql local_mailboxes {
driver sqlite3
dsn imapsql.db
}
imap tcp://0.0.0.0:143 {
tls off
auth &local_authdb
storage &local_mailboxes
}