Jump to content

[SOLVED] Exchange server and relaying email


TLawrence

Recommended Posts

I'm currently working on a project that sends emails to users via the mail() function in PHP.  It works fine when I'm sending an email to a user within the client's domain (I'll use client.com as an example). So tester1@client.com, tester2@client.com, etc., are delivered with no problems.

 

If I try to send an email to another domain, say tester@external.com, I get the "550 5.7.1 Unable to relay for tester@external.com" error message.

 

I'm assuming this is a security feature of Exchange to keep the server from being a spam relay.  Is there some way I can turn this off, or allow these "external" emails to be sent?  Some of the users on this system do not have an internal email address, so I need to be able to send emails to any address.

 

I don't think it's a PHP problem since the internal addresses are working.  Is there some setting on the Exchange server I can change that will allow emails to be sent to any address? 

 

Any help would be appreciated.

 

Thanks in advance,

tlawrence

Link to comment
Share on other sites

The From address is a working, internal email address.

 

I found these steps on another website...this MAY solve the problem.  I'm waiting for my client to try it.

 

Open the Exchange System Manager;

Go in Administrative Groups -> Administrative group name -> Server -> Server name -> Protocols -> SMTP;

Right click on Default SMTP Virtual Server -> properties;

Access tab -> Relay buttom;

Select "only the list bellow" and add your domain and\or IPs you do want to allow the relay

and finally check  the "Allow all computers witch successfully authenticate to relay, regardless of the list above" checkbox.

 

 

Link to comment
Share on other sites

The reason I asked about the From: address is that the mail server should have already been setup to allow relaying when the From: address is a valid email address hosted on the mail server (many people put other things/external addresses into the From: address and then have the same symptoms that you are having.)

Link to comment
Share on other sites

Right, I've run into that before which some times works, and some times doesn't, but that's another issue.

 

The problem is that I'm not familiar with Exchange so I have to rely on my client's IT department.  But they don't seem to know a whole lot about the ins and outs of Exchange either, so I was looking for someone to shed further light on the situation.  I need the server to relay mail to any email address via the mail() function.  Isn't there some kind of setting in Exchange to allow this?

Link to comment
Share on other sites

The only problem with this is that I won't always know the domain.  The users enter their own email address, which could be anything, so I don't know what domains/IPs to allow.  Is there a way to configure Exchange to allow relaying for any email address?

Link to comment
Share on other sites

I don't see how adding the server's IP would change the outcome.  I can already send emails to internal addresses, just not external, so it has do with domain of the email address, not the server....now that I think about it, I don't think that solution below is going to work.

Link to comment
Share on other sites

When the To: address is on the server, the email just an incoming email. No relaying is involved and no relaying rules are applied.

 

When the To: address is not on the server, the relaying settings come into play and the client sending the email (php) must either be trusted by the mail server or you must use SMTP authentication, which is what the last part of the post you made above is mentioning.

 

Sending To: the email server is different than relaying through the email server.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.