Answer the question
In order to leave comments, you need to log in
How to make Postfix send mail outside with DKIM?
Can't set up email forwarding. It all started with the fact that external smtp services did not want to connect to any for my application ( this question ). Well I also decided to configure postfix. Set up postfix. But he didn't send letters out in the same way. On some forum, I read that many mail receiving services do not accept letters with poor security and I decided to install DKIM. But still, nothing worked. Sorry, I don't know how to set up a mail server at all.
postfix config:
# Дефолтные настройки
...
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.com
mydomain = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mydomain.com, localhost.mydomain.com, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
inet_protocols = all
home_mailbox = Maildir/
virtual_alias_maps = hash:/etc/postfix/virtual
# mydomain.com - везде мой оригинальный домен
# Command-line options specified here will override the contents of
# /etc/opendkim.conf. See opendkim(8) for a complete list of options.
#DAEMON_OPTS=""
# Change to /var/spool/postfix/var/run/opendkim to use a Unix socket with
# postfix in a chroot:
#RUNDIR=/var/spool/postfix/var/run/opendkim
RUNDIR=/var/run/opendkim
#
# Uncomment to specify an alternate socket
# Note that setting this will override any Socket value in opendkim.conf
# default:
SOCKET="local:/var/spool/postfix/var/run/opendkim/opendkim.sock"
# listen on all interfaces on port 54321:
#SOCKET=inet:54321
# listen on loopback on port 12345:
#SOCKET=inet:[email protected]
# listen on 192.0.2.1 on port 12345:
#SOCKET=inet:[email protected]
USER=opendkim
GROUP=opendkim
PIDFILE=$RUNDIR/$NAME.pid
EXTRAAFTER=
echo "Test DKIM" | mail -s "Testing DKIM" -a "Smtp: localhost:25" -a "From: [email protected]" -a "Return-path: [email protected]" [email protected]
...
Dec 8 06:36:04 mydomain postfix/qmgr[20126]: 147534143E: from=<[email protected]>, size=382, nrcpt=1 (queue active)
Dec 8 06:36:04 mydomain postfix/qmgr[20126]: 606CA413C2: from=<[email protected]>, size=382, nrcpt=1 (queue active)
Dec 8 06:36:23 mydomain postfix/pickup[20125]: BD701413AA: uid=1001 from=<[email protected]>
Dec 8 06:36:23 mydomain postfix/cleanup[20142]: BD701413AA: message-id=<[email protected]>
Dec 8 06:36:23 mydomain postfix/qmgr[20126]: BD701413AA: from=<[email protected]>, size=348, nrcpt=1 (queue active)
Dec 8 06:36:34 mydomain postfix/smtp[20128]: connect to mx.yandex.ru[xx.xx.xx.xx]:25: Connection timed out
Dec 8 06:36:34 mydomain postfix/smtp[20130]: connect to mx.yandex.ru[xx.xx.xx.x]:25: Connection timed out
Dec 8 06:36:34 mydomain postfix/smtp[20129]: connect to mx00.mail.com[xx.xx.xx.xx]:25: Connection timed out
Dec 8 06:36:34 mydomain postfix/smtp[20132]: connect to mx.yandex.ru[xx.xx.xx.xx]:25: Connection timed out
Dec 8 06:36:34 mydomain postfix/smtp[20131]: connect to mx.yandex.ru[xx.xx.xx.xx]:25: Connection timed out
Dec 8 06:36:34 mydomain postfix/smtp[20131]: connect to mx.yandex.ru[xx:xx:xx]:25: Network is unreachable
Dec 8 06:36:53 mydomain postfix/smtp[20143]: connect to mx.yandex.ru[xx.xx.xx.xx]:25: Connection timed out
Dec 8 06:36:53 mydomain postfix/smtp[20143]: connect to mx.yandex.ru[xx:xx::xx]:25: Network is unreachable
...
Dec 8 06:37:04 mydomain postfix/smtp[20129]: BF8F34138A: to=<[email protected]>, relay=none, delay=74075, delays=74015/0.02/60/0, dsn=4.4.1, status=deferred (connect to mx01.mail.com[xx.xx.xx.xx]:25: Connection timed out)
# Все попытки заканчиваются на Network is unreachable или Connection timed out
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question