Applicable to:
- Plesk for Linux
- Plesk for Windows
Symptoms
-
Attempts to send a message from the Plesk server to a mailbox on
example.com
fails with one of the errors below:# tail -f /usr/local/psa/var/log/maillog | grep 'unknown in virtual mailbox'
550 5.1.1 jdoe@example.com: Recipient address rejected: User unknown in virtual mailbox table; from=test@pleskdomain2.com to=jdoe@example.com
CONFIG_TEXT: example.com postfix-local[23040]: cannot chdir to mailname dir contact: No such file or directory
example.com postfix-local[23040]: Unknown user: jdoe@example.com
CONFIG_TEXT: ME-E0103: [1076] Local Delivery: Failure - Domain for ([SMTP:jdoe@example.com]) is locally serviced, but recipient is not defined in address map.
-
In webmail, the following error might occur:
CONFIG_TEXT: Could not send message to SMTP server. Check you have access to send messages via the server and that all To/CC/BCC addresses are valid
Error: SMTP Server rejected email. Returned:550 sorry, no mailbox here by that name. (#5.7.17)
CONFIG_TEXT: Error SMTP (500): The following recipient could not be reached "jdoe@example.com" (sorry, no mailbox here by that name. (#5.7.17)).
CONFIG_TEXT: There was an error sending your message: Message could not be delivered - the address was not found, is unknown, or is not receiving messages.
CONFIG_TEXT: 550 5.1.1 jdoe@example.com ... User unknown (in reply to MAIL FROM command))
-
Plesk emails notifications are not delivered
-
The bounce message shows that there was a failed delivery attempt within the Plesk server, without an attempt to contact the external mail server that hosts the example.com mail service.
Cause
The domain example.com
is hosted on the Plesk server but the mail for the domain is hosted on an external mail server/service.
Mail server treats example.com
as a local domain and tries to send emails locally.
Resolution
Note: In some cases, the mail service is necessary locally and externally.
Vote the UserVoice request as top-voted suggestions are likely to be implemented in future Plesk updates.
Disable the mail service per domain or subscription:
-
Go to Domains > example.com > Mail Settings and uncheck Activate mail service on this domain and click OK.
Or disable mail service at the subscription level going to Subscriptions > example.com > Mail tab > Mail Settings tab > Select domains from the subscription > Click on Activate/Deactivate Services.
To disable the mail service on the subscription using command-line utility (run this on the server via CMD):
C:\> plesk bin mail --off example.com
Disable the mail service per domain or subscription:
-
Go to Domains > example.com > Mail Settings and uncheck Activate mail service on this domain and click OK.
Or disable mail service at the subscription level going to Subscriptions > example.com > Mail tab > Mail Settings tab > Select domains from the subscription > Click on Activate/Deactivate Services.
Mail service on the subscription can also be disabled using the
mail
utility:# plesk bin mail --off example.com
To disable the mail service for every subscription on the server, use the following command:
# plesk bin subscription --list | while read i; do plesk bin mail --off $i && echo "Mail service for $i subscription has been disabled" ;done
If the previous steps did not help, check the postfix configuration:
-
Execute the following command:
# postconf | grep mydomain
append_dot_mydomain = yes
mydestination = localhost, localhost.localdomain, localhost.$mydomain, $mydomain = example.com
mydestination
parameter contains the list of domains that are delivered via the $local_transport
mail delivery transport. For additional information, see the official postfix documentation .
In case the domain name is there, to process example.com
as an external domain, $mydomain removal from the postfix configuration is required:
-
Create a backup of the current Postfix configuration
/etc/postfix/main.cf
.# cp /etc/postfix/main.cf{,.bak}
-
Remove $mydomain from the mydestination list in the configuration file
/etc/postfix/main.cf
using a text editor. -
Reload the
postfix
service to apply the changes:# systemctl reload postfix.service
If the external mail service is used for all subscriptions, it is possible to modify Postfix configuration to exclude domains which exist in Plesk from the local delivery:
-
Create a backup of the current Postfix configuration
/etc/postfix/main.cf
.# cp /etc/postfix/main.cf{,.bak}
-
Open file
/etc/postfix/main.cf
and comment out the following lines by prepending it with '#' sign:CONFIG_TEXT: #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 -
Reload the
postfix
service to apply the changes:# systemctl reload postfix.service
Comments
18 comments
You will really like this solution: https://serverfault.com/a/567424
Will do for all mailboxes at once...
@Keesjan
Thank you for the link.
It may be useful for other Pleskians.
@Keesjan Thank you for linking to this unofficial solution. It was the only one that actually worked for me.
Thank you for the explanation but I am stuck.
I have several domains, but only one uses an external mail service, let's call it "external.com"
The mail service is disabled for external.com
I have checked the postfix configuration and it returns:
append_dot_mydomain = yes
mydestination = localhost.$mydomain, localhost, localhost.localdomain
mydomain = domain.com
But still, all the emails sent to external.com do not go through.
Is there something I am missing?
Thanks in advance for your help.
Hi @Andrea Galizia,
Have you tried to check the /var/log/maillog file regarding the potential errors?
If the message is gone to the external mail server but is not delivered to the recipient, it is required to look for the root cause on the external mail server instead of Plesk
Hi Nikita,
yes, and that leads me to the real problem. The emails are bounced back from the external mail server with message "550 Sender domain is a local domain".
I have noticed that despite the contact form sends with "user@anotherdomain.com" as a sender, Postfix changes it to username@external.com, where username is the subscription user name and external.com is the domain that uses external email server. No matter what I do the sernder is always the same.
I have moved all the domains from shared hosting with cPanel to VPS with Plesk; only on Plesk this problem happens, on cPanel I have no problems.
I think this is my case: https://support.plesk.com/hc/en-us/articles/360002906354-Emails-sent-using-a-PHP-script-use-incorrect-sender-email-address
But I do not have access to modify WordPress scripts, besides it works fine under cPanel.
Hi @Andrea Galizia,
Indeed, In Plesk emails via PHP are sent under the system user
However, possibly this article could help you:
How to send mail via PHP script using a mailbox located on another server?
Hi @Nikita Nikushkin,
thanks for the solution but the domain uses WordPress, not easy to change the library used for sending emails. Temporarily I have solved by sending the email to a mailbox on another domain hosted on the same server, and the mailbox forward to the external mail server.
Not an elegant solution but it works.
Giving the possibility to choose the sender on PHP emails will be nice to have in future Plesk versions, it would save so much time and reduce frustration.
Hello @Adrea,
Thank you for the shared solution and detailed feedback.
Based on your case, I've created a feature-suggestion to add such functionality to Plesk: https://plesk.uservoice.com/forums/184549-feature-suggestions/suggestions/38144563-ability-to-set-sender-email-address-from-plesk?
Feel free to vote for it and comment. The top-rated suggestions are likely to be implemented in the future product versions.
Recently used VPS + Plesk as web- & email-Server. Now switched to MS 365/Exchange mail service for that certain Domain, here: domain.com, web service remains on Plesk. Mailservice in Plesk has to be still active for domain.com while used as a backup mailserver / archive clients need to be able to connect to.
The Problem: Other domains (here: domain-2.com etc) on that VPS/Plesk setup still use the Plesk mail service for email delivery. While there are several email forwardings set up for domain-2.com to the above mentioned domain.com those mails are forwarded and delivered locally, not to MS 365/Exchange's mailservice.
In short:
Mails to domain-2.com (with Plesk mail service active and in use) have to be delivered to domain.com (also with Plesk mail service active and in use) with an external mail service running.
How is this achieved?
Thank you!
Hi Jay,
It is not possible. Postfix designed in a way that if the domain is located on local server it will always deliver locally and will never check for MX records, means it will never attempt to send externally.
Hi, Can anyone answer my query please?
I've setup Zoho mail Split delivery and changed the MX records to zoho which delivers all incoming mails to zoho first and which emails match with zoho paid ids it delivers there and which do not match it comes to our Plesk Linux server. (We're using VPS)
Our Scenario-
We have created two ids(pleskuser@mydomain.com & zohouser@mydomain.com) on Plesk-server and bought professional mailing service from Zoho for id 'zohouser' so, the 'zohouser' id is available both on Plesk-server and Zoho-server.
Our problem-
When we send email from our 'pleskuser' to 'zohouser', it delivers to Plesk-server but not on Zoho-server. However, it should deliver to Zoho-server first because we're actively using it.
Our so far observation-
It looks that 'pleskuser' id first goes into local mail server to deliver the same domain email.
Our observed solution-
If the mails first go for remote mail server then problem could be solved. But, we don't know how to achieve this? If we remove 'local delivery' then those mails will fail which are only hosted on Plesk server and not on zoho.
Please, suggest the solution.
It's been 15 days we're hang up.
@K Khan this scenario will not work. According to its business logic postfix always try to send email locally if recipients domain or mailbox exists on the server.
You could disable mail service on the domain - in this case postfix will send email according to its MX record.
We do not include mail service in our subscriptions.
All our clients have external mail services such as Office 365.
We noticed that when creating a new subscription, based on a service plan in which the mail service is turned off, the mail service setting is ignored.
The mail options in the control panel are hidden, which you would expect. But under water, the mail service is still enabled. (tested on Plesk Obsidian Version 18.0.25 Update #2)
In our case this means that mail from the website will never be delivered to the correct mailserver.
After starting a telnet session to the server we get the '550 5.1.1 <info@domain.nl>: Recipient address rejected: User unknown in virtual mailbox table' error.
Only after manually turning off the mail service through SSH, the service is actually disabled for the domain.
telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 servername.nl ESMTP Postfix (Ubuntu)
EHLO man
250-servername.nl
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
MAIL FROM: <mail-address>
250 2.1.0 Ok
RCPT TO: <info@>
550 5.1.1 <info@>: Recipient address rejected: User unknown in virtual mailbox table
plesk bin mail --off example.com
SUCCESS: Turning mail service for domain 'example.com' on/off complete.
telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 servername.nl ESMTP Postfix (Ubuntu)
EHLO man
250-servername.nl
250-PIPELINING
250-SIZE 10240000
250-ETRN
250-STARTTLS
250-AUTH DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
250-XFORWARD NAME ADDR PROTO HELO SOURCE PORT IDENT
250-ENHANCEDSTATUSCODES
250-8BITMIME
250-DSN
250 CHUNKING
MAIL FROM: <mail-address>
250 2.1.0 Ok
RCPT TO: <info@>
250 2.1.5 Ok
Hello Harm Jakob Tolsma
This happens because you have mailserver is installed.
In case, it's not required server-wide, you may remove it from the server via Tools & Settings > Updates.
It's possible to retrieve mail content with message-id ?
I've a lot of message like : relay=plesk_virtual, delay=0.09, delays=0.01/0/0/0.08, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
And i need find these
Hi,
My few cents on this; If you'd like to disable the email accounts but like to keep sending emails with PHP for example use this: we always run two cronjobs each night (on system user level) and keep the system setting "Enable mail management functions in Plesk" active so we keep the mail queue functionality.
Cronjob 1: disable mail service for all domains:
Command: /usr/sbin/plesk db -Ne"select name from domains" | while read i; do /usr/sbin/plesk bin mail --off $i && echo "Mail service for $i subscription has been disabled" ;done
Cronjob 2: disable mail service for all domain aliases:
Command: /usr/sbin/plesk db -Ne"select name from domain_aliases" | while read i; do /usr/sbin/plesk bin domalias -u $i -mail false && echo "Mail service for $i subscription has been disabled";done
Please sign in to leave a comment.