Prevent Office365 mail exchange from being an open relay

0

I wish to use Office365 as a mail exchange for my server. It will have a single account - support@example.com and I will log in to the Office365 website to see all emails sent to this email address. I will send emails from the Office365 website and also relay emails from a php-cli script using phpmailer via the Office365 server.

I have added the account for support@example.com and I am able to send and receive emails via the Office365 website. I have also configured phpmailer with the following settings:

$From = "support@example.com";
$Sender = "support@example.com";
$Mailer = "sendmail";
$Host = "smtp.office365.com";
$SMTPAuth = true; //probably not needed
$Username = "support@example.com";
$Password = "xyz"; //probably not needed

In Office365 Exchange Admin Centre > mail flow > connectors I configured a connector to only allow connections from the IP address of my server.

Now when I run my test script from my server I am able to relay emails - so far so good. However when I run my test script from another server I am also able to relay emails! It seems my Office365 account is acting as an open relay! How can I prevent this from happening and only allow connections from the IP address of my server?

mulllhausen

Posted 2016-09-12T08:55:17.000

Reputation: 460

You are asking an off-topic question. Please read On-Topic, How do I ask a good question? and What types of questions should I avoid asking?

– DavidPostill – 2016-09-12T11:20:11.710

@DavidPostill hmm ok, sorry I didn't realize questions specific to corporate IT support were not permitted. – mulllhausen – 2016-09-13T01:15:18.713

No answers