topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 3, 2024, 3:02 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: email sender rewrite proxy  (Read 2937 times)

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
email sender rewrite proxy
« on: August 17, 2021, 01:50 PM »
Hi folks! I am in need of collective wisdom. I need a band-aid to go between ancient LOB software and M365 email.

The company finally killed off the on premise Exchange and Notes servers. However, with all of the systems running on local servers and sending out emails to both company and external recipients, I had to put in place some proxy servers to gather the messages and relay through 365. This is done using hMailserver with a simple authenticated relay configuration, and sender addresses are all set up with mailbox delegation to the account the proxy server is sending as. Works fine, except...

We have one old system that sends email reports using a very specific sender address. The authors of this software hard coded the sender address using a domain that is currently owned by IBM. And because the relays can only accept sender addresses that are known in the organization, and we cannot define this domain in 365, the emails are rejected.

I have done my due diligence and have changed the offending sender address to an acceptable value, with the same number of characters, everywhere that I could find on this server. Still the bad address gets used. I have spent way too much time looking for where it is coming from, our DBA has dug through the database, still can't find it.

So all that is to explain why I am looking for an email proxy that will allow you to rewrite a sender address. Mail comes in, if it's from address xyz then it gets changed to be from abc, then gets sent on to the "normal" proxy. If the sender is not xyz, then it just gets sent on.

It needs to be something that can run on Windows server, ideally something as simple as hMailserver. I tried to write a rule for hMailserver to do this but was not successful. Volume of messages is low so does not need to be super efficient, just needs to be reliable.

Anyone have any ideas? I have not yet stumbled upon the magical query to make the google give me a good answer...
vi vi vi - editor of the beast

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,913
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: email sender rewrite proxy
« Reply #1 on: August 17, 2021, 03:13 PM »
Interesting.
Does it have to be a full blown smtp proxy server, or can you configure the email sender to use a commandline mail sending tool as its delivery method?

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: email sender rewrite proxy
« Reply #2 on: August 17, 2021, 05:17 PM »
Sadly there is no way to modify the system. And of course the people who set this up have been gone for years. (Isn't that always the case?)

I still have some vague ideas bouncing around in my head, maybe one of them will pan out. But between all the folks who visit DC, we have seen almost everything before.  :D
vi vi vi - editor of the beast

Shades

  • Member
  • Joined in 2006
  • **
  • Posts: 2,939
    • View Profile
    • Donate to Member
Re: email sender rewrite proxy
« Reply #3 on: August 17, 2021, 07:06 PM »
Maybe receive the mail, store it as a file, rewrite the header and use a mail client that you can use within batch/PowerShell scripting? 

A few command line mail clients that might be able to help with this:
- CMail
- SwithMail

Mail relay software might be good for such a purpose too. But I only know of:
- MiniRelay
Which is ancient, not maintained and the creator's website has been off-line for years.

Here are instructions to create an SMTP relay server on IIS, after which you could use Powershell to resend the message with a header that does comply with your current setup.
This set of instructions also seems helpful for your problem.

4wd

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 5,644
    • View Profile
    • Donate to Member
Re: email sender rewrite proxy
« Reply #4 on: August 17, 2021, 08:22 PM »
Anyone have any ideas? I have not yet stumbled upon the magical query to make the google give me a good answer...

This thread sounds like the same problem:
https://www.hmailser....php?f=9&t=32387

With the relevant script at post:
https://www.hmailser....php?t=32387#p202248

Note the post saying to remove var a couple of posts later.

x16wda

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 888
  • what am I doing in this handbasket?
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: email sender rewrite proxy
« Reply #5 on: August 18, 2021, 05:12 PM »
This thread sounds like the same problem:

Thanks - I didn't look deep enough in the support forum! This looks promising.
vi vi vi - editor of the beast