Symfony 4 swiftmailer configuration issues - symfony

I have tried setting up SMTP in the dotenv file:
MAILER_URL=smtp://mydomain.nl:25?encryption=tls&username=noreply%mydomain.nl&password=***`
And I've sent an email using php bin/console swiftmailer:email:send. This gave me an error:
[app] Exception occurred while flushing email queue: Connection could not be established with host webmail.mydomain.nl [Connection timed out #110]`
So I assumed this is caused by the firewall. So then I tried to send an email via an online SMTP tester and the email got sent and all worked as expected.
However, this still does not work on my server. Even after turning off the firewall on my (Windows) VPS, the same error persists.
My setup is as follows:
I have a VPS (WINDOWS) with plesk where I host my domain and the mail server.
I also have a home server (CENTOS) where I host my subdomain with plesk.
What am I overlooking? What could be the cause of this issue?

Some host providers block 465 and 25 port. So only 587 is left to use. First, contact your host provider and ask if they are blocking SMTP ports. And if not please come back with more information and server config.

So apparently, please correct me if im wrong. This is what I think I did wrong:
I have a subdomain from my main plesk which I host on my home server. The project i'm working on is running from there.
The main domain with that plesk account is running on a VPS with the mailserver.
As it turns out (I think) my ISP from my home internet has restricted access to port 25. And thats why my home server cant access the mail server.
I tried to disable firewalls everywhere, even routed the ports in my router to my home server, nil fix. (please note that i tried to telnet to several SMTP servers not just my own) with all access rejected.
I tried it with another port (465) from my home server and it works now.
At the end using another port did the trick. I am however not sure that this is the issue. But this is just my guess.

Related

Having Issue with Cloudflare and Nginx proxy manager where it does not connect to my local server. (Error 522/523)

I'm trying for the first time to connect my local server (Synology) through NGINX and Cloudflare so I can access it through my own domain name. I have the proxy host all set up pointing to my local IP address with the port and I have an SSL encryption using Let's Encrypt. The site gives me either a timed out error or unreachable, however one time somehow the site took my to ASUS aicloud which is through my ASUS ac68u router but I was not even pointing NGINX to that.
using cloudflare diagnostic center site it syas the request failed because the web server did not respond.
I'm not sure whether my router is blocking Cloudflare or if there is any other issue going on, would appreciate any help with the matter!

Creation of AMI from operating wordpress site yield "connection refused" with elastic ip

I created an AWS server and installed wordpress with an elastic ip address and verified that the default website was up and running.
I wanted to make a backup image at that point so that I could use it as a beginning point for other websites. However, after getting the AMI running and attaching the elastic ip address to it, I got an "connection refused" error. I can both SSH and FTP into the server, but the wordpress site is offline. I then switched the elastic ip back to the original server and got the exact same issue.
I'm guessing that this is a "change of ip" type error(?) (although, when I've seen that before, the connection has never been outright refused... it usually allows at least access to the admin area of the website) but I thought by using an elastic ip address that I would avoid that. I'm also confused by the error in the first server, since the database still has that address.
Any ideas about how to troubleshoot something like that? Is there anything else that it could be?
Well.... I missed something vital.
Using an AMI works just fine with an elastic ip address. I had forgotten to make sure the webserver (httpd) and mysqld were running with :
service httpd restart
and
service mysqld restart
What made it click was reading that the main reason for this error is that there is listener to the incoming data.
Duh.

Drupal error when accessing sites: Can't get hostname for your address

I'm getting the following error when trying to access sites on my server through the browser. I can ssh to the server and I tried running a flush hosts command but that didn't do anything. The host in question is in the mysql user table and has a username/password and all relevant privs. This issue appeared since an office move and the server was switched back on. I can only think it of being a network issue of some sort.
PDOException: SQLSTATE[HY000] [1042] Can't get hostname for your address in db_table_exists()
How do I resolve this?
I think you need to check if the mysql hostname defined in $databases['default']['default']['host'] of the Drupal sites/default/settings.php file is reached by the machine where drupal is running.
Try to connect to ssh and do a ping or a telnet with the hostname.
Instead of the hostname try using the ip address. Otherwise, if the hostname is not resolved, try adding it to /etc/hosts if you're on linux.

Configuring WL to listen for my IP address

I know how to configure WL to listen for a my IP address instead of localhost. I had done it in past and it worked as well. Today suddenly things are broken, as usual I started my server configured for listening to my IP address and I was not even able to open the WL console.
I thought it could be some proxy issue so I removed all my proxies and then tried but no help. Then just to be double sure I used curl and tried to GET the admin page but still no help.
Then I thought that it could related to some recent firewall blocking rules my company might have pushed so this link and added my port to unblock list for both inbound and unbound rules, but still not help.
Does anyone has any idea whether there is something I can do to debug or rectify this issue. Please note that I have already tried changing my WL listen address to "no address", specific address etc. but it doesn't help, and I have tried netstat -a -n command and I can see there is a connection listening for my IP:port, but in the end I cannot access that connection/socket or in other words I cannot access my WL admin console or my application
I am assuming that your servers and applications are running. But you are not able to access them.
In this case, You can start from here.
1. Verify whether you are able to ping the admin host. If so, see whether telnet is allowed on admin port.
2. Try accessing the console with both FQDN and ip address.
3. If vnc server is configured on your server which is hosting weblogic, try launching chrome from VNC to access weblogic admin console.

IIS 7 smtp cant send email

my application needs to send out emails to its users, but somehow I can't make it work. I have installed the SMTP server and in IIS I have set SMTP to use localhost, with port 25 without authentication. But when I try to send email, I am allways getting error
No connection could be made because the target machine actively refused it 127.0.0.1:25
When I choose the option to store email in directory, it works fine, so the problem isn't in my app. Why does this happen? The only thing I am thinking about, is if I need to have port 25 opened or not?
This would happen if you don't have an SMTP server listening on port 25.

Resources