Create new connector and assign relay permissions.
Pretty simple really,
Open your exchange power shell and enter the following cmds to create and set permissions on your new connector. Use the New-ReceiveConnectorcmdlet to create the Receive connector Anonymous Relay that listens on local IP addresses.
New-ReceiveConnector -Name “Anonymous Relay” -Usage Custom -PermissionGroups AnonymousUsers -Bindings 192.168.1.5:25 -RemoteIpRanges 192.168.1.1-192.168.1.255
Now we must use the Exchange Shell to grant relay permission to anonymous connections on the new Receive connector. The next cmd-let retrieves the specified Receive connector information and pipes the result to the Add-ADPermissioncmdlet to grant relay permission to anonymous connections on the new Receive connector.
Get-ReceiveConnector “Anonymous Relay” | Add-ADPermission -User “NT AUTHORITY\ANONYMOUS LOGON” -ExtendedRights “Ms-Exch-SMTP-Accept-Any-Recipient”
You can open up a telnet session to the IP of your exchange server and test the mail flow. This will confirm that your relay is up and running.
The first thing to do is to open a connection from your computer to your mail server.
telnet 192.168.1.5 25
You should receive a reply like:
Connected to 192.168.1.5
Escape character is ‘^]’.
220 mail.domain.ext Microsoft Exchange Server XXX.YYY.xxx.yyy
You will then need to delcare where you are sending the email from:
HELO local.domain.name – dont worry too much about your local domain name.
This should give you:
250 192.168.1.5 Hello local.domain.name [Your IP address],
Now give your email address:
MAIL FROM:< email@example.com >
250 2.1.0 firstname.lastname@example.org... Sender ok
Now give the recipients address:
RCPT TO:< email@example.com >
250 2.1.0 firstname.lastname@example.org... Recipient ok
To start composing the message issue the command
If you want a subject for your email type
Subject: type your subject here
You may now proceed to type the body of your message.
To tell the mail server that you have completed the message enter a single “
.” on a line on it’s own.
The mail server should reply with:
250 2.0.0 ???????? Message accepted for delivery
You can close the connection by issuing the
The mailserver should reply with something like:
221 2.0.0 mail.domain.com closing connection Connection closed by foreign host.