Connection could not be established with host mail.domain.com [Connection timed out #110]
-
Under Manage > System > Status:
App Version 1.8.159 Date & Time Dec 20, 2024 15:49 Timezone (.env) America/Chicago (GMT-0600) Protocol HTTPS DB Mysql (8.0.37-0ubuntu0.22.04.3) Web Server Apache/2.4.58 (Ubuntu) PHP Version PHP 8.3.6 PHP upload_max_filesize / post_max_size 5G / 5G PHP Extensions OpenSSL OK PDO OK Mbstring OK Tokenizer OK JSON OK XML OK IMAP OK GD OK fileinfo OK ZIP OK iconv OK cURL OK DOM OK libxml OK intl OK pcntl (console PHP) OK Functions shell_exec (PHP) OK proc_open (PHP) OK fpassthru (PHP) OK symlink (PHP) OK iconv (PHP) OK pcntl_signal (console PHP) OK ps (shell) OK Permissions These folders must be writable by web server user (www-data). Recommended permissions: 775 storage/app/ OK storage/framework/ OK storage/framework/cache/data/ OK storage/logs/ OK bootstrap/cache/ OK public/css/builds/ OK public/js/builds/ OK public/modules/ OK Modules/ OK public/storage (symlink) OK .env OK
For reference: https://github.com/freescout-help-desk/freescout/wiki/Fetching-Emails#troubleshooting-fetching
@staff possible fix? unsure how to implement this myself https://github.com/freescout-help-desk/freescout/issues/3823#issuecomment-1965724963
P.S. I'm on v8.2.1 (Ubuntu 24.04 LTS)
-
@joseph service is all green and yes roundcube works fine. I can send and receive mail to all my mailboxes including the FreeScout ones in roundcube. It just doesn’t work in fs. This stopped working suddenly on its own.
Here's the result of the test initiated from:
Manage > Settings > Mail Settings > Send Test To
Under
Manage > Mailboxes > Connection Settings > Sending Emails > Send Test To
resulting error says to make sure port 587 is open and it is since I checked using an online tool by entering my server IP and port 587 and it spat out OPEN. The same goes forfetching emails
and says check port 993 and that is open too, so it's not a port issue.Off the top of my head I did the following troubleshooting steps:
- Manage > System > Status: It's all OK and queue:work Running
- Manage > System > Tools > Clear Cache
- Restarted app manually
- App updated overnight to package 1.11.19
- Checked ports 587 and 993 using online website and confirmed they are OPEN
- Checked logs as mentioned in FS Troubleshooting page and posted results in initial post
- Created a new app password (mail) to use with my mailbox (not the issue as my other FS mailboxes aren't working too)
- Can confirm CR mailserver is working fine as I can send/receive mail in Roundcube to all mailboxes including my Freescount mailboxes. I can also check/send mail from iOS mail app.
- Freescout test mail settings sent and received the email just fine so the mail settings (SMTP Mailgun) is working in the app. It just refuses to send/fetch at the mailbox level.
Log errors are:
Error: connection failed - stream_socket_client(): Unable to connect to ssl://mail.domain.com:993 (Connection timed out); File: /app/code/overrides/webklex/php-imap/src/Connection/Protocols/ImapProtocol.php (94) Connection could not be established with host mail.domain.com [Connection timed out #110]; File: /app/code/overrides/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php (271)
I just opened a ticket upstream: https://github.com/freescout-help-desk/freescout/issues/4441
-
@joseph I'm encountering the same send/fetch issues on a fresh Freescout app that I installed under a different subdomain and set it all up manually; no settings/backups were restored or imported.
Edit: running some more tests...
cloudron-support --troubleshoot
Vendor: Hetzner Product: vServer Linux: 6.8.0-51-generic Ubuntu: noble 24.04 Processor: AMD EPYC Processor BIOS NotSpecified CPU @ 2.0GHz x 2 RAM: 7933852KB Disk: /dev/sda1 47G [OK] node version is correct [OK] IPv6 is enabled and public IPv6 address is working [OK] docker is running [OK] docker version is correct [OK] MySQL is running [OK] nginx is running [OK] dashboard cert is valid [OK] dashboard is reachable via loopback [OK] box v8.2.1 is running [OK] netplan is good [OK] DNS is resolving via systemd-resolved [OK] Dashboard is reachable via domain name [OK] Domain domain.com is valid and has not expired [OK] unbound is running
systemctl status box
● box.service - Cloudron Admin Loaded: loaded (/etc/systemd/system/box.service; enabled; preset: enabled) Active: active (running) since Fri 2024-12-20 20:06:23 UTC; 1 day 6h ago Process: 353312 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS) Main PID: 106740 (node) Tasks: 11 (limit: 9212) Memory: 103.2M (max: 400.0M available: 296.7M peak: 113.3M) CPU: 7min 50.967s CGroup: /system.slice/box.service └─106740 node /home/yellowtent/box/box.js
I just noticed that IPV6 is enabled in my dashboard > network. I don't remember if I had that enabled before or not.
- Could it be related to it?
Another note, I'm using Hetzner and have not configured their firewall. It's been working fine. I also shot a ticket earlier to Hetzner support and they confirmed that 587 and 993 are not being blocked on my server. Port 25 and some other one are blocked by default and I have not requested their opening since I use Mailgun SMTP.
- Should I manually enable ports 587 and 993 in Hetzner's firewall regardless?
-
@humptydumpty just double checking, have you seen https://docs.cloudron.io/apps/freescout/#cloudron-mailbox already? Important thing here is TLS vs SSL distinction in freescout. I remember writing about this somewhere in the forum, let me see if I can find it. I think everything looks fine in your setup, just some freescout configuration.
-
@humptydumpty said in Connection could not be established with host mail.domain.com [Connection timed out #110]:
Should I manually enable ports 587 and 993 in Hetzner's firewall regardless?
Oh, this could be it. Are you using the full name in freescout like mail.domain.com ? If so, external ports have to be opened. I guess you got the blocking of those ports from somewhere in the docs? We should probably add some caveats to it.
-
@girish said in Connection could not be established with host mail.domain.com [Connection timed out #110]:
@humptydumpty just double checking, have you seen https://docs.cloudron.io/apps/freescout/#cloudron-mailbox already? Important thing here is TLS vs SSL distinction in freescout.
Yep, I've seen this and FS has been working correctly for years now.
@girish said in Connection could not be established with host mail.domain.com [Connection timed out #110]:
Oh, this could be it. Are you using the full name in freescout like mail.domain.com ?
Yes, I'm using the full domain (mail.domain.com). Again, I didn't change anything and it was all working fine until now. I switched to Hetzner a couple of months ago, but it's been working fine this whole time. It stopped suddenly on its own, coincidentally around the same time when I upgraded to 8.2/8.2.1.
I'll try opening the ports manually in Hetzner's firewall. I'd like to avoid doing that because when I first signed up with Hetzner, I did play with the firewall to open ports and things went south and couldn't undo it. I had to spin up a new one. Hopefully, it plays nice this time.
Btw, Freescout and the mail server are on the same server.
-
@girish Am I opening incoming, outgoing, or both in Hetzner?
-
Sigh. Server died upon activating the firewall.
-
Maybe I should open all of these too (except for "any"). I do use SSH and 53 for the DNS makes sense. IDK about the MYSQL and PGSQL though.
-
For the mail server domain, yes. The mailbox (different domain) is using Bunny. Proxy is off though. CDN acceleration is disabled in Bunny DNS. I didn't change anything at all when this issue started. It's been working fine. I use FS daily. Also, mail is working fine in Roundcube so DNS, ports, wtv are correct. It's FS that's picky, no sending/fetching of mailboxes. Oh, and I have multiple mailboxes using domains on Cloudflare and Bunny. Issue is the same for all. Issue is the same on a fresh FS, so it's not module related either.
Under
manage > mail settings > system emails > send test to
--- This test email is sent and received fine! -
@humptydumpty the system email is configured by cloudron itself. You can ignore this (for this problem).
One thing in your screenshot: I noticed now that FS has changed it's TLS options (very nice). You have to choose STARTTLS for port 587. In yours it is none.
-
The docs still say to use none if CR mail and FS are on the same server (which they are for my case). I updated it to TLS, but issue persists. I even restarted the app with no effect.