Site icon 咖啡偶-IT日常

postfix外掛廣告信過濾系統-Rspamd

Rspamd 讓我非常驚豔, 設定容易, 可以用來取代老牌amavisd-new套件

centos 7 系統簡易安裝如下:

curl https://rspamd.com/rpm-stable/centos-7/rspamd.repo > /etc/yum.repos.d/rspamd.repo # For Centos-7
rpm --import https://rspamd.com/rpm-stable/gpg.key
yum -y update
yum -y install ca-certificates unbound redis rspamd  clamav clamav-devel clamav-scanner-systemd clamav-update clamav-data clamav-server clamav-server-systemd clamav-scanner
port 7379
bind 127.0.0.1 ::1
systemctl enable redis
systemctl start redis

##########################################
LocalSocket /run/clamd.scan/clamd.sock
LocalSocketMode 666
FixStaleSocket yes
##########################################
systemctl enable clamav-freshclam
systemctl enable clamd\@scan
https://kafeiou.pw/wp-content/uploads/2022/02/rspamd.zip
usermod -aG clamscan _rspamd
usermod -aG virusgroup _rspamd
systemctl enable rspamd
chown -R _rspamd:_rspamd /etc/rspamd/override.d
systemctl start rspamd
smtpd_milters = inet:127.0.0.1:11332
non_smtpd_milters = $smtpd_milters
milter_default_action = accept
postfix reload
<VirtualHost *:443>
  ServerName mail.test.com

  ErrorLog /var/log/httpd/ssl_error_log
  TransferLog /var/log/httpd/ssl_access_log

  SSLEngine On
  SSLCertificateFile /etc/letsencrypt/live/mail.test.com/cert.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/mail.test.com/privkey.pem
  SSLCACertificateFile /etc/letsencrypt//live/mail.test.com/fullchain.pem

  SSLProxyEngine On
  ProxyRequests Off
  ProxyPreserveHost On
  RequestHeader set X-Forwarded-Proto "https"
  ProxyPass /rspamd/ http://localhost:11334/
  ProxyPassReverse /rspamd/ http://localhost:11334/
  <Location />
    Order allow,deny
    Allow from all
  </Location>
  <Location /rspamd>
    Require all granted
  </Location>
  RewriteEngine On
  RewriteRule ^/rspamd$ /rspamd/ [R,L]
  RewriteRule ^/rspamd/(.*) http://127.0.0.1:11334/$1 [P]
</VirtualHost>
rspamadm pw

Exit mobile version