How to configure SendGrid or use SMTP for CWP

Started by yush91, February 08, 2019, 03:32:31 AM

Previous topic - Next topic

yush91

Hi I am using Microsoft Azure Virtual Machine for my CentOS Web Panel.

As we all know Sending E-mail (Outbound Emails) on Microsoft Azure is blocked by default and there is no way to change that. I have added sendgrid on my azure app services.

All I need to know how to configure CWP to use a SMTP server as it's default mail server?

Netino

What are you meaning by "Microsoft Azure is blocked by default and there is no way to change that"..??

The SMTP server in CWP is already configured by default, but the CWP server blocks not authorized relays, not apps.

Regards,
Netino

yush91

It means that you can not send outbound e-mail if you're using a Virtual Machine on Microsoft Azure.
Sending email directly from a resource inside of Azure is not supported. See the blog below. You need to use a relay like O365, sendgrid, or a custom relay service to send email.
https://blogs.msdn.microsoft.com/mast/2017/11/15/enhanced-azure-security-for-sending-emails-november-2017-update/

That's why I was wondering how to configure CWP to use SMTP as it's default mail function. Instead of using the mail server which is already configured with CWP. SO that whenever I use php default mail function it will use an SMTP service by default to send the e-mail.

Netino

That documentation says users must employ authenticated SMTP relay services, typically connected via TCP port 587 submission, or alike.
Are you configured this port in your CWP server..??

If no, to you enable port 587, edit the file /etc/postfix/master.cf


nano /etc/postfix/master.cf


and remove the # in front of the line:


#submission inet n - n - - smtpd


so that it looks like this:


submission inet n - n - - smtpd


and restart postfix:

[/code]
systemctl reload postfix
[/code]

So, you will have a submission authenticated port, to you use it.