• 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!
  • 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.

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