Postfix: Unterschied zwischen den Versionen

Aus Info-Theke
Zur Navigation springen Zur Suche springen
Zeile 1: Zeile 1:
[[Kategorie:ServerApplikation]]
[[Kategorie:ServerApplikation]]


= Intern nach Extern =
= Vorarbeiten =
<pre>#/etc/aliases
* Domain einrichten, z.B. "dromedar.hamatoma.de"
postmaster:    root
* DNS-PTR-Record der IP-Adresse auf dromedar.hamatoma.de setzen
devnull: /dev/null
* Hostname auf "dromedar.hamatoma.de" setzen
mailer-daemon: postmaster
 
webmaster: root
 
= Installation =
<pre>apt install postfix
# "Internet-Site" wählen


# Weiterleitung an externe Adresse:
root: hamatoma@gmx.de
</pre>
<pre># Activate
newaliases
</pre>
</pre>


= Internet site =
= Konfiguration =
<pre># /etc/postfix/main.cf
<pre>...
...
# anti-spam: smtp restrictions
smtpd_recipient_restrictions = reject_invalid_hostname,
smtpd_recipient_restrictions = reject_invalid_hostname,
         reject_unknown_recipient_domain,
         reject_unknown_recipient_domain,
Zeile 24: Zeile 20:
         reject_rbl_client sbl.spamhaus.org,
         reject_rbl_client sbl.spamhaus.org,
         permit
         permit
smtpd_helo_restrictions = reject_invalid_helo_hostname,
smtpd_helo_restrictions = reject_invalid_helo_hostname,
         reject_non_fqdn_helo_hostname,
         reject_non_fqdn_helo_hostname,
         reject_unknown_helo_hostname
         reject_unknown_helo_hostname
smtpd_client_restrictions = reject_rbl_client dnsbl.sorbs.net
smtpd_client_restrictions = reject_rbl_client dnsbl.sorbs.net
# Weiterleitung
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = hamatoma.de
virtual_alias_domains = f-r-e-i.de
</pre>
<pre># /etc/postfix/virtual
 
<pre>/etc/postfix/virtual
hm hm.neutral@gmx.de
 
@hamatoma.de hamatoma@gmx.de
 
# Blacklist:
zimmer@hm.f-r-e-i.de devnull
</pre>
<pre># Activate
postmap /etc/postfix/virtual
</pre>


= Smarthost mit GMail =
# Format maildir (statt mailbox):
* main.cf:
home_mailbox = Maildir/
<pre>smtp_sasl_auth_enable = yes
virtual_uid_maps = static:150
smtp_sasl_security_options = noanonymous
virtual_gid_maps = static:150
smtp_connection_cache_on_demand = no
virtual_mailbox_maps    = hash:/etc/postfix/vmaps
smtp_sasl_password_maps = hash:/etc/postfix/sasl_password
sender_canonical_maps = hash:/etc/postfix/sender_canonical
smtp_use_tls=yes
smtp_tls_security_level = may
smtp_sasl_security_options=noanonymous


relayhost = [smtp.gmail.com]:587
</pre>
* /etc/postfix/sender_canonical
<pre>root anyUser@gmail.com
jonny blubBlub@gmail.com
</pre>
* /etc/postfix/virtual
<pre>root root.myhost@gmx.de
jonny blubBlub@gmail.com
</pre>
* /etc/postfix/sasl_password
<pre>[smtp.gmail.com]:587 my.server@gmail.com:Geheim
</pre>
<pre>postmap sender_canonical
postmap sasl_password
postmap virtual
</pre>
</pre>

Version vom 8. Oktober 2019, 18:48 Uhr


Vorarbeiten

  • Domain einrichten, z.B. "dromedar.hamatoma.de"
  • DNS-PTR-Record der IP-Adresse auf dromedar.hamatoma.de setzen
  • Hostname auf "dromedar.hamatoma.de" setzen


Installation

apt install postfix
# "Internet-Site" wählen

Konfiguration

...
smtpd_recipient_restrictions = reject_invalid_hostname,
        reject_unknown_recipient_domain,
        reject_unauth_destination,
        reject_rbl_client sbl.spamhaus.org,
        permit

smtpd_helo_restrictions = reject_invalid_helo_hostname,
        reject_non_fqdn_helo_hostname,
        reject_unknown_helo_hostname

smtpd_client_restrictions = reject_rbl_client dnsbl.sorbs.net
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_alias_domains = f-r-e-i.de

# Format maildir (statt mailbox):
home_mailbox = Maildir/
virtual_uid_maps = static:150
virtual_gid_maps = static:150
virtual_mailbox_maps    = hash:/etc/postfix/vmaps