Linux/Mailserver/Internet Site: Difference between revisions
< Linux | Mailserver
(Die Seite wurde neu angelegt: „== Postgrey == * install: <pre> </pre> <pre> </pre> <pre> </pre><pre> </pre><pre> </pre><pre> </pre>“) |
|||
(19 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== Requirements == | |||
* Ubuntu 16.04 | |||
* server with static ip | |||
* control of dns entries | |||
= Spam filtering = | |||
== Installation == | |||
* install | |||
<blockquote> | |||
<pre> | |||
apt install postgrey postfix-policyd-spf-python spamassassin spamass-milter clamav-milter | |||
</pre> | |||
</blockquote> | |||
* edit /etc/postfix/main.cf | |||
<blockquote> | |||
<pre> | |||
smtpd_client_restrictions = | |||
permit_mynetworks, permit_sasl_authenticated, | |||
reject_unauth_pipelining, | |||
smtpd_helo_required = yes | |||
smtpd_helo_restrictions = | |||
permit_mynetworks, | |||
reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname | |||
smtpd_sender_restrictions = | |||
permit_mynetworks, | |||
reject_non_fqdn_sender, reject_unknown_sender_domain, | |||
smtpd_relay_restrictions = | |||
permit_mynetworks, permit_sasl_authenticated, | |||
reject_unauth_destination, | |||
smtpd_recipient_restrictions = | |||
permit_sasl_authenticated, | |||
reject_non_fqdn_recipient, | |||
reject_unknown_recipient_domain, | |||
reject_invalid_hostname, | |||
reject_non_fqdn_hostname, | |||
reject_non_fqdn_sender, | |||
reject_unknown_sender_domain, | |||
permit_mynetworks, | |||
reject_rbl_client zen.spamhaus.org, | |||
reject_rhsbl_reverse_client dbl.spamhaus.org, | |||
reject_rhsbl_helo dbl.spamhaus.org, | |||
reject_rhsbl_sender dbl.spamhaus.org, | |||
check_policy_service unix:private/policy-spf | |||
# check SPF of remote mail server | |||
check_policy_service inet:127.0.0.1:10023, | |||
# check with postgrey | |||
permit | |||
policy-spf_time_limit = 3600s | |||
</pre> | |||
</blockquote> | |||
== Postgrey == | == Postgrey == | ||
* | |||
* edit /etc/default/postgrey | |||
<blockquote> | |||
<pre> | |||
POSTGREY_OPTS="--inet=10023 --delay=60" | |||
</pre> | |||
</blockquote> | |||
* restart | |||
<blockquote> | |||
<pre> | |||
systemctl restart postgrey | |||
</pre> | |||
</blockquote> | |||
== Postfix-policyd-spf-python == | |||
* add to end of /etc/postfix/master.cf | |||
<blockquote> | |||
<pre> | |||
policy-spf unix - n n - - spawn | |||
user=nobody argv=/usr/bin/policyd-spf | |||
</pre> | |||
</blockquote> | |||
== spamassassin == | |||
* add to /etc/postfix/main.cf | |||
<blockquote> | |||
<pre> | |||
smtpd_milters = unix:/spamass/spamass.sock | |||
# spamassassin | |||
</pre> | |||
</blockquote> | |||
== clam-av == | |||
* add to /etc/postfix/main.cf | |||
<blockquote> | |||
<pre> | |||
smtpd_milters = unix:/clamav/clamav-milter.ctl | |||
# clam-av virus scan | |||
milter_connect_macros="i j {daemon_name} v {if_name} _" | |||
</pre> | |||
</blockquote> | |||
* change /etc/clamav/clamav-milter.conf | |||
<blockquote> | |||
<pre> | |||
MilterSocket /var/spool/postfix/clamav/clamav-milter.ctl | |||
MilterSocketGroup postfix | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | <pre> | ||
</pre> | </pre> | ||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | |||
</pre> | |||
</blockquote> | |||
<blockquote> | |||
<pre> | <pre> | ||
</pre> | </pre> | ||
</blockquote> | |||
<blockquote> | |||
<pre> | <pre> | ||
</pre>< | </pre> | ||
</blockquote> | |||
</pre>< | <blockquote> | ||
<pre> | |||
</pre> | |||
</blockquote> | |||
< | <blockquote> | ||
<pre> | |||
</pre> | </pre> | ||
</blockquote> |
Latest revision as of 22:00, 5 September 2016
Requirements
- Ubuntu 16.04
- server with static ip
- control of dns entries
Spam filtering
Installation
- install
apt install postgrey postfix-policyd-spf-python spamassassin spamass-milter clamav-milter
- edit /etc/postfix/main.cf
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_pipelining, smtpd_helo_required = yes smtpd_helo_restrictions = permit_mynetworks, reject_invalid_helo_hostname, reject_non_fqdn_helo_hostname, reject_unknown_helo_hostname smtpd_sender_restrictions = permit_mynetworks, reject_non_fqdn_sender, reject_unknown_sender_domain, smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, smtpd_recipient_restrictions = permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_invalid_hostname, reject_non_fqdn_hostname, reject_non_fqdn_sender, reject_unknown_sender_domain, permit_mynetworks, reject_rbl_client zen.spamhaus.org, reject_rhsbl_reverse_client dbl.spamhaus.org, reject_rhsbl_helo dbl.spamhaus.org, reject_rhsbl_sender dbl.spamhaus.org, check_policy_service unix:private/policy-spf # check SPF of remote mail server check_policy_service inet:127.0.0.1:10023, # check with postgrey permit policy-spf_time_limit = 3600s
Postgrey
- edit /etc/default/postgrey
POSTGREY_OPTS="--inet=10023 --delay=60"
- restart
systemctl restart postgrey
Postfix-policyd-spf-python
- add to end of /etc/postfix/master.cf
policy-spf unix - n n - - spawn user=nobody argv=/usr/bin/policyd-spf
spamassassin
- add to /etc/postfix/main.cf
smtpd_milters = unix:/spamass/spamass.sock # spamassassin
clam-av
- add to /etc/postfix/main.cf
smtpd_milters = unix:/clamav/clamav-milter.ctl # clam-av virus scan milter_connect_macros="i j {daemon_name} v {if_name} _"
- change /etc/clamav/clamav-milter.conf
MilterSocket /var/spool/postfix/clamav/clamav-milter.ctl MilterSocketGroup postfix