2

I'm using a third party mail server to receive/send emails for the domains hosted on the VPS. They provide MX, TXT, CNAME records (without any IP address) to add in the DNS zone file for each domain, which I did successfully and emails are being sent by the PHP script using SMTP authentication.

Thus, I have disabled all email related services (Postfix, Dovecot, etc.) on low resource CentOS 7 VPS. As a result, I'm not getting system emails like SSH login alert, IP block, etc. from LFD + CSF.

I want to receive these system notifications and by searching on the internet, I have come to know that I've to continue Postfix MTA and convert it as a send-only SMTP server.

However, is there any option to send system alerts using SMTP authentication without the Postfix? If yes then what do I need to configure exactly?

Additionally, I have checked the Reporting Settings in the Firewall configuration but couldn't understand how do I perform LFD/CSF to send these emails using third-party SMTP authentication for the primary domain name.

Can anyone please assist me to send System Emails without Postfix MTA on VPS? I'm using CentOS Web Panel to control hosting.

2 Answers2

1

This is a great fit for a program called msmtp (the sSMTP program from the other answer is no longer in active development).

It can be easily configured to send all email via an external SMTP account including authentication, SSL, etc. There's an example configuration file here.

On Ubuntu this requires 2 packages, msmtp and msmtp-mta, but I think they may both be included in a single package on Fedora as there's no msmtp-mta package there.

chmac
  • 130
  • I found the sSMTP package easier. It is maintained as can be checked here in the Changelog. – Rajan Sharma Aug 19 '22 at 05:51
  • That's not accurate, that changelog is from a distribution and not the package itself. See here and here which both note that the package is unmaintained and recommend mSMTP as an alternative. – chmac Aug 21 '22 at 09:23
  • You are right, have to switch to another package. However, I was not able to send system emails to Gmail using the external mail server using msmtp. – Rajan Sharma Aug 21 '22 at 09:50
0

A similiar question has been asked here.

Stricly speaking, no, you need some kind of MTA / software running to forward email.

sSMTP sounds like the best choice because it's very leightweight / meant for forwaring only.

archlinux wiki has some additional details on configuring it.