• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved Problem sending email after installing postfix with Domain Keys

ludm

New Pleskian
Hello,

I have installed postfix from the panel and then I have set up spf and domain keys to send email. I can send emails for the domains I have set up.
The problem is with automatic mail sent from cron task, application updates or problem with a backup.

The mail is not sent and I receive this kind of email :
---------------------------------------------------
This is the mail system at host nsXXXXXX.ovh.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

myadress@laposte.net: Command rejected


Reporting-MTA: dns; nsXXXXXX.ovh.net
X-Postfix-Queue-ID: xxxxxxxxxxxxxx
X-Postfix-Sender: rfc822; root@nsXXXXXX.ovh.net
Arrival-Date: Wed, 28 Sep 2016 03:36:21 +0200 (CEST)

Final-Recipient: rfc822; myadress@laposte.net
Action: failed
Status: 5.7.1
Diagnostic-Code: X-Postfix; Command rejected



Return-Path: <root@nsXXXXXX.ovh.net>
Received: by nsXXXXXX.ovh.net (Postfix, from userid 0)
id xxxxxxxxxxxxxxxxx; Wed, 28 Sep 2016 03:36:21 +0200 (CEST)
To: Admin myadress@laposte.net
Subject: <nsXXXXXX.ovh.net> Application Updates.
From: Admin myadress@laposte.net
Reply-To: Admin myadress@laposte.net
Date: Wed, 28 Sep 2016 03:36:21 +0200
X-Mailer: PHP/5.5.30
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
MIME-Version: 1.0
Message-Id: <xxxxxxxxxxxxx@nsXXXXXX.ovh.net>
---------------------------------------------------

How can I correct this problem ?
 
Last edited:
Hi ludm,

your hostname "nsXXXXXX.ovh.net" is not configured to be a valid domain - name on your server and therefore your MTA refuses the transport with a "reject". Consider to add a valid eMail - adress for the system - user root ( i.e. over your "alias" - table, or/and with the help of a optional "generic" - table : => http://www.postfix.org/generic.5.html ).
Due to the fact that you used "sendmail" in your example, you could as well define a specific sender - eMail - adress for PHP, explained at for example here: => #7
 
Last edited by a moderator:
Thank you for the answer, I have changed the default sender for PHP by adding sendmail_path = "/usr/sbin/sendmail -t -i -f postmaster@mydomain.com" in the PHP additional setting via Plesk, but I had received this email :

--------------------------------------------------
This is the mail system at host nsXXXXXX.ovh.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system

<root@localhost.localdomain> (expanded from <root>): Command rejected

Reporting-MTA: dns; nsXXXXXX.ovh.net
X-Postfix-Queue-ID: 63183707C831
X-Postfix-Sender: rfc822; root@nsXXXXXX.ovh.net
Arrival-Date: Thu, 29 Sep 2016 03:39:32 +0200 (CEST)

Final-Recipient: rfc822; root@localhost.localdomain
Original-Recipient: rfc822; root
Action: failed
Status: 5.7.1
Diagnostic-Code: X-Postfix; Command rejected

Return-Path: <root@nsXXXXXX.ovh.net>
Received: by nsXXXXXX.ovh.net (Postfix, from userid 0)
id xxxxxxxxxxxx; Thu, 29 Sep 2016 03:39:32 +0200 (CEST)
From: Anacron <root@nsXXXXXX.ovh.net>
To: root@nsXXXXXX.ovh.net
Content-Type: text/plain; charset="ANSI_X3.4-1968"
Subject: Anacron job 'cron.daily' on nsXXXXXX.ovh.net
Message-Id: <xxxxxxxxxxxxxxxxxxxxxxxxx@nsXXXXXX.ovh.net>
Date: Thu, 29 Sep 2016 03:39:32 +0200 (CEST)
----------------------------------------------------------------

So it seems that it doesn't solve the problem for the cron tasks.

I would like to use the "generic" table solution as you advised, but I'm not sure how to do it :
I simply add smtp_generic_maps = hash:/etc/postfix/generic with VI
in /etc/postfix/main.cf
and then in /etc/postfix/generic
root@nsXXXXXX.ovh.net postmaster@mydomain.com
or I need to use postmap command ?
 
I have added emails in generic file :
Code:
root@nsXXXXXX.ovh.net postmaster@mydomain.com
root@localhost.localdomain postmaster@mydomain.com
watchdog@nsXXXXXX.ovh.net postmaster@mydomain.com
and reloaded postfix.
I have well received an email from watchdog coming from postmaster@mydomain.com
but I also have problem :
Code:
This is the mail system at host nsXXXXXX.ovh.net.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<myadress@laposte.net>: Command rejected


Reporting-MTA: dns; nsXXXXXX.ovh.net
X-Postfix-Queue-ID: xxxxxxxx
X-Postfix-Sender: rfc822; root@nsXXXXXX.ovh.net
Arrival-Date: Sat,  1 Oct 2016 01:43:43 +0200 (CEST)

Final-Recipient: rfc822; myadress@laposte.net
Action: failed
Status: 5.7.1
Diagnostic-Code: X-Postfix; Command rejected


Return-Path: <root@nsXXXXXX.ovh.net>
Received: by nsXXXXXX.ovh.net (Postfix, from userid 0)
    id xxxxxxxx; Sat,  1 Oct 2016 01:43:43 +0200 (CEST)
To: myadress@laposte.net
Subject: [rkhunter] Warnings found for nsXXXXXX.ovh.net
From: watchdog@nsXXXXXX.ovh.net
Reply-To: watchdog@nsXXXXXX.ovh.net
Date: Sat, 01 Oct 2016 01:43:43 +0200
X-Mailer: PHP/5.5.30
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Disposition: inline
MIME-Version: 1.0

I have also this problem when I send an email :
Code:
Oct  1 02:51:05 nsXXXXXX postfix/smtpd[14207]: connect from localhost.localdomain[127.0.0.1]
Oct  1 02:51:35 nsXXXXXX postfix/smtpd[14207]: warning: milter inet:127.0.0.1:8891: can't read SMFIC_OPTNEG reply packet header: Connection timed out
Oct  1 02:51:35 nsXXXXXX postfix/smtpd[14207]: warning: milter inet:127.0.0.1:8891: read error in initial handshake
TCP port 53 is open in the firewall
 
Last edited:
I have inspected the maillog and I have :
Code:
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6723]: warning: milter inet:127.0.0.1:8891: can't read SMFIC_OPTNEG reply packet header: Connection timed out
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6723]: warning: milter inet:127.0.0.1:8891: read error in initial handshake
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6723]: A661770B8338: message-id=<xxxxxx.xxxxxxx@nsXXXXXX.ovh.net>
Oct  3 03:39:00 nsXXXXXX /usr/lib64/plesk-9.0/psa-pc-remote[10167]: handlers_stderr: SKIP
Oct  3 03:39:00 nsXXXXXX /usr/lib64/plesk-9.0/psa-pc-remote[10167]: SKIP during call 'check-quota' handler
Oct  3 03:39:00 nsXXXXXX spf filter[6730]: Starting spf filter...
Oct  3 03:39:00 nsXXXXXX spf filter[6730]: Wrong HELO hostname: localhost
Oct  3 03:39:00 nsXXXXXX /usr/lib64/plesk-9.0/psa-pc-remote[10167]: handlers_stderr: REJECT
Oct  3 03:39:00 nsXXXXXX /usr/lib64/plesk-9.0/psa-pc-remote[10167]: REJECT during call 'spf' handler
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6723]: A661770B8338: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 5.7.1 Command rejected; from=<root@nsXXXXXX.ovh.net> to=<root@nsXXXXXX.ovh.net>
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6723]: A661770B8338: to=<root@localhost.localdomain>, orig_to=<root>, relay=none, delay=30, delays=30/0/0/0, dsn=5.7.1, status=bounced (Command rejected)
Oct  3 03:39:00 nsXXXXXX postfix/cleanup[6732]: DF8A070B8843: message-id=<20161003013900.DF8A070B8843@nsXXXXXX.ovh.net>
Oct  3 03:39:00 nsXXXXXX postfix/bounce[6731]: A661770B8338: sender non-delivery notification: DF8A070B8843

Is it possible that the problem is linked to this line in /etc/postfix/main.cf:
Code:
non_smtpd_milters = $smtpd_milters
 
Last edited:
Hi ludm,

you made some positive progress, when you finally choosed to post depending entries from your mail.log , but instead of going further with your investigations, you still miss to post the complete configuration files ( main.cf and master.cf for postfix ), which are as well essential to investigate issues/problems/errors.

Your issues depend as well on your local "aliases" - settings on your server ( file: => /etc/aliases ) - consider to post the content of this file as well for investigations.

Second, pls. consider to post as well the content of "/etc/hostname" and "/etc/hosts", which seem to be mis- or unconfigured.

Third, pls. keep in mind, that if you would wish to remain anonymous here with your FQDN, it is far more difficult to help you with your investigations. ;)
 
The problem seems to be solved, I have replaced
Code:
non_smtpd_milters = $smtpd_milters
by
Code:
non_smtpd_milters = inet:127.0.0.1:8891

In case you see something wrong, here is the /etc/hosts content :
Code:
127.0.0.1   localhost.localdomain   localhost
XX.XXX.XX.XXX nsXXXXXX.ovh.net   nsXXXXXX
I haven't got /etc/hostname

The content of main.cf is:
Code:
readme_directory = /usr/share/doc/postfix-2.8.17/README_FILES
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_sender_restrictions = check_sender_access hash:/var/spool/postfix/plesk/blacklists, permit_sasl_authenticated
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
non_smtpd_milters =
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = , hash:/var/spool/postfix/plesk/vmailbox
transport_maps = , hash:/var/spool/postfix/plesk/transport
smtpd_tls_cert_file = /etc/postfix/postfix_default.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_security_level = may
smtpd_use_tls = yes
smtp_tls_security_level = may
smtp_use_tls = no
smtpd_timeout = 3600s
smtpd_proxy_timeout = 3600s
disable_vrfy_command = yes
mynetworks = , 127.0.0.0/8, [::1]/128
smtp_send_xforward_command = yes
smtpd_authorized_xforward_hosts = 127.0.0.0/8 [::1]/128
smtpd_sasl_auth_enable = yes
virtual_mailbox_base = /var/qmail/mailnames
virtual_uid_maps = static:110
virtual_gid_maps = static:31
smtpd_milters = , inet:127.0.0.1:12768
sender_dependent_default_transport_maps = hash:/var/spool/postfix/plesk/sdd_transport_maps
virtual_transport = plesk_virtual
plesk_virtual_destination_recipient_limit = 1
mailman_destination_recipient_limit = 1
mailbox_size_limit = 0
virtual_mailbox_limit = 0
message_size_limit = 10240000

# OpenDKIM
milter_default_action = accept
milter_protocol = 6
smtpd_milters =  inet:127.0.0.1:8891, inet:127.0.0.1:12768
#non_smtpd_milters = $smtpd_milters
# replace to solve sending problem from acron plesk task and watchdog
non_smtpd_milters = inet:127.0.0.1:8891

#added for generic
smtp_generic_maps = hash:/etc/postfix/generic


Here is the /etc/aliases/
Code:
mailer-daemon:   postmaster
postmaster:   root

# General redirections for pseudo accounts.
drweb:       root
psaadm:       root
bin:       root
daemon:       root
adm:       root
lp:       root
sync:       root
shutdown:   root
halt:       root
mail:       root
news:       root
uucp:       root
operator:   root
games:       root
gopher:       root
ftp:       root
nobody:       root
radiusd:   root
nut:       root
dbus:       root
vcsa:       root
canna:       root
wnn:       root
rpm:       root
nscd:       root
pcap:       root
apache:       root
webalizer:   root
dovecot:   root
fax:       root
quagga:       root
radvd:       root
pvm:       root
amanda:       root
privoxy:   root
ident:       root
named:       root
xfs:       root
gdm:       root
mailnull:   root
postgres:   root
sshd:       root
smmsp:       root
postfix:   root
netdump:   root
ldap:       root
squid:       root
ntp:       root
mysql:       root
desktop:   root
rpcuser:   root
rpc:       root
nfsnobody:   root

ingres:       root
system:       root
toor:       root
manager:   root
dumper:       root
abuse:       root

newsadm:   news
newsadmin:   news
usenet:       news
ftpadm:       ftp
ftpadmin:   ftp
ftp-adm:   ftp
ftp-admin:   ftp
www:       webmaster
webmaster:   root
noc:       root
security:   root
hostmaster:   root
info:       postmaster
marketing:   postmaster
sales:       postmaster
support:   postmaster


# trap decode to catch security attacks
decode:       root

# Person who should get root's mail
#root:       marc
 
Hi ludm,

smtpd_milters = inet:127.0.0.1:8891, inet:127.0.0.1:12768
This is a non-standard order - pls. consider to use:

smtpd_milters = inet:127.0.0.1:12768, inet:127.0.0.1:8891

... to avoid issues/errors/problems. ( Note: Here is a general rule: FIRST COME = FIRST SERVE )



I haven't got /etc/hostname
This is a non-standard configuration on linux systems. To avoid issues, consider to create the file with for example:

echo nsXXXXXX.ovh.net > /etc/hostname

... and reboot afterwards. Consider as well to edit your "/etc/hosts" - file:

From:
127.0.0.1 localhost.localdomain localhost
XX.XXX.XX.XXX nsXXXXXX.ovh.net nsXXXXXX
to:
Code:
127.0.0.1   localhost.localdomain   localhost
XX.XXX.XX.XXX nsXXXXXX.ovh.net   nsXXXXXX

127.0.0.1   nsXXXXXX.ovh.net   nsXXXXXX



The content of main.cf is:
...
You shortened your "main.cf" and didn't post the content of your "master.cf", for what ever reason. :rolleyes: No suggestion here, because of missing informations!



For your "/etc/aliases" - file:
Who configured all these entries? Why is there no "root" - definition, even that you already considered to change:
As you can see in your log - file, the alias "root" is configured as "root@localhost.localdomain", because you defined all sorts of aliases, but forgot to define to adjust "root" itself.
Oct 3 03:39:00 nsXXXXXX postfix/cleanup[6723]: A661770B8338: to=<root@localhost.localdomain>, orig_to=<root>, relay=none, delay=30, delays=30/0/0/0, dsn=5.7.1, status=bounced (Command rejected)
 
Back
Top