Logging and docs issues around SMTP TLS configuration #1332

Closed
opened 2026-04-05 19:00:59 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jcrawfordor on 6/18/2025

I encountered the same problem as the closed issue #652 . That issue was closed when the reporter seems to have avoided the problem, but it still exists. Any action that leads to an email being sent, like inviting a user or an invited user trying to get a verification code, can result in an exception:

pangolin  |  ⨯ unhandledRejection:  TypeError: Converting circular structure to JSON
pangolin  |     --> starting at object with constructor 'Object'
pangolin  |     --- property 'issuerCertificate' closes the circle
pangolin  |     at JSON.stringify (<anonymous>)
pangolin  |     at Printf.template (server/logger.ts:14:28)
pangolin  |   12 |         }
pangolin  |   13 |         if (Object.keys(metadata).length > 0) {
pangolin  | > 14 |             msg += ` ${JSON.stringify(metadata)}`;
pangolin  |      |                            ^
pangolin  |   15 |         }
pangolin  |   16 |         return msg;
pangolin  |   17 |     }

This appears to be an error encountered when trying to log a more useful message, which is the first thing that could be fixed. In practice, this behavior seems to indicate a problem with verifying the TLS certificate of the mail server (in my situation, it's sending a cert with the wrong domain name due to a split-horizon DNS situation which should be addressed but it is what it is).

Validating the cause/fix was additionally complicated by what I believe to be an error in the documentation at https://docs.fossorial.io/Pangolin/Configuration/config

It states that "smtp_tls_reject_unauthorized" means "Do not fail if the server certificate cannot be verified." However, it's actually the opposite - "true" means it will fail if the server cannot be verified, "false" will allow a connection even with an invalid certificate. Perhaps for the same reason, it also gives the wrong default - it says that the default is "false", but testing shows that the default is "true".

If you encounter the above exception, try setting smtp_tls_reject_unauthorized to false. If that fixes the error, check out the TLS certificate presented by your mail server.

*Originally created by @jcrawfordor on 6/18/2025* I encountered the same problem as the closed issue #652 . That issue was closed when the reporter seems to have avoided the problem, but it still exists. Any action that leads to an email being sent, like inviting a user or an invited user trying to get a verification code, can result in an exception: ``` pangolin | ⨯ unhandledRejection: TypeError: Converting circular structure to JSON pangolin | --> starting at object with constructor 'Object' pangolin | --- property 'issuerCertificate' closes the circle pangolin | at JSON.stringify (<anonymous>) pangolin | at Printf.template (server/logger.ts:14:28) pangolin | 12 | } pangolin | 13 | if (Object.keys(metadata).length > 0) { pangolin | > 14 | msg += ` ${JSON.stringify(metadata)}`; pangolin | | ^ pangolin | 15 | } pangolin | 16 | return msg; pangolin | 17 | } ``` This appears to be an error encountered when trying to log a more useful message, which is the first thing that could be fixed. In practice, this behavior seems to indicate a problem with verifying the TLS certificate of the mail server (in my situation, it's sending a cert with the wrong domain name due to a split-horizon DNS situation which should be addressed but it is what it is). Validating the cause/fix was additionally complicated by what I believe to be an error in the documentation at https://docs.fossorial.io/Pangolin/Configuration/config It states that "smtp_tls_reject_unauthorized" means "Do not fail if the server certificate cannot be verified." However, it's actually the opposite - "true" means it *will* fail if the server cannot be verified, "false" will allow a connection even with an invalid certificate. Perhaps for the same reason, it also gives the wrong default - it says that the default is "false", but testing shows that the default is "true". If you encounter the above exception, try setting smtp_tls_reject_unauthorized to false. If that fixes the error, check out the TLS certificate presented by your mail server.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#1332