Previously we discussed setting up Postfix SMTP relay with mailjet, which is useful when you have to use a commercial SMTP relay service. This tutorial will be showing you how to set up SMTP relay between 2 Postfix SMTP servers on CentOS/RHEL.

Use Case

Let’s say there are two servers: server A and server B.

  • You have set up a full-featured mail server on server A with Postfix as the SMTP server. You can use it to send emails directly to recipients, because port 25 isn’t blocked.

  • Later you use server B to set up a website, which needs to send notification emails to users.

You can set up another mail server on server B, but it’s a waste of time and hardware resources. A more sensible solution is to install Postfix SMTP server on server B and configure it to send emails via server A, which can relay emails from server B to the final recipients. Server A has built up its IP reputation, so you don’t have to build IP reputation for server B.

If you run WordPress on your own Linux server, I recommend you follow this tutorial to set up Postfix SMTP relay. This way, you can get rid of SMTP plugins in WordPress. WordPress plugins slow down your site and they can be vulnerable, such as the vulnerability found in the Easy WP SMTP plugin, which allows unauthorized users to modify WordPress options and execute malicious code. My site has been compromised once, because of a vulnerability in WordPress plugin. So I get rid of as many plugins as I can, when I can implement the same functionality with the underlying operating system.

Without further ado, let’s get started.

#mail server #smtp relay #centos #linux

Set Up SMTP Relay Between 2 Postfix SMTP Servers on CentOS/RHEL
3.25 GEEK