I want that dovecot vacation extension uses an external smtp server for sending the out of office (vacation) mails.
Current setup: I use postfix for my incomming mails and dovecot for my imap, all this runs in k8s. One deployment with postfix and one deployment with dovecot.
Incomming host is mail.domain.nl Outgoing (smtp) is smtp.domain.nl
so a mail comes with postfix then goes to dovecot, using aliases and there i have a config file that says when "to" is [email protected] send vacation reply
I have researched some time and found that with dovecot you can specify an external smtp with
submission_host = smtp.domain.nl:587
When testing this i got an authentication error:
vacation action: failed to send vacation response to X: <smtp(mail.domain.nl:587): RCPT TO failed: 554 5.7.1 You are not authenticated It is only possible to submit mails over secure authenticated connections Please secure the connection with STARTTL and send a valid username and password before you send "MAIL FROM"> (permanent error)
Is it possible to set authentication for the external smtp? Or can i maybe use postfix to send the replies? If so how?
postfix.conf
postscreen_upstream_proxy_protocol = haproxy
postscreen_upstream_proxy_timeout = 5s
alias_maps = hash:/etc/postfix/aliases
alias_database = hash:/etc/postfix/aliases
smtpd_tls_cert_file=/etc/postfix/ssl/tls.crt
smtpd_tls_key_file=/etc/postfix/ssl/tls.key
smtpd_tls_security_level=may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
mydestination = hash:/etc/postfix/mydestinations
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command =
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
virtual_alias_domains = proxy:mysql:/etc/postfix/mysql_virtual_alias_domains.cf,hash:/etc/postfix/local_recipient_maps
virtual_alias_maps = hash:/etc/postfix/local_recipient_maps,mysql:/etc/postfix/mysql_virtual_alias_maps.cf,proxy:mysql:/etc/postfix/mysql_forwards.cf
virtual_mailbox_domains = virtual.tld
virtual_transport = lmtp:dovecot.mail.svc.cluster.local:24
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
spamc_destination_recipient_limit = 1
smtp inet n - n - 1 postscreen
smtpd pass - - n - - smtpd -o content_filter=spamc
pickup unix n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr unix n - n 300 1 qmgr
#qmgr unix n - n 300 1 oqmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o syslog_name=postfix/$service_name
# -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - 200 lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
postlog unix-dgram n - n - 1 postlogd
spamc unix - n n - 200 pipe
flags=DROhu user=nobody argv=/usr/bin/spamc -u ${user} -d spamassassin.mail -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
dovecot.conf
haproxy_trusted_networks = 10.40.0.0/16
service imap-login {
inet_listener imap {
haproxy = yes
}
inet_listener imaps {
haproxy = yes
}
}
service pop3-login {
inet_listener pop3 {
haproxy = yes
}
inet_listener pop3s {
haproxy = yes
}
}
service lmtp {
executable = lmtp -L
inet_listener {
port = 24
}
}
protocol lmtp {
postmaster_address = [email protected]
info_log_path = /dev/stdout
mail_plugins = sieve
}
submission_host = smtp.domain.nl:587
lda_original_recipient_header = X-Original-To
plugin {
sieve = /sieve/default.sieve
sieve_vacation_use_original_recipient = yes
}
# default.sieve
require ["vacation"];
if header :contains "To" ["X"] {
vacation
:days 1
:subject "Out of Office AutoReply"
"This message is to inform you that I am out of the office.";