• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Use SMTP while MX record is to a different server

Wim Haanstra

New Pleskian
I have a Plesk 12.5 installation, running on a CentOS machine, which uses Postfix for SMTP.

I have a domain, which is hosted on this machine, but the MX records for this domain point to a different server. The application that is running on this machine (Ruby on Rails site), needs an SMTP server to send certain emails.

The RoR application has this server configured as SMTP server, with a username and password for a user I created using Plesk.

If I have the Mail service for this site enabled, none of the emails are getting delivered to the right server. Emails are rejected with the message "Recipient address rejected: User unknown in virtual mailbox table;". (This is logical, because the account the email is send to, doesn't exist on the server).

If I disable the mail service for this domain, I can no longer send email using my application, because password authentication fails (which is also logical).

Is there a way to have both? Be able to send emails from the server using an email address from the domain that is hosted on the machine, but they are send to the right server?
 
Why not just use the remote SMTP server's credentials. You for sure want mail service "Off" locally. It's going to cause problems if you keep it on (e.g., your website scripts trying to mail locally and other clients on that same machine not being able to email that client).
 
Why not just use the remote SMTP server's credentials. You for sure want mail service "Off" locally. It's going to cause problems if you keep it on (e.g., your website scripts trying to mail locally and other clients on that same machine not being able to email that client).

I really don't want to store any credentials of the 'external' mail server on this server. Mostly because it's an Office 365 server.
 
I think you will have to. I don't see that as a security risk if your files are properly protected from viewing these credentials, and you are using encrypted authentication. Alternatively, you should be able to configure Ruby to just use the server's sendmail and not worry about a remote SMTP.

config.action_mailer.delivery_method = :smtp

becomes

config.action_mailer.delivery_method = :sendmail
 
Back
Top