i've postfix + dovecot running on the same box; delivery between them is via
lmtp.
all in/out-bound, direct traffic flows as expected, securely with TLS.
i've set up a sieve redirect @ dovecot. on test send, the filter triggers,
submits the redirect to local postfix ... and then the delivery of the redirect
fails.
logs report an SSL error ... I don't know yet _what_ the source of that error
is. or if it's a red-herring.
i _suspect_ the problem is on the dovecot/sieve end; maybe my sieve service
config -- or, perhaps a bug there; either way, i'd like (dis)prove it to myself.
my initial questions at this point are simply:
do the current logs, below, suggest an obvious cause of the problem,
whether postfix- or dovecot-?
if not, what specific logging on the postfix end should be enabled, or
increased in verbosity, so as to get more detail re: relevant cause? if any.
here's what I see atm; after clean start
==> /var/log/dovecot/dovecot.log <==
Sep 27 10:08:11 mx postfix/postfix-script[14388]: starting the Postfix
mail system
Sep 27 10:08:11 mx postfix/master[14390]: daemon started -- version
3.5.7, configuration /etc/postfix
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:08:12 master: Info: Dovecot v2.3.10.1 (a3d0e1171)
starting up for imap, submission, lmtp, sieve
where
postfix submission listens on 10.0.1.17:465
dovecot submission listens on 10.0.1.17:60465
& dovecot config includes
submission_host = internal.mx.example.com:60465
submission_relay_host = internal.mx.example.com
submission_relay_port = 465
submission_relay_ssl = smtps
submission_relay_ssl_verify = yes
submission_relay_trusted = yes
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
mode = 0600
user = postfix
group = postfix
}
& with a defined sieve filter,
ls -al /srv/vmail/sieve-scripts/[email protected]
lrwxrwxrwx 1 vmail vmail 64 Sep 26 12:31
'/srv/vmail/sieve-scripts/[email protected]' ->
/srv/vmail/example1.net/user1/Maildir/sieve/managesieve.sieve
cat /srv/vmail/sieve-scripts/[email protected]
# rule:[SIEVETEST]
if header :contains "subject" "SIEVETEST"
{
redirect "[email protected]";
}
mail send, NOT triggering the sieve filter,
echo "Subject: DIRECT" | /usr/sbin/sendmail.postfix [email protected]
succeeds/logs,
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:12:58 lmtp(15360): Info: Connect from local
2020-09-27 10:12:58
lmtp([email protected])<KFvkCRrIcF8APAAA+IOfAw>: Info: sieve:
msgid=<[email protected]>: stored mail into mailbox 'INBOX'
2020-09-27 10:12:58 lmtp(15360): Info: Disconnect from local:
Client has quit the connection (state=READY)
==> /var/log/postfix/postfix.log <==
Sep 27 10:12:58 mx postfix/pickup[15271]: 4Bzsff0zM0zWf9N:
uid=0 from=<root>
Sep 27 10:12:58 mx postfix/cleanup[15343]: 4Bzsff0zM0zWf9N:
message-id=<[email protected]>
Sep 27 10:12:58 mx postfix/qmgr[15270]: 4Bzsff0zM0zWf9N:
from=<[email protected]>, size=297, nrcpt=1 (queue active)
Sep 27 10:12:58 mx postfix/lmtp-relay/lmtp[15354]:
4Bzsff0zM0zWf9N: to=<[email protected]>,
relay=internal.mx.example.com[private/dovecot-lmtp], delay=0.08,
delays=0.01/0.01/0.01/0.04, dsn=2.0.0, status=sent (250 2.0.0
<[email protected]> KFvkCRrIcF8APAAA+IOfAw Saved)
Sep 27 10:12:58 mx postfix/qmgr[15270]: 4Bzsff0zM0zWf9N: removed
& mail send, NOT triggering the sieve filter,
echo "Subject: DIRECT" | /usr/sbin/sendmail.postfix [email protected]
also succeeds/logs
tail -f /var/log/postfix/* /var/log/dovecot/*
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:13:25 lmtp(15406): Info: Connect from local
==> /var/log/postfix/postfix.log <==
Sep 27 10:13:25 mx postfix/pickup[15271]: 4Bzsln6T8wzWfB1:
uid=0 from=<root>
Sep 27 10:13:25 mx postfix/cleanup[15389]: 4Bzsln6T8wzWfB1:
message-id=<[email protected]>
Sep 27 10:13:25 mx postfix/qmgr[15270]: 4Bzsln6T8wzWfB1:
from=<[email protected]>, size=297, nrcpt=1 (queue active)
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:13:25
lmtp([email protected])<52dpOCXJcF8uPAAA+IOfAw>: Info:
msgid=<[email protected]>: saved mail to INBOX
2020-09-27 10:13:25 lmtp(15406): Info: Disconnect from local:
Client has quit the connection (state=READY)
==> /var/log/postfix/postfix.log <==
Sep 27 10:13:25 mx postfix/lmtp-relay/lmtp[15405]:
4Bzsln6T8wzWfB1: to=<[email protected]>,
relay=internal.mx.example.com[private/dovecot-lmtp], delay=0.1,
delays=0.03/0.01/0.01/0.05, dsn=2.0.0, status=sent (250 2.0.0
<[email protected]> 52dpOCXJcF8uPAAA+IOfAw Saved)
Sep 27 10:13:25 mx postfix/qmgr[15270]: 4Bzsln6T8wzWfB1: removed
but, mail send, TRIGGERING the sieve script,
echo "Subject: SIEVETEST" | /usr/sbin/sendmail.postfix
[email protected]
fails/logs,
cat /var/log/dovecot/20200927-102234.15418.1.trace
Sieve trace log for message delivery:
Username: [email protected]
Session ID: JKRfCFrKcF86PAAA+IOfAw
Sender: <[email protected]>
Final recipient: <[email protected]>
Default mailbox: INBOX
00000000: ## Started executing script 'managesieve'
0000001e: 2: not jumping
00000023: 4: redirect action
00000023: 4: forward message to address
<[email protected]>
00000048: ## Finished executing script 'managesieve'
tail -f /var/log/postfix/* /var/log/dovecot/*
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:15:19 lmtp(15360): Info: Connect from local
==> /var/log/dovecot/dovecot-debug.log <==
2020-09-27 10:15:19 submission-login: Debug: SSL: where=0x10,
ret=1: before SSL initialization
2020-09-27 10:15:19 submission-login: Debug: SSL: where=0x2001,
ret=1: before SSL initialization
2020-09-27 10:15:19 submission-login: Debug: SSL: where=0x2002,
ret=-1: before SSL initialization
2020-09-27 10:15:19 submission-login: Debug: SSL: where=0x2002,
ret=-1: before SSL initialization
==> /var/log/postfix/postfix.log <==
Sep 27 10:15:19 mx postfix/pickup[15271]: 4Bzsg33hvQzWf9N:
uid=0 from=<root>
Sep 27 10:15:19 mx postfix/cleanup[15343]: 4Bzsg33hvQzWf9N:
message-id=<[email protected]>
Sep 27 10:15:19 mx postfix/qmgr[15270]: 4Bzsg33hvQzWf9N:
from=<[email protected]>, size=298, nrcpt=1 (queue active)
( this is a reproducible, exactly 30-second delay ... )
==> /var/log/dovecot/dovecot.log <==
2020-09-27 10:15:49
lmtp([email protected])<uHZDHy/IcF8APAAA+IOfAw>: Error: smtp-client: conn
internal.mx.example.com:60465 (10.0.1.17:60465) [1]:
connect(internal.mx.example.com:60465) failed: Connection timed out after 30
seconds
2020-09-27 10:15:49
lmtp([email protected])<uHZDHy/IcF8APAAA+IOfAw>: Error: sieve:
msgid=<[email protected]>: redirect action: failed to redirect
message to <[email protected]>: smtp(internal.mx.example.com:60465): RCPT TO
failed: Connect timed out (temporary failure)
==> /var/log/dovecot/dovecot-debug.log <==
2020-09-27 10:15:49 submission-login: Debug: SSL: where=0x2002,
ret=-1: before SSL initialization
2020-09-27 10:15:49 submission-login: Debug: SSL: where=0x2002,
ret=-1: error
2020-09-27 10:15:49 submission-login: Debug: SSL error:
SSL_accept() failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version
number
==> /var/log/dovecot/dovecot.log <==
2020-09-27 10:15:49 submission-login: Error: smtp-server: conn
10.0.1.17:37444 [1]: Connection lost: read((conn:10.0.1.17:37444,id=1)) failed:
SSL_accept() failed: error:1408F10B:SSL routines:ssl3_get_record:wrong version
number
2020-09-27 10:15:49
lmtp([email protected])<uHZDHy/IcF8APAAA+IOfAw>: Error: sieve: Execution of
script /srv/vmail/sieve-scripts/[email protected] was aborted due to
temporary failure (user logfile
/srv/vmail/sieve-scripts/[email protected] may reveal additional
details)
==> /var/log/dovecot/dovecot-debug.log <==
2020-09-27 10:15:49 submission-login: Debug: SSL error:
SSL_accept() syscall failed: Invalid argument
==> /var/log/dovecot/dovecot-info.log <==
2020-09-27 10:15:49 submission-login: Info: Read failure
(client didn't send a cert): user=<>, rip=10.0.1.17, lip=10.0.1.17, TLS
handshaking: SSL_accept() syscall failed: Invalid argument
2020-09-27 10:15:49 lmtp(15360): Info: Disconnect from local:
Client has quit the connection (state=READY)
==> /var/log/postfix/postfix.log <==
Sep 27 10:15:49 mx postfix/lmtp-relay/lmtp[15354]:
4Bzsg33hvQzWf9N: to=<[email protected]>,
relay=internal.mx.example.com[private/dovecot-lmtp], delay=30, delays=0/0/0/30,
dsn=4.2.0, status=deferred (host internal.mx.example.com[private/dovecot-lmtp]
said: 451 4.2.0 <[email protected]> Execution of Sieve filters was aborted due
to temporary failure (in reply to end of DATA command))