Squirrelmail Forbidden You don't have permission to access

Squirrelmail Forbidden - You don’t have permission to access

Squirrelmail after setup when accessed shows 403 Forbidden error, this is due to improper configuration in squirrelmail.conf file. If you are using Apache 2.4 version set Require all granted to fix the issue.

Error

$ curl https://localhost/webmail
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /webmail on this server.</p>
</body></html>

Fix - squirrelmail.conf

$ cat /etc/httpd/conf.d/squirrelmail.conf
#
# SquirrelMail is a webmail package written in PHP.
#

Alias /webmail /usr/share/squirrelmail

<Directory "/usr/share/squirrelmail">
    Options Indexes MultiViews
    Require all granted
    AllowOverride none
    Order allow,deny
    Allow from all
</Directory>

Test after fix

$ curl -I https://localhost/webmail/src/login.php
HTTP/1.1 200 OK
Date: Wed, 04 Apr 2018 20:00:18 GMT
Server: Apache/2.4.29 (Fedora) PHP/7.1.15
Content-Type: text/html; charset=iso-8859-1