Unable to access /mail

Hi everyone,

I recently configured MiaB with external DNS to send and receive emails with a domain that has websites on a different server. I am able to access the box through the IP as well as box.site.com, as well as the admin panel at box.site.com/admin, but box.site.com/mail results in a 502 Bad Gateway error. This was the case when I used the MiaB to serve as the DNS provider as well. How can I gain access to my mail on the web? I am able to configure it for Outlook, though it would be easier to be able to get to it through the internet.

Thanks in advanced!

Any chance you could post some error logs from when this occurs?

Where would I be able to access the error logs? I tried looking for the /mail folder, however was unable to locate it in my server. I found the nginx-alldomains.conf file in my ~/mailinabox/conf directory and see that it has a line that says

location ~ /mail/ { index index.php; alias /usr/local/lib/roundcubemail }

and see a file called index.php but the page does not load.

var/log/nginx/error.log

Hi alento,

I apologize for the late response. Here is the error log:

2020/02/03 07:57:21 [error] 14424#14424: connect() to [2600:1400:d::17db:5c1a]:80 failed (101: Network is unreachable) while requesting certificate status, responder: ocsp.int-x3.letsencrypt. org, peer: [2600:1400:d::17db:5c1a]:80, certificate: “/home/user-data/ssl/ssl_certificate.pem”
2020/02/03 07:57:22 [error] 14424#14424: *3480 open() “/home/user-data/www/default/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php” failed (2: No such file or directory), client: 5.101.0.209, server: box.hashmi.site, request: “GET /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1”, host: “box.hashmi.site”, referrer: “http://174.138.33.119:80/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php
2020/02/03 08:22:39 [error] 14424#14424: *3496 open() “/home/user-data/www/default/index.php” failed (2: No such file or directory), client: 193.57.40.38, server: box.hashmi.site, request: “GET /index.php?s=/Index/\think\app/invokefunction&function=call_user_func_array&vars[0]=md5&vars[1][]=HelloThinkPHP HTTP/1.1”, host: “174.138.33.119:443”
2020/02/03 10:24:35 [error] 14424#14424: connect() to [2600:1400:d::17db:5c1a]:80 failed (101: Network is unreachable) while requesting certificate status, responder: ocsp.int-x3.letsencrypt. org, peer: [2600:1400:d::17db:5c1a]:80, certificate: “/home/user-data/ssl/ssl_certificate.pem”
2020/02/03 11:18:35 [error] 14424#14424: connect() to [2600:1400:d::17db:5c1a]:80 failed (101: Network is unreachable) while requesting certificate status, responder: ocsp.int-x3.letsencrypt. org, peer: [2600:1400:d::17db:5c1a]:80, certificate: “/home/user-data/ssl/ssl_certificate.pem”
2020/02/03 11:49:53 [error] 14424#14424: connect() to [2600:1400:d::17db:5c29]:80 failed (101: Network is unreachable) while requesting certificate status, responder: ocsp.int-x3.letsencrypt. org, peer: [2600:1400:d::17db:5c29]:80, certificate: “/home/user-data/ssl/ssl_certificate.pem”
2020/02/03 11:49:54 [error] 14424#14424: *3602 open() “/home/user-data/www/default/vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php” failed (2: No such file or directory), client: 193.57.40.38, server: box.hashmi.site, request: “POST /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php HTTP/1.1”, host: "174.138.33.119:443

I added an extra space around some of the periods to get around the link restrictions

Hi, so what is needed is the error log from the time that an attempt is made to access /mail. I don’t see that happening in the log.

Can you run sudo tail -f /var/log/nginx/error.log in your terminal and then try to connect? Once you have done that copy the relevant part of the log. I also tried just now in case you want to look for my attempt as well. (20:22 CET)

This is the latest entry after I tried accessing /mail again:

2020/02/03 15:00:51 [crit] 28013#28013: *13 connect() to unix:/var/run/php/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 000.000.000.00, server: box.example.com, request: "GET /mail/ HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "box.example.com"

Sidenote: I changed the client IP address

What is running on the VPS other than MiaB?

Originally, I had websites running on there too, but I separated them into another server. I modified the php conf file to point to /var/run/php as opposed to 127.0.0.1:9000. Doing that fixed my issue. Thanks a lot! I wouldn’t have realized that if you hadn’t pointed me towards the error logs, I still relatively new to this so I’ll be more careful of that in the future.

So, this is one of the reasons that so many stress to install Mail-in-a-Box on a fresh Ubuntu 18.04 LTS server edition VPS.

In your case the fix was simple. Oftentimes they are not.

I’m still going to make the recommendation that you migrate to a VPS that meets these conditions … elsewise you are running MiaB with an Unsupported Modification.

Of course, it is your decision if you do or not … but that is the official recommendation.

But, I am glad that YOU knew how to fix the issue because it was definitely above my pay grade! :stuck_out_tongue:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.