mirror of
https://github.com/glenndehaan/unifi-voucher-site.git
synced 2026-05-09 08:25:29 +02:00
[GH-ISSUE #83] SMTP TLS/STARTTLS/port question #40
Labels
No labels
bug
enhancement
pull-request
question
question
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/unifi-voucher-site#40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @X0mbiRapt0r on GitHub (Jul 24, 2025).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/83
Originally assigned to: @glenndehaan on GitHub.
The question
Hi,
Firstly, excellent project, it works like a charm for our use case. :)
We recently set it up on a Pi in office, and everything worked, but once we moved it to the remote site where it is to be used, email functionality stopped working.
However, we have tracked this to port 25 being blocked by the ISP there. There's no fault with the container itself.
We had to use port 25 though, we tried using 587 with encryption, but it seems the TLS being used isn't what MS365 (which is notoriously picky about TLS, specifically expecting STARTTLS usually) likes.
I get this error when trying to use TLS over port 587: "[Mail] A0A52289FFFF0000:error:0A00010B:SSL routines:tls_validate_record_header:wrong version number:ssl/record/methods/tlsany_meth.c:80:"
Is there a way to apply finer control to the SMTP security, like specifying STARTTLS or TLS version 1.3/1.2?
Has anyone else maybe reported similar issues with the SMTP implementation and MS365 as the SMTP provider?
@glenndehaan commented on GitHub (Jul 24, 2025):
Hi @X0mbiRapt0r,
Unfortunately i'm unable to test this from my side since I don't have access to Office 365.
But I did some research and found that the library I use to send the mail can be switched from TLS to STARTTLS.
Basically the
SMTP_SECUREenvironment variable controls if TLS is enforced. So if set tofalsethis would fall back to STARTTLS.If this does not work I could try to see if I can implement optional cipher selection support,
But from what I have seen online utilizing port 587 with
SMTP_SECUREset tofalseshould fix this issue.Kind regards,
Glenn de Haan
@X0mbiRapt0r commented on GitHub (Jul 25, 2025):
Hi, @glenndehaan
Oh, cool, I'll definitely try it set to false in the morning, thanks.
If that doesn't work, my next step would be to take it up with the ISP to get port 25 unblocked as this will be a requirement for us later when we move over to SMTP relay (MS365 seems to default to 25 for their relay requirements), so no need to try and implement anything, but thanks regardless.
Kind regards,
Irish