[GH-ISSUE #73] Sending Voucher by Email stops working #36

Closed
opened 2026-05-07 00:18:04 +02:00 by BreizhHardware · 9 comments

Originally created by @ldelberg on GitHub (Jun 26, 2025).
Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/73

Originally assigned to: @glenndehaan on GitHub.

The problem

Hi @glenndehaan,

thanks again for this great tool and your work.
I'm facing an issue when I try to send a voucher by email.
This has been working but now I get this error:

Image

Could you please help me getting this feature back working.

Thanks and best regards,
Lars

What version of UniFi Voucher Site has the issue?

6.0.4

What was the last working version of UniFi Voucher Site?

No response

What type of installation are you running?

Docker

Anything in the logs that might be useful for us?


Additional information

No response

Originally created by @ldelberg on GitHub (Jun 26, 2025). Original GitHub issue: https://github.com/glenndehaan/unifi-voucher-site/issues/73 Originally assigned to: @glenndehaan on GitHub. ### The problem Hi @glenndehaan, thanks again for this great tool and your work. I'm facing an issue when I try to send a voucher by email. This has been working but now I get this error: <img width="1293" alt="Image" src="https://github.com/user-attachments/assets/861fd297-a18c-4e9c-b478-8f599274669a" /> Could you please help me getting this feature back working. Thanks and best regards, Lars ### What version of UniFi Voucher Site has the issue? 6.0.4 ### What was the last working version of UniFi Voucher Site? _No response_ ### What type of installation are you running? Docker ### Anything in the logs that might be useful for us? ```Text ``` ### Additional information _No response_
BreizhHardware 2026-05-07 00:18:04 +02:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@glenndehaan commented on GitHub (Jun 26, 2025):

Hi @ldelberg,

I just checked my instance but here on the latest version it is working fine:

Image

Did you just set this up?

Looking at the IP it's trying to connect to for the SMTP service seems to be wrong to me. 0.0.0.0 would be odd unless you mean 127.0.0.1 but then still this would be odd since that would mean it's own container. And the UniFi Voucher Site container does not offer an SMTP service. I would check the SMTP_HOST environment variable to see if the right SMTP host is setup.

Also please note that this does rely on an external SMTP service to send the email to. There is no internal SMTP service what would be responsible for delivering the email.

Kind regards,
Glenn de Haan

<!-- gh-comment-id:3008261665 --> @glenndehaan commented on GitHub (Jun 26, 2025): Hi @ldelberg, I just checked my instance but here on the latest version it is working fine: ![Image](https://github.com/user-attachments/assets/dec2f8d7-12dd-4160-b79b-b589115f196d) Did you just set this up? Looking at the IP it's trying to connect to for the SMTP service seems to be wrong to me. 0.0.0.0 would be odd unless you mean 127.0.0.1 but then still this would be odd since that would mean it's own container. And the UniFi Voucher Site container does not offer an SMTP service. I would check the `SMTP_HOST` environment variable to see if the right SMTP host is setup. Also please note that this does rely on an external SMTP service to send the email to. There is no internal SMTP service what would be responsible for delivering the email. Kind regards, Glenn de Haan
Author
Owner

@ldelberg commented on GitHub (Jun 26, 2025):

Hi @glenndehaan ,

thanks for the fast reply.
I've configured UniFi Voucher to use sendgrid sending emails.
This is the part of the docker-compose.yml:

# SMTP Mail server hostname/ip (optional)
SMTP_HOST: 'smtp.sendgrid.net'
# SMTP Mail server port (optional)
SMTP_PORT: '465'
# SMTP Mail use TLS? (optional)
SMTP_SECURE: 'true'
# SMTP Mail username (optional)
SMTP_USERNAME: 'apikey'
# SMTP Mail password (optional)
SMTP_PASSWORD: ****************

It was working in the past.

Thanks and best regards,
Lars

<!-- gh-comment-id:3008280936 --> @ldelberg commented on GitHub (Jun 26, 2025): Hi @glenndehaan , thanks for the fast reply. I've configured UniFi Voucher to use sendgrid sending emails. This is the part of the docker-compose.yml: ``` # SMTP Mail server hostname/ip (optional) SMTP_HOST: 'smtp.sendgrid.net' # SMTP Mail server port (optional) SMTP_PORT: '465' # SMTP Mail use TLS? (optional) SMTP_SECURE: 'true' # SMTP Mail username (optional) SMTP_USERNAME: 'apikey' # SMTP Mail password (optional) SMTP_PASSWORD: **************** ``` It was working in the past. Thanks and best regards, Lars
Author
Owner

@glenndehaan commented on GitHub (Jun 26, 2025):

Can you verify for me what the Feature Status page returns under Email?

<!-- gh-comment-id:3008315825 --> @glenndehaan commented on GitHub (Jun 26, 2025): Can you verify for me what the Feature Status page returns under Email?
Author
Owner

@ldelberg commented on GitHub (Jun 26, 2025):

of course :)

Image
<!-- gh-comment-id:3008319931 --> @ldelberg commented on GitHub (Jun 26, 2025): of course :) <img width="897" alt="Image" src="https://github.com/user-attachments/assets/3803deb8-a1da-4b55-a07e-6ca03a2af3bb" />
Author
Owner

@glenndehaan commented on GitHub (Jun 26, 2025):

Wow that is weird. That would mean the variable is correct. But somewhere smtp.sendgrid.net is translated to 0.0.0.0. Is there some sort of DNS tickery going on within your container setup? Because when I replicate this locally without a valid API key I get a response from sendgrid telling me to check my key.

<!-- gh-comment-id:3008327434 --> @glenndehaan commented on GitHub (Jun 26, 2025): Wow that is weird. That would mean the variable is correct. But somewhere smtp.sendgrid.net is translated to 0.0.0.0. Is there some sort of DNS tickery going on within your container setup? Because when I replicate this locally without a valid API key I get a response from sendgrid telling me to check my key.
Author
Owner

@ldelberg commented on GitHub (Jun 26, 2025):

nope - there shouldn't be something with DNS. I use sendgrid with other services and they are still working.
I'll try to reboot the docker server and check if this solves my issue.

<!-- gh-comment-id:3008345303 --> @ldelberg commented on GitHub (Jun 26, 2025): nope - there shouldn't be something with DNS. I use sendgrid with other services and they are still working. I'll try to reboot the docker server and check if this solves my issue.
Author
Owner

@glenndehaan commented on GitHub (Jun 26, 2025):

So I changed my hosts file locally to 0.0.0.0 and indeed I get the same error when using smtp.sendgrid.net:

Image

So it looks to me there is a DNS resolution error somewhere. The thing is the email module in the app has not changed in a while and I don't see how this is related to the app itself. On thing you could try is to revert to the v5 version to see if that fixes anything but my guess is it won't. (I would try 5.1.3 this is one version before the last change in the email module)

It seems to me that somewhere the DNS is returning something that is incorrect. I would suggest trying to setup the app locally or on another machine to see if it would fix the issue. But as far as I can see now the app has not changed so it must be something in the infrastructure on your side. You could also try some ping's and dig's within the container and another machine to see if the results are different.

<!-- gh-comment-id:3008452038 --> @glenndehaan commented on GitHub (Jun 26, 2025): So I changed my hosts file locally to 0.0.0.0 and indeed I get the same error when using smtp.sendgrid.net: ![Image](https://github.com/user-attachments/assets/0a1bc93c-5bf1-4071-9a1f-ba5a6496ac96) So it looks to me there is a DNS resolution error somewhere. The thing is the email module in the app has not changed in a while and I don't see how this is related to the app itself. On thing you could try is to revert to the v5 version to see if that fixes anything but my guess is it won't. (I would try 5.1.3 this is one version before the last change in the email module) It seems to me that somewhere the DNS is returning something that is incorrect. I would suggest trying to setup the app locally or on another machine to see if it would fix the issue. But as far as I can see now the app has not changed so it must be something in the infrastructure on your side. You could also try some ping's and dig's within the container and another machine to see if the results are different.
Author
Owner

@ldelberg commented on GitHub (Jun 26, 2025):

Thanks, @glenndehaan and sorry!
It was an issue on the docker server - after a restart of the server everything is working fine, again :)

Image

Thanks for your fast support and sorry that I didn't test this before bothering you.

King regards,
Lars

<!-- gh-comment-id:3008600178 --> @ldelberg commented on GitHub (Jun 26, 2025): Thanks, @glenndehaan and sorry! It was an issue on the docker server - after a restart of the server everything is working fine, again :) <img width="1330" alt="Image" src="https://github.com/user-attachments/assets/7202242c-3ea9-4428-bf80-7210bbd8b9ae" /> Thanks for your fast support and sorry that I didn't test this before bothering you. King regards, Lars
Author
Owner

@glenndehaan commented on GitHub (Jun 26, 2025):

No problem always happy to help out. Great to hear everything is working again!

<!-- gh-comment-id:3008606063 --> @glenndehaan commented on GitHub (Jun 26, 2025): No problem always happy to help out. Great to hear everything is working again!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/unifi-voucher-site#36
No description provided.