We had a customer with a unique setup for their email. They needed all emails in SharePoint to be sent through an alternate port. Seeing as there isn't a way for SharePoint to select the outgoing port, I had to get a little creative. I have SharePoint sending email to my local SMTP on the server, which is then redirecting to the Exchange server on the alternate port.
Here's what I did.
My SharePoint Server
- Install SMTP, use IIS6 Management to manage.
- Go to properties of SMTP Virtual Server.
- Access tab > Relay Restrictions: to allow 127.0.0.1 and my IP.
- Delivery tab > Outbound Connections: TCP port to 587. Specify your desired port number here.
- Delivery tab > Advanced: set masquerade domain to FQDN of mail server, Smart Host to internal server name, no checkboxes selected below.
- Delivery tab > Outbound Security: I had some issues with this, works fine when Exchange allows anonymous relaying on the port, and I use Anonymous in my SMTP. I tried Basic Authentication and check TLS Encryption, that didn't error on the local SMTP, but I never recieved the emails.
- After changes are made, restart SMTP Service.
- Configure SharePoint to use the local server name as the outgoing server name.
Blamo! I started recieving emails from SharePoint. Looking at the SMTP logs on the SharePoint server I can see the traffic on the new port.
Hope this helps! If you're able to get authentication working in step 6, let me know!!