Mail to external mail service is delivered locally

Created:

2016-11-16 13:02:16 UTC

Modified:

2017-08-16 17:19:28 UTC

4

Was this article helpful?


Have more questions?

Submit a request

Mail to external mail service is delivered locally

Applicable to:

  • Plesk for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.5 for Windows

Symptoms

  1. The domain example.com is hosted on Plesk server.

  2. Mail for example.com is hosted on an external mail server.

  3. An attempt to send a message through Plesk server to a mailbox on example.com fails with

    # tail -f /usr/local/psa/var/log/maillog | grep 'unknown in virtual mailbox'

    550 5.1.1 <info@pleskdomain.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<test@pleskdomain2.com> to=<info@pleskdomain1.com>
  4. 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.

  5. In webmail, the following error can occur:

    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)

Cause

Plesk configured the mail server to treat example.com as a local domain.

Resolution

Windows

Disable the mail service for example.com subscription:

  1. Go to Subscriptions > example.com > Mail > Change Settings .
  2. Uncheck Activate mail service on domain and click OK .

    You also can disable the mail service on the subscription using the mail utility:

    "%plesk_cli%\\mail" --off example.com

Linux

Disable the mail service for example.com subscription:

  1. Go to Subscriptions > example.com > Mail > Change Settings .
  2. Uncheck Activate mail service on domain and click OK .

    Mail service on the subscription can also be disabled using the mail utility:

    # /usr/local/psa/bin/mail --off example.com

    To disable the mail service for every subscription on the server, use the following command:

    MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -Nse"SELECT name FROM domains WHERE parentDomainId=0"|while read i; do /usr/local/psa/bin/mail --off $i && echo "Mail service for $i subscription has been disabled" ;done
  3. If the previous steps did not help, check the postfix configuration with the following command:

    [root@server ~]# postconf | grep mydomain
    append_dot_mydomain = yes
    mydestination = localhost, localhost.localdomain, localhost.$mydomain, $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 this case, to process example.com as an external domain, $mydomain removal from the postfix configuration is needed:

  4. 3.1. Create a backup of the current Postfix configuration /etc/postfix/main.cf .

  5. 3.2. Remove $mydomain from the mydestination list in the configuration file /etc/postfix/main.cf using a text editor.

  6. 3.3. Reload the postfix service to apply the changes:

        [root@server]# /etc/init.d/postfix reload

    Reloading postfix: [ OK ]
Have more questions? Submit a request
Please sign in to leave a comment.