Migrating my Postfix configuration from Ubuntu 16.04 to Ubuntu 24.04

I am not sure if I selected a right configuration, probably “No configuration” is better:

which sendmail
/usr/sbin/sendmail

Copied /etc/postfix/main.cf:

relayhost = [smtp.yandex.com]:587
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/private/sasl_passwd
smtp_sasl_security_options =
smtp_tls_CAfile = /etc/postfix/private/yandex.crt
compatibility_level=2

and /etc/postfix/private from the old machine.

php.ini:

sendmail_path = "/usr/sbin/sendmail -t -f d-ef@yandex.ru -i"

It did not work with the following body.txt, because from address should be d-ef@yandex.ru:

Subject: test mail to My Address!
From: Me <winappdev@gmail.com>
To: Vasya <d-ef@yandex.ru>
Firt line of my message 1
/usr/sbin/sendmail -t -f d-ef@yandex.ru -v -i < body.txt
sudo tail -20 /var/log/mail.log
2025-01-23T20:47:20.697966+03:00 localhost postfix/qmgr[6730]: D625DAFDC: removed
2025-01-23T20:47:21.440144+03:00 localhost postfix/smtp[6913]: A96CBAFDB: host smtp.yandex.com[77.88.21.158] said: 454 4.3.0 Try again later. 1737654441-KlcZ3EGMbKo0-sAn8Deza (in reply to MAIL FROM commnd)
2025-01-23T20:47:21.721258+03:00 localhost postfix/smtp[6865]: A8B02AFDE: host smtp.yandex.com[2a02:6b8::19d] said: 454 4.3.0 Try again later. 1737654441-KlcoaEGOrmI0-6xuP30nJ (in reply to MAIL FROM comand)
2025-01-23T20:47:22.410443+03:00 localhost postfix/smtp[6865]: A8B02AFDE: to=<winappdev@gmail.com>, relay=smtp.yandex.com[77.88.21.158]:587, delay=1.7, delays=0/0/1.7/0.05, dsn=4.3.0, status=deferred (hst smtp.yandex.com[77.88.21.158] said: 454 4.3.0 Try again later. 1737654442-LlcjI7Ep8Cg0-NUWeCHIN (in reply to MAIL FROM command))
2025-01-23T20:47:22.675451+03:00 localhost postfix/smtp[6913]: A96CBAFDB: to=<winappdev@gmail.com>, relay=smtp.yandex.com[2a02:6b8::19d]:587, delay=2, delays=0/0.01/1.9/0.05, dsn=4.3.0, status=deferred host smtp.yandex.com[2a02:6b8::19d] said: 454 4.3.0 Try again later. 1737654442-Llcih7NOlGk0-Dm2beqmd (in reply to MAIL FROM command))
2025-01-23T20:52:39.526451+03:00 localhost postfix/pickup[6729]: 805F9AFE2: uid=1000 from=<d-ef@yandex.ru>
2025-01-23T20:52:39.549441+03:00 localhost postfix/cleanup[7012]: 805F9AFE2: message-id=<20250123175239.805F9AFE2@localhost.localdomain>
2025-01-23T20:52:39.552602+03:00 localhost postfix/qmgr[6730]: 805F9AFE2: from=<d-ef@yandex.ru>, size=349, nrcpt=1 (queue active)
2025-01-23T20:52:40.761978+03:00 localhost postfix/smtp[7014]: 805F9AFE2: to=<d-ef@yandex.ru>, relay=smtp.yandex.com[2a02:6b8::19d]:587, delay=1.2, delays=0.05/0.03/0.95/0.21, dsn=5.7.0, status=bounced host smtp.yandex.com[2a02:6b8::19d] said: 550 5.7.0 Sender address rejected: not owned by authorized user 1737654760-dqcQ8sYOqa60-VGs9ysk1 (in reply to end of DATA command))
2025-01-23T20:52:40.763135+03:00 localhost postfix/cleanup[7012]: BA253AFE4: message-id=<20250123175240.BA253AFE4@localhost.localdomain>
2025-01-23T20:52:40.764231+03:00 localhost postfix/qmgr[6730]: BA253AFE4: from=<>, size=2497, nrcpt=1 (queue active)
2025-01-23T20:52:40.765151+03:00 localhost postfix/bounce[7015]: 805F9AFE2: sender non-delivery notification: BA253AFE4
2025-01-23T20:52:40.766008+03:00 localhost postfix/cleanup[7012]: BAE6FAFE1: message-id=<20250123175240.BAE6FAFE1@localhost.localdomain>
2025-01-23T20:52:40.770141+03:00 localhost postfix/bounce[7016]: 805F9AFE2: sender delivery status notification: BAE6FAFE1
2025-01-23T20:52:40.770425+03:00 localhost postfix/qmgr[6730]: BAE6FAFE1: from=<>, size=2272, nrcpt=1 (queue active)
2025-01-23T20:52:40.770463+03:00 localhost postfix/qmgr[6730]: 805F9AFE2: removed
2025-01-23T20:52:41.482073+03:00 localhost postfix/smtp[7014]: BA253AFE4: host smtp.yandex.com[77.88.21.158] said: 454 4.3.0 Try again later. 1737654761-eqc0rBGOniE0-7HRbHgHs (in reply to MAIL FROM commnd)
2025-01-23T20:52:42.005985+03:00 localhost postfix/smtp[7017]: BAE6FAFE1: host smtp.yandex.com[2a02:6b8::19d] said: 454 4.3.0 Try again later. 1737654761-eqctqhFOj4Y0-fRL93MLa (in reply to MAIL FROM comand)
2025-01-23T20:52:42.200894+03:00 localhost postfix/smtp[7014]: BA253AFE4: to=<d-ef@yandex.ru>, relay=smtp.yandex.com[2a02:6b8::19d]:587, delay=1.4, delays=0/0/1.4/0.05, dsn=4.3.0, status=deferred (host mtp.yandex.com[2a02:6b8::19d] said: 454 4.3.0 Try again later. 1737654762-fqc8KBjOrqM0-R44mklL8 (in reply to MAIL FROM command))
2025-01-23T20:52:42.944044+03:00 localhost postfix/smtp[7017]: BAE6FAFE1: to=<d-ef@yandex.ru>, relay=smtp.yandex.com[77.88.21.158]:587, delay=2.2, delays=0/0.02/2.1/0.05, dsn=4.3.0, status=deferred (hos smtp.yandex.com[77.88.21.158] said: 454 4.3.0 Try again later. 1737654762-gqcKKBjOpiE0-jU91aOfc (in reply to MAIL FROM command))

but worked with this:

Subject: test mail to My Address!
From: Me <d-ef@yandex.ru>
To: Vasya <d-ef@yandex.ru>
Firt line of my message 1

Leave a Reply

Your email address will not be published. Required fields are marked *