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
  1. Install SMTP, use IIS6 Management to manage.
  2. Go to properties of SMTP Virtual Server.
  3. Access tab > Relay Restrictions: to allow 127.0.0.1 and my IP.
  4. Delivery tab > Outbound Connections: TCP port to 587. Specify your desired port number here.
  5. Delivery tab > Advanced: set masquerade domain to FQDN of mail server, Smart Host to internal server name, no checkboxes selected below.
  6. 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.
  7. After changes are made, restart SMTP Service.
  8. 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!!