By Brian Can
My newly deployed web app seems stuck at email service port as the server keeps complaining null value of it and thus preventing other access to api requests. Please correct my config or point out what I have missed other than this config to get email configuration work.
here is my service config:
[Unit]
Description=Kestrel service running on Ubuntu 20.04
[Service]
WorkingDirectory=/var/mydir
ExecStart=/usr/bin/dotnet /var/myfolder/API.dll
Restart=always
RestartSec=10
SyslogIdentifier=myidentifier
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment='Token__Key=OKOKOKOKOK'
Environment='Token__Issuer=http://myIp'
Environment='EmailConfiguration__From=myEmail;SmtpServer=smtp.ionos.com;Port=465;Username=myEmail;Password=myPW'
[Install]
WantedBy=multi-user.target
Besides, I tried allow firewall as below: sudo ufw allow 465/tcp
Using netstate -ntpl, I didn’t see 465 is listed Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 77669/dotnet tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 40751/docker-proxy tcp 0 0 127.0.0.1:44879 0.0.0.0:* LISTEN 7207/containerd tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 80693/docker-proxy tcp 0 0 0.0.0.0:8081 0.0.0.0:* LISTEN 31727/docker-proxy tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 19179/systemd-resol tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 18860/sshd: /usr/sb tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 37713/docker-proxy tcp6 0 0 ::1:5000 :::* LISTEN 67679/dotnet tcp6 0 0 :::6379 :::* LISTEN 60755/docker-proxy tcp6 0 0 :::80 :::* LISTEN 33532/apache2 tcp6 0 0 :::8080 :::* LISTEN 50700/docker-proxy tcp6 0 0 :::8081 :::* LISTEN 37035/docker-proxy tcp6 0 0 :::22 :::* LISTEN 17860/sshd: /usr/sb tcp6 0 0 :::5432 :::* LISTEN 37719/docker-proxy
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
As you are connecting to an external SMTP service, it is normal that port 465 is not shown in the netstat command output. Only if you were running your own SMTP server, then you would see the port in there.
Regarding the environment variables definition, have you tried adding each environment variable on a separate line rather than separated by a semicolon?
Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.