Postfix: Unterschied zwischen den Versionen

Aus XccesS Wiki
Zur Navigation springen Zur Suche springen
Die Seite wurde neu angelegt: „=== Beschreibung === === Download === === Installation === === Konfiguration === ==== Via SMTP Relay Host ==== <syntaxhighlight lang="bash" line="1"> apt install mailutils postfix nano /etc/postfix/main.cf Inhalt: smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination myhostname = <FQDN> alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = $myhostname, localh…“
 
Zeile 9: Zeile 9:
<syntaxhighlight lang="bash" line="1">
<syntaxhighlight lang="bash" line="1">
apt install mailutils postfix
apt install mailutils postfix
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
nano /etc/postfix/main.cf
nano /etc/postfix/main.cf
</syntaxhighlight>
Inhalt:
Inhalt:
<syntaxhighlight lang="bash" line="1">
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <FQDN>
myhostname = <FQDN>
Zeile 31: Zeile 35:
sender_canonical_maps =  regexp:/etc/postfix/sender_canonical_maps
sender_canonical_maps =  regexp:/etc/postfix/sender_canonical_maps
smtp_header_checks = regexp:/etc/postfix/header_check
smtp_header_checks = regexp:/etc/postfix/header_check
 
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
nano /etc/postfix/sasl_passwd
nano /etc/postfix/sasl_passwd
</syntaxhighlight>
Inhalt:
Inhalt:
<syntaxhighlight lang="bash" line="1">
[smtp.mailserver.de]:587 benutzername@server:passwort
[smtp.mailserver.de]:587 benutzername@server:passwort
 
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
postmap /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
chmod 600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
 
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
nano /etc/postfix/sender_canonical_maps
nano /etc/postfix/sender_canonical_maps
</syntaxhighlight>
Inhalt:
Inhalt:
<syntaxhighlight lang="bash" line="1">
/.+/    newsender@address.com
/.+/    newsender@address.com
 
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
nano /etc/postfix/header_check
nano /etc/postfix/header_check
</syntaxhighlight>
Inhalt:
Inhalt:
<syntaxhighlight lang="bash" line="1">
/From:.*/ REPLACE From: newsender@address.com
/From:.*/ REPLACE From: newsender@address.com
 
</syntaxhighlight>
<syntaxhighlight lang="bash" line="1">
systemctl restart postfix
systemctl restart postfix
</syntaxhighlight>
</syntaxhighlight>

Version vom 18. Dezember 2024, 14:10 Uhr

Beschreibung

Download

Installation

Konfiguration

Via SMTP Relay Host

apt install mailutils postfix
nano /etc/postfix/main.cf

Inhalt:

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <FQDN>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, localhost.localdomain, localhost
relayhost = <smtphost>:587
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt

sender_canonical_classes = envelope_sender, header_sender
sender_canonical_maps =  regexp:/etc/postfix/sender_canonical_maps
smtp_header_checks = regexp:/etc/postfix/header_check
nano /etc/postfix/sasl_passwd

Inhalt:

[smtp.mailserver.de]:587 benutzername@server:passwort
postmap /etc/postfix/sasl_passwd
chmod 600 /etc/postfix/sasl_passwd /etc/postfix/sasl_passwd.db
nano /etc/postfix/sender_canonical_maps

Inhalt:

/.+/    newsender@address.com
nano /etc/postfix/header_check

Inhalt:

/From:.*/ REPLACE From: newsender@address.com
systemctl restart postfix

Update

Test

echo "Testnachricht" | mail -s "Testmail" <emailadresse>

Fehlerbehebung

Starten/Stoppen funktioniert nicht

Lösung 1
auszufüllen

Codeschnipsel

Nützliche Links

Codeschnipsel

Nützliche Links