Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| services:snappymail [2025/04/15 15:26] – created willy | services:snappymail [2025/04/15 16:22] (current) – willy | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| [[https:// | [[https:// | ||
| + | |||
| + | **Note:** i installed SnappyMail on my // | ||
| ===== Installation ===== | ===== Installation ===== | ||
| Line 7: | Line 9: | ||
| Get your release [[https:// | Get your release [[https:// | ||
| - | will install under / | + | will install under / |
| <code bash> | <code bash> | ||
| - | cd /home/web | + | mkdir -p /home/web/snappymail/frontend |
| - | mkdir snappymail | + | cd /home/web/snappymail/frontend |
| - | cd snappymail | + | |
| wget https:// | wget https:// | ||
| tar xvf snappymail-2.38.2.tar.gz | tar xvf snappymail-2.38.2.tar.gz | ||
| find ./ -type d -exec chmod 755 {} \; | find ./ -type d -exec chmod 755 {} \; | ||
| find ./ -type f -exec chmod 644 {} \; | find ./ -type f -exec chmod 644 {} \; | ||
| - | chown web: | + | chown -R web: |
| </ | </ | ||
| + | |||
| + | ==== Secure the data folder ==== | ||
| + | |||
| + | Move the data folder //outside// the document root can be a good idea. First of all, move it physically: | ||
| + | <code bash> | ||
| + | cd / | ||
| + | mv frontend/ | ||
| + | mv frontend/ | ||
| + | </ | ||
| + | |||
| + | Now edit the file **frontend/ | ||
| + | < | ||
| + | define(' | ||
| + | </ | ||
| + | |||
| + | The trailing "/" | ||
| + | |||
| + | |||
| + | ===== Reverse Proxy ===== | ||
| + | |||
| + | <file - webmail.conf> | ||
| + | server { | ||
| + | server_name webmail.mydomain.com; | ||
| + | listen 443 ssl; | ||
| + | |||
| + | index index.php; | ||
| + | |||
| + | root / | ||
| + | |||
| + | access_log / | ||
| + | error_log / | ||
| + | |||
| + | location ~ /.*\.php$ { | ||
| + | try_files $uri =404; | ||
| + | fastcgi_split_path_info ^(.+\.php)(/ | ||
| + | include fastcgi_params; | ||
| + | fastcgi_param SCRIPT_FILENAME $request_filename; | ||
| + | fastcgi_param | ||
| + | fastcgi_pass 127.0.0.1: | ||
| + | } | ||
| + | |||
| + | # Security headers | ||
| + | add_header Strict-Transport-Security " | ||
| + | add_header X-Content-Type-Options " | ||
| + | add_header X-XSS-Protection "1; mode=block" | ||
| + | add_header X-Robots-Tag " | ||
| + | add_header X-Download-Options " | ||
| + | add_header X-Permitted-Cross-Domain-Policies " | ||
| + | add_header Referrer-Policy " | ||
| + | add_header X-Frame-Options " | ||
| + | fastcgi_hide_header X-Powered-By; | ||
| + | |||
| + | index index.php; | ||
| + | |||
| + | location ~ (^|/)\. { | ||
| + | return 403; | ||
| + | } | ||
| + | |||
| + | location ~ ^/data/ { | ||
| + | deny all; | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | ===== Configuration ===== | ||
| + | |||
| + | After restarting NGINX, go to **https:// | ||
| + | |||
| + | Immediately change the password, and that file will be deleted. | ||
| + | |||
| + | You need to setup the domains you want to use in SnappyMail to allow users to login. | ||
| + | |||
| + | ===== Upgrade ===== | ||
| + | |||
| + | To upgrade the installation, | ||
| + | |||
| + | All the additional reconfiguration will be done by the product on next run. | ||
| + | |||
| + | Then when everything works, you may remove any old version that resides in / | ||