Не приходят письма. Postfix. Dovecot. Ubuntu 20.04 (451 4.3.0 <info@domein.com>: Temporary lookup failure)

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС для молодых и начинающих системных администраторов.

Модератор: SLEDopit

wisma
Сообщения: 2
ОС: windows

Не приходят письма. Postfix. Dovecot. Ubuntu 20.04

Сообщение wisma »

И так, была проблема в том что письма не уходили на gmail, и другие ящики.
Так же они и не приходили на мой vps.
Порыл кучу инфы, добавил все записи к домену. (mx, mail.domen.com, spf.......)

Вот конфиг main.cf

Код: Выделить всё

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix/sbin
data_directory = /var/lib/postfix
mail_owner = postfix
inet_protocols = all
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
	 ddd $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES


myhostname = mail.domain.com
mynetworks = 127.0.0.1/8 
mydomain = domain.com
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
message_size_limit = 30720000
virtual_alias_domains = 
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /home/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_cert_file = /etc/letsencrypt/live/domain.com/fullchain.pem
smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem
virtual_create_maildirsize = yes
virtual_maildir_extended = yes
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 $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
virtual_transport = dovecot
dovecot_destination_recipient_limit = 1
inet_interfaces = all
smtp_tls_security_level = may
disable_vrfy_command = yes
smtpd_milters = inet:127.0.0.1:8891
non_smtpd_milters = $smtpd_milters
milter_default_action = accept

tls_server_sni_maps = hash:/etc/postfix/vmail_ssl.map
myorigin = /etc/mailname
relayhost = 
mailbox_size_limit = 0
recipient_delimiter = +

header_checks = regexp:/etc/postfix/header_checks


systemctl status postfix -l

Код: Выделить всё

● postfix.service - Postfix Mail Transport Agent
     Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
     Active: active (exited) since Wed 2023-09-27 15:55:37 EEST; 1h 1min ago
    Process: 1820 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
   Main PID: 1820 (code=exited, status=0/SUCCESS)

Sep 27 15:55:37 vps-43637 systemd[1]: Starting Postfix Mail Transport Agent...
Sep 27 15:55:37 vps-43637 systemd[1]: Finished Postfix Mail Transport Agent.


root@vps-43637:~# systemctl status dovecot -l

Код: Выделить всё

● dovecot.service - Dovecot IMAP/POP3 email server
     Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-09-27 16:39:53 EEST; 18min ago
       Docs: man:dovecot(1)
             http://wiki2.dovecot.org/
   Main PID: 5982 (dovecot)
      Tasks: 7 (limit: 7006)
     Memory: 7.4M
     CGroup: /system.slice/dovecot.service
             ├─5982 /usr/sbin/dovecot -F
             ├─6005 dovecot/anvil
             ├─6006 dovecot/log
             ├─6007 dovecot/config
             ├─6033 dovecot/stats
             ├─7014 dovecot/auth
             └─7143 dovecot/auth -w

Sep 27 16:47:30 vps-43637 dovecot[6006]: imap-login: Login: user=<info@domain.com>, method=PLAIN, rip=::1, lip=::1, mpid=6502, TLS, session=<xzrHblcGjL8AAAAAAAAAAAAAAAAAAA>
Sep 27 16:47:30 vps-43637 dovecot[6006]: imap(info@domain.com)<6502><xzrHblcGjL8AAAAAAAAAAAAAAAAAAAAB>: Logged out in=676 out=29586 deleted=0 expunged=0 trashed=0 hdr_coun>
Sep 27 16:47:32 vps-43637 dovecot[6006]: imap-login: Login: user=<info@domain.com>, method=PLAIN, rip=::1, lip=::1, mpid=6507, TLS, session=<C+jYblcGlr8AAAAAAAAAAAAAAAAAAA>
Sep 27 16:47:32 vps-43637 dovecot[6006]: imap(info@domain.com)<6507><C+jYblcGlr8AAAAAAAAAAAAAAAAAAAAB>: Logged out in=676 out=29594 deleted=0 expunged=0 trashed=0 hdr_coun>
Sep 27 16:55:05 vps-43637 dovecot[6006]: imap-login: Login: user=<info@domain.com>, method=PLAIN, rip=::1, lip=::1, mpid=7048, TLS, session=<K7DdiVcGzqwAAAAAAAAAAAAAAAAAAA>
Sep 27 16:55:05 vps-43637 dovecot[6006]: imap(info@domain.com)<7048><K7DdiVcGzqwAAAAAAAAAAAAAAAAAAAAB>: Logged out in=105 out=971 deleted=0 expunged=0 trashed=0 hdr_count=>
Sep 27 16:55:05 vps-43637 dovecot[6006]: imap-login: Login: user=<info@domain.com>, method=PLAIN, rip=::1, lip=::1, mpid=7049, TLS, session=<MnTeiVcG2qwAAAAAAAAAAAAAAAAAAA>
Sep 27 16:55:05 vps-43637 dovecot[6006]: imap(info@domain.com)<7049><MnTeiVcG2qwAAAAAAAAAAAAAAAAAAAAB>: Logged out in=92 out=605 deleted=0 expunged=0 trashed=0 hdr_count=0>
Sep 27 16:57:25 vps-43637 dovecot[6006]: pop3-login: Login: user=<info@domain.com>, method=PLAIN, rip=31.133.98.218, lip=185.69.155.213, mpid=7144, TLS, session=<erQ8klcG8>
Sep 27 16:57:25 vps-43637 dovecot[6006]: pop3(info@domain.com)<7144><erQ8klcG8y8fhWLa>: Disconnected: Logged out top=0/0, retr=0/0, del=0/79, size=1286387
В vps на базе нуля, но настроить сайты и юзать подсказки гугла умею.
Спасибо сказали:
Аватара пользователя
Bizdelnick
Модератор
Сообщения: 20722
Статус: nulla salus bello
ОС: Debian GNU/Linux

Re: Не приходят письма. Postfix. Dovecot. Ubuntu 20.04

Сообщение Bizdelnick »

Что в логах? (mail.err, mail.log)
Пишите правильно:
в консоли
вку́пе (с чем-либо)
в общем
вообще
в течение (часа)
новичок
нюанс
по умолчанию
приемлемо
проблема
пробовать
трафик
Спасибо сказали:
wisma
Сообщения: 2
ОС: windows

Re: Не приходят письма. Postfix. Dovecot. Ubuntu 20.04

Сообщение wisma »

Забыл про это написать. В логах последние записи аж за 5 июля, сейчас конец сентября.

mail.err
Spoiler
Jul 5 11:06:00 vps-43637 dovecot: imap-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:06:01 vps-43637 dovecot: imap-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:08:53 vps-43637 dovecot: pop3-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:08:54 vps-43637 dovecot: pop3-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:56:05 vps-43637 dovecot: pop3-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:56:05 vps-43637 dovecot: pop3-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
Jul 5 11:56:08 vps-43637 dovecot: pop3-login: Error: Diffie-Hellman key exchange requested, but no DH parameters provided. Set ssh_dh=</path/to/dh.pem
mail.log
Spoiler
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:288:fopen('/etc/pki/dovecot/certs/dovecot.pem','r'):
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: warning: TLS library problem: error:20074002:BIO routines:file_ctrl:system lib:../crypto/bio/bss_file.c:290:
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: warning: TLS library problem: error:140DC002:SSL routines:use_certificate_chain_file:system lib:../ssl/ssl_rsa.c:615:
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: connect from unknown[87.121.221.179]
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: warning: unknown[87.121.221.179]: SASL LOGIN authentication failed: Invalid authentication mechanism
Jul 5 15:41:23 vps-43637 postfix/smtpd[20112]: disconnect from unknown[87.121.221.179] ehlo=1 auth=0/1 quit=1 commands=2/3
Jul 5 15:44:44 vps-43637 postfix/anvil[20114]: statistics: max connection rate 1/60s for (smtp:87.121.221.179) at Jul 5 15:41:23
Jul 5 15:44:44 vps-43637 postfix/anvil[20114]: statistics: max connection count 1 for (smtp:87.121.221.179) at Jul 5 15:41:23
Jul 5 15:44:44 vps-43637 postfix/anvil[20114]: statistics: max cache size 1 at Jul 5 15:41:23
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: warning: cannot get RSA certificate from file "/etc/pki/dovecot/certs/dovecot.pem": disabling TLS support
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: warning: TLS library problem: error:02001002:system library:fopen:No such file or directory:../crypto/bio/bss_file.c:288:fopen('/etc/pki/dovecot/certs/dovecot.pem','r'):
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: warning: TLS library problem: error:20074002:BIO routines:file_ctrl:system lib:../crypto/bio/bss_file.c:290:
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: warning: TLS library problem: error:140DC002:SSL routines:use_certificate_chain_file:system lib:../ssl/ssl_rsa.c:615:
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: connect from unknown[87.121.221.179]
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: warning: unknown[87.121.221.179]: SASL LOGIN authentication failed: Invalid authentication mechanism
Jul 5 16:08:02 vps-43637 postfix/smtpd[20928]: disconnect from unknown[87.121.221.179] ehlo=1 auth=0/1 quit=1 commands=2/3
Jul 5 16:11:22 vps-43637 postfix/anvil[20930]: statistics: max connection rate 1/60s for (smtp:87.121.221.179) at Jul 5 16:08:02
Jul 5 16:11:22 vps-43637 postfix/anvil[20930]: statistics: max connection count 1 for (smtp:87.121.221.179) at Jul 5 16:08:02
Jul 5 16:11:22 vps-43637 postfix/anvil[20930]: statistics: max cache size 1 at Jul 5 16:08:02
Jul 5 16:23:00 vps-43637 opendkim[775]: OpenDKIM Filter v2.11.0 starting (args: -x /etc/opendkim.conf)
Jul 5 16:23:02 vps-43637 dovecot: master: Dovecot v2.3.7.2 (3c910f64b) starting up for imap, pop3 (core dumps disabled)
Jul 5 16:23:02 vps-43637 postfix[1059]: Postfix is running with backwards-compatible default settings
Jul 5 16:23:02 vps-43637 postfix[1059]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Jul 5 16:23:02 vps-43637 postfix[1059]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Jul 5 16:23:03 vps-43637 postfix/postfix-script[1185]: warning: symlink leaves directory: /etc/postfix/./makedefs.out
Jul 5 16:23:04 vps-43637 postfix/postfix-script[1377]: starting the Postfix mail system
Jul 5 16:23:04 vps-43637 postfix/master[1380]: daemon started -- version 3.4.13, configuration /etc/postfix
Где можно посмотреть куда сейчас пишутся логи? (хостер пытался исправить ошибку, ничего не дало, мог и я по всяким faq случайно изменить запись логов)


P.S.
Письма уходят и доставляются на другие почтовые ящики.
Спасибо сказали: