Mail to external mail service is delivered locally

Follow

Comments

10 comments

  • Avatar
    Keesjan

    You will really like this solution: https://serverfault.com/a/567424 

    Will do for all mailboxes at once...

  • Avatar
    Ivan Postnikov

    @Keesjan

    Thank you for the link.

    It may be useful for other Pleskians.

  • Avatar
    Geoff Myers

    @Keesjan Thank you for linking to this unofficial solution. It was the only one that actually worked for me.

  • Avatar
    Andrea Galizia

    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.

  • Avatar
    Nikita Nikushkin

    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

  • Avatar
    Andrea Galizia

    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.

  • Avatar
    Andrea Galizia

    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.

  • Avatar
    Nikita Nikushkin

    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?

  • Avatar
    Andrea Galizia

    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.

  • Avatar
    Ivan Postnikov

    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.

     

Please sign in to leave a comment.

Have more questions? Submit a request