Author Topic: How to configure SendGrid or use SMTP for CWP  (Read 8811 times)

0 Members and 2 Guests are viewing this topic.

Offline
*
How to configure SendGrid or use SMTP for CWP
« on: February 08, 2019, 03:32:31 AM »
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?

Offline
***
Re: How to configure SendGrid or use SMTP for CWP
« Reply #1 on: February 09, 2019, 01:44:56 AM »
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

Offline
*
Re: How to configure SendGrid or use SMTP for CWP
« Reply #2 on: February 09, 2019, 02:45:18 AM »
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.

Offline
***
Re: How to configure SendGrid or use SMTP for CWP
« Reply #3 on: February 10, 2019, 02:02:35 AM »
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

Code: [Select]
nano /etc/postfix/master.cf

and remove the # in front of the line:

Code: [Select]
#submission inet n - n - - smtpd

so that it looks like this:

Code: [Select]
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.