CentOS 8 and SMTP solutions: Postfix? Sendmail?

Issues related to applications and software problems and general support
Post Reply
User avatar
oceanjeremy
Posts: 46
Joined: 2020/05/29 15:01:00

CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by oceanjeremy » 2020/07/02 18:01:19

I've been trying to research this on my own and I'm running into a lot of dead ends and (worse) conflicting information.

Here's what I've got going on:
  • Vultr VPS running CentOS 8 (I have confirmed with tech support, SMTP is open :D)
  • Apache, MariaDB
  • Hosting two different websites with different domain names — so far! Planning to run more.
Let's call them domain.one and second.website.

My goal: To be able to send and receive email from both domains (and any future domains) without paying anyone for the privilege to do so.

Incoming email I have set. I've got ImprovMX forwarding a catchall from *@domain.one to one Gmail account, and forwarding *@second.website to a different Gmail account. I just set up some MX DNS records et voilà— works perfectly.

Now if I want to set Gmail up with an alias to email from those domain names it needs an SMTP server username and password.

So my questions are:
  1. Is this something I can do using Postfix, Sendmail, or another mail server? Set it up just to send email (it doesn't need to receive) — and to work for both domain.one and second.website?
  2. Am I setting myself up for failure even just trying to do this with my own server? :lol: Is there a better option?
Please be kind! I've only been a Linux user for eight months.

User avatar
oceanjeremy
Posts: 46
Joined: 2020/05/29 15:01:00

Re: CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by oceanjeremy » 2020/07/02 19:46:20

Crap on a stick.

Turns out I can just use Gmail's SMTP via ImprovMX, still for free.

It was only giving me an error earlier because of a weird setting deep in the bowels of my Google Account Settings.

OK so my problem is fixed. However... I'd still like to know if this is something I could accomplish with Postfix or Sendmail? :?:
Please be kind! I've only been a Linux user for eight months.

User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by KernelOops » 2020/07/02 20:05:20

Thats what centos is for :D if you learn how to setup the right software, there is no need to depend on others.

sendmail is rather deprecated software and has faded into the history books. What you need is postfix, which is easy to setup with virtual hosts, so that it can send/receive for all your domains, since postfix is for SMTP only, you also need dovecot for IMAP/POP3.

there are tons of guides to help you setup a postfix/dovecot email service under centos.
--
R.I.P. CentOS :cry:
--

User avatar
oceanjeremy
Posts: 46
Joined: 2020/05/29 15:01:00

Re: CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by oceanjeremy » 2020/07/02 20:17:13

KernelOops wrote:
2020/07/02 20:05:20
Thats what centos is for :D if you learn how to setup the right software, there is no need to depend on others.

sendmail is rather deprecated software and has faded into the history books. What you need is postfix, which is easy to setup with virtual hosts, so that it can send/receive for all your domains, since postfix is for SMTP only, you also need dovecot for IMAP/POP3.

there are tons of guides to help you setup a postfix/dovecot email service under centos.
Thanks!

ImprovMX is good for my current needs. When I need to eventually scale up I can tackle Postfix and dovecot then.

Follow-up question: I've read elsewhere that it's best to run your web hosting on one server and then set up a standalone mail server for email needs.

Any thoughts on that?
Please be kind! I've only been a Linux user for eight months.

User avatar
KernelOops
Posts: 428
Joined: 2013/12/18 15:04:03
Location: xfs file system

Re: CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by KernelOops » 2020/07/03 12:52:34

To be honest, in practice it does not make any difference, you can run lots of services in the same server without any problems.

But... to be extra safe, its better to split services among separate servers. This gives you extra safety, in case one service is compromised and/or a whole server dies. Then your other services will not be affected.

Separate servers gives you an additional advantage, of separating resource usage. So if your web site is being hammered and cpu/disk usage is fully consumed by apache or php, then your other services, like email, will remain usable.

In most cases, it all comes down to cost and type of use. A business will prefer the extra security and split services among multiple servers, while an individual who doesn't really care about security and has little chances of owning a popular website, may opt to put everything in one server.
--
R.I.P. CentOS :cry:
--

User avatar
oceanjeremy
Posts: 46
Joined: 2020/05/29 15:01:00

Re: CentOS 8 and SMTP solutions: Postfix? Sendmail?

Post by oceanjeremy » 2020/07/03 14:51:01

Thanks KernelOops!

I'm in a similar boat as the individual who doesn't care — except I'm happy to let ImprovMX handle the inbound emails and use Gmail alias for outbound emails. Sure, it means I will have "via Gmail" next to my email address in people's inboxes. That's fine for now.

If I get to a volume I need to upgrade then I'll go with split servers. Right now I'm just trying to master running multiple small low-bandwidth sites on a single VPS.

As I progress I'll definitely eventually set up a split mail server just so I know how.

But not today. :D
Please be kind! I've only been a Linux user for eight months.

Post Reply