Score:1

Inexplicable phpmailer <==> postfix Exchange

in flag

I am trying to connect the (vital) email output from our new MantisBT bugtracking system to use our email server as a smart host. The idea is that the MantisBT system sends TLS traffic to port 587 on the email server, authenticating as special user ([email protected]), and the email server sends it to the destination. My understanding is that this is the right way to do it, but I could be wrong.

MantisBT uses phpmailer, which is (I think) appropriately configured to use SMTP 587, user id, yada, yada. The email server is a long standing iRedMail installation (which internally uses postfix) with no known issues. We use this technique for outgoing traffic for other internal servers without problem. Both servers are running Rocky Linux 9.1.

The problem is that all of MantisBT's attempts to send messages are immediately dropped.

I have enabled detailed debugging for MantisBT's ip in postfix, and get the following (left side of log removed for clarity):

 > unknown[159.xx.xx.20]: 220 mailserver.mydomain.com ESMTP Postfix
 watchdog_pat: 0x564330697960
 < unknown[159.xx.xx.20]: ????
 > unknown[159.xx.xx.20]: 500 5.5.2 Error: bad UTF-8 syntax
 watchdog_pat: 0x564330697960
 < unknown[159.xx.xx.20]: ??????
 > unknown[159.xx.xx.20]: 500 5.5.2 Error: bad UTF-8 syntax
 watchdog_pat: 0x564330697960
 < unknown[159.xx.xx.20]:
 dict_pcre_lookup: /etc/postfix/command_filter.pcre:
 > unknown[159.xx.xx.20]: 500 5.5.2 Error: bad syntax
 watchdog_pat: 0x564330697960
 smtp_get: EOF

Does anyone recognize this? Why would phpmailer send four question marks as a command in an SMTP exchange? Is this about STARTTLS?

Thanks for all help!

anx avatar
fr flag
anx
"sends TLS traffic to port 587" suggests a potential [mismatch between transport security method configured and port used, see this](https://serverfault.com/questions/1116465/postfix-logs-showing-as-command-from-client/1116755#1116755).
in flag
Yes, that seems to be the same issue. In summary, MantisBT is starting in TLS immediately whereas postfix is expecting to start in plaintext and then get a STARTTLS command. I will investigate using 465.
Score:1
in flag

I am mildly ashamed to admit that this was caused by an error in the MantisBT email configuration. I had used $g_smtp_connection_mode = 'ssl'; where it should have been 'tls'. It consequently used SSL immediately instead of starting in plain text and then switching to encrypted communication following STARTTLS. The ???? in the postfix log are thus showing unprintable (encrypted) characters.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.