Am "Ubuntu 20.04.3 LTS" pe un raspberry pi 4,
și încerc să configurez postfix pentru a folosi relayhosts dependente de expeditor.
Postfix este mail_version = 3.4.13 și am
un IP dinamic.
Schema arată astfel:
- utilizatorul local trimite e-mail la postfix (server de e-mail local)
- postfix rescrie Adresa FROM
- în funcție de rescrierea FROM Address, alegeți relayhost potrivit
- trimite e-mailul către relayhost prin portul 587
pentru punctul 1) și 2) am un fișier expeditor_canonic creată:
Local_User_A@local.homenet UserA@gmx.de
Local_User_B@local.homenet UserB@gmail.com
Pentru punctul 3) am un dosar hărți de releu creată:
@gmx.de mail.gmx.net:587
@gmail.com smtp.gmail.com:587
Pentru punctul 4) am un dosar pass_smarthost creată:
UserA@gmx.de UserA@gmx.de:UserA-GMX-Password
UserB@gmail.com UserB@gmail.com:UserB-Gmail-Parolă
L-am testat cu asta:
ecou „test” | sendmail -f ttm XXXXXXX@posteo.de
Dar momentan primesc:
coada -f /var/log/syslog | grep
7 septembrie 18:28:29 ubuntu-RPI4 postfix/pickup[24810]: 5CFF24028B: uid=0 from=<ttm>
7 septembrie 18:28:29 ubuntu-RPI4 postfix/cleanup[24830]: 5CFF24028B: message-id=<20210907182829.5CFF24028B@ttmsacer.homenet>
Sep 7 18:28:29 ubuntu-RPI4 postfix/qmgr[24811]: 5CFF24028B: from=<ttm@ttmsacer.homenet>, size=256, nrcpt=1 (coada activă)
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: connect to mx04.posteo.de[185.67.36.64]:25: Conexiune refuzată
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: connect to mx01.posteo.de[185.67.36.61]:25: Conexiune refuzată
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: connect to mx01.posteo.de[185.67.36.62]:25: Conexiune refuzată
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: connect to mx03.posteo.de[185.67.36.63]:25: Conexiune refuzată
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: connect to mx03.posteo.de[185.67.36.70]:25: Conexiune refuzată
Sep 7 18:28:29 ubuntu-RPI4 postfix/smtp[24833]: 5CFF24028B: to=<XXXXXXX@posteo.de>, reley=none, delay=0.51, delays=0.07/0.08/0.36/0.4s, ds .1, status=amânat (conectare la mx03.posteo.de[185.67.36.70]:25: Conexiune refuzată)
Pentru mine se pare că acel postfix încearcă să livreze e-mailul direct către serverul destinatar pe portul 25 - în loc să folosească relayhost (aici gmx.de).
Și rescrierea nu a ajuns la adresa corectă - poate un cerc?
Am încercat să adaug opțiunea „-v” în master.cf pentru a vedea mai multe detalii sau pentru a obține un indiciu despre ce se întâmplă.
Dar nu am primit eroarea. Ce îmi lipsește?
Orice indiciu ar fi de ajutor.
Multumesc anticipat.
main.cf:
myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = nu
append_dot_mydomain = nr
readme_directory = nr
compatibility_level = 2
smtpd_tls_cert_file=/etc/postfix/sslcert/mailserver20210902.crt
smtpd_tls_key_file=/etc/postfix/sslcert/mailserver20210902.key
broken_sasl_auth_clients = da
smtpd_tls_security_level=mai
smtpd_sasl_type = porumbel
smtpd_sasl_path = private/auth
smtpd_tls_auth_only = da
smtpd_sasl_auth_enable = da
smtpd_sasl_authenticated_header = da
smtpd_sasl_local_domain = $mydomain
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql_sender_login_maps.cf
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination reject_unknown_reverse_client_hostname
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = ttmsacer.homenet
mydomain = $myhostname
mydestination = localhost.homenet, localhost
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
relayhost =
rețelele mele = 127.0.0.0/8, [::ffff:127.0.0.0]/104, [::1]/128, 192.168.178.0/24
cutie_poștală_size_limit = 0
destinatar_delimiter = +
mesaj_size_limit = 52768000
virtual_mailbox_limit = 0
inet_interfaces = 127.0.0.1, localhost, 192.168.178.20
inet_protocols = all
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $sender_canonical_maps_psendermaps $recipient_maps_mapsonicals
transport_local = virtual
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql_virtual_domains_maps.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql_virtual_alias_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 104
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
virtual_transport = lmtps:inet:localhost:24
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level=mai
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_sender_dependent_authentication = da
smtp_sasl_auth_enable = da
smtp_sasl_security_options = noanonymous
smtp_connection_cache_on_demand = nr
smtp_sasl_password_maps = hash:/etc/postfix/pass_smarthost
sender_dependent_relayhost_maps = hash:/etc/postfix/relaymap
sender_canonical_classes = expeditor_plic, expeditor_antet
sender_canonical_maps = hash:/etc/postfix/sender_canonical
receive_override_options = no_address_mappings
maestru.cf
smtp inet n - y - - smtpd -v
depunerea inet n - n - - smtpd -v
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=criptare
-o smtpd_sasl_auth_enable=da
-o smtpd_tls_auth_only=da
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
smtps inet n - y - - smtpd -v
-o syslog_name=postfix/smtps
-o smtpd_sasl_auth_enable=da
-o smtpd_relay_restrictions=permit_sasl_authenticated,reject
pickup unix n - y 60 1 pickup -v
curatare unix n - y - 0 curatare -v
qmgr unix n - n 300 1 qmgr
tlsmgr unix - - y 1000? 1 tlsmgr
rescrie unix - - y - - trivial-rescriere -v
bounce unix - - y - 0 bounce
defer unix - - y - 0 bounce
trace unix - - y - 0 săritură
verifica unix - - y - 1 verifica
spălați Unix n - y 1000? 0 culoare
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - y - - smtp
releu unix - - y - - smtp
-o syslog_name=postfix/$service_name
showq unix n - y - - showq
eroare unix - - y - - eroare
reîncercați Unix - - y - - eroare
arunca unix - - y - - arunca
unix local - n n - - local
unix virtual - n n - - virtual
lmtp unix - - y - - lmtp
nicovală unix - - y - 1 nicovală
scache unix - - y - 1 scache
postlog unix-dgram n - n - 1 postlogd
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
uucp unix - n n - - conductă
flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($destinatar)
ifmail unix - n n - - pipe
flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($destinatar)
bsmtp unix - n n - - conductă
steaguri=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $destinatar
scalemail-backend unix - n n - 2 conducte
flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman unix - n n - - pipe
flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
${nexthop} ${user}
lmtps unix - - - - - lmtp
-o lmtp_use_tls=da
-o lmtp_enforce_tls=da
-o lmtp_tls_mandatory_protocols=!SSLv2,!SSLv3
-o lmtp_tls_protocols=!SSLv2,!SSLv3
-o lmtp_tls_mandatory_ciphers=high
-o lmtp_tls_ciphers=high
-o lmtp_send_xforward_command=da
-o lmtp_tls_security_level=criptare
-o lmtp_tls_note_starttls_offer=da
-o lmtp_address_preference=ipv4