In this section, Postfix and Spamassassin settings and customizations will be made to prevent outbound spam mails from going out, along with Policyd password protection.
Adding Password Protection to the Interface with Htaccess
- Since the application we installed has no password protection, anyone can add or remove rules from http://IP/webui/. Let’s add Apache-level password protection.
nano /etc/apache2/sites-available/000-default.conf<VirtualHost :80>
DocumentRoot /var/www/html
<Directory /var/www/html>
AuthType Basic
AuthName “Please login”
AuthUserFile /var/www/.htpasswd
Require valid-user
</Directory>
</VirtualHost>- Generate a password hash from http://www.htaccesstools.com/htpasswd-generator/ and paste it into:
nano /var/www/.htpasswd service apache2 restart
Deleting Spam Mails with Spamassassin
nano /etc/postfix/main.cfheader_checks = regexp:/etc/postfix/header_checksnano /etc/postfix/header_checks^X-Spam-Flag:.YES DISCARD spamRemoving Relay Server Headers
nano /etc/postfix/header_checks/^Received:/ IGNORERemoving Spamassassin Traces
nano /etc/postfix/header_checks^X-Spam-Checker-Version:* IGNOREWriting Policyd Rules
- Policyd stores rules in databases like MySQL and allows you to write and apply rules from there.
- https://wiki.zimbra.com/wiki/Postfix_Policyd
References
Leave a Comment
* Your comment will be published after approval.
Comments
0No comments yet. Be the first to comment!