SRS - Relaying bounces coming back into my mail

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

SRS - Relaying bounces coming back into my mail

Post by LesD » 2015-02-26 20:09

I have let someone use my hMS to relay some mail - some 400 business statements.

I have received back a handful of bounces from hMS as the addresses are invalid.

As I understand it, the SRS scheme ensures that the sender is seen to be my mail server so bounces come back to my MTA (hMS) but then hMS should pass it back to the originator.

Here hMS has not actually sent the mail as the recipient address is invalid and hMS is generating the bounce to me rather than the originator.

The To line of the bounce is

Code: Select all

To: SRS0=0nJMEd=DM=mxxx.net=accounts@yyyygroup.org
where the real return path is <accounts@mxxx.net> and my domain is <yyyygroup.org>

Code: Select all

The following recipient(s) could not be reached:

sales@xxxxx.com
   Error Type: SMTP
   Error Description: No mail servers appear to exists for the recipient's address.
   Additional information: Please check that you have not misspelled the recipient's email address.

Tried 31 time(s)
Something I have set up wrong?

Version 5.5.2-B2129

User avatar
SorenR
Senior user
Senior user
Posts: 3562
Joined: 2006-08-21 15:38
Location: Denmark

Re: SRS - Relaying bounces coming back into my mail

Post by SorenR » 2015-02-26 21:37

LesD wrote:I have let someone use my hMS to relay some mail - some 400 business statements.

I have received back a handful of bounces from hMS as the addresses are invalid.

As I understand it, the SRS scheme ensures that the sender is seen to be my mail server so bounces come back to my MTA (hMS) but then hMS should pass it back to the originator.

Here hMS has not actually sent the mail as the recipient address is invalid and hMS is generating the bounce to me rather than the originator.

The To line of the bounce is

Code: Select all

To: SRS0=0nJMEd=DM=mxxx.net=accounts@yyyygroup.org
where the real return path is <accounts@mxxx.net> and my domain is <yyyygroup.org>

Code: Select all

The following recipient(s) could not be reached:

sales@xxxxx.com
   Error Type: SMTP
   Error Description: No mail servers appear to exists for the recipient's address.
   Additional information: Please check that you have not misspelled the recipient's email address.

Tried 31 time(s)
Something I have set up wrong?

Version 5.5.2-B2129
Are you building SRS0 with a script or simply relaying the message from mxxx.net ?

Do you have an account on the mailinglist so you can compare the received mail to this example I found here... https://www.unlocktheinbox.com/resources/srs/

Btw... They don't like Ad-Blockers but it works fine if you ignore it :mrgreen:

Code: Select all

Return-path: <SRS0=R7EK=HP=OrigDomain.com=testforward@FowardingDomain.com>
Envelope-to: OriginalSender@OrigDomain.com
Received: from FowardingDomain.com ([168.144.32.45]:61161 helo=mail.FowardingDomain.com)
          by OrigDomain.com with esmtp (Exim 4.77)
          (envelope-from <SRS0=R7EK=HP=OrigDomain.com=testforward@FowardingDomain.com>)
          for OriginalSender@OrigDomain.com;
Received: from OrigDomain.com (OrigDomain.com [206.214.223.126])
          by mail.FowardingDomain.com with SMTP;
Received: from localhost.localdomain ([127.0.0.1]:55326 helo=webmail.OrigDomain.com)
          by OrigDomain.com with esmtpa (Exim 4.77)
          (envelope-from <OriginalSender@OrigDomain.com>)
          for testforward@FowardingDomain.com;
Subject: Test Forwarding With SRS
From: "Original Sender" <OriginalSender@OrigDomain.com>
To: testforward@FowardingDomain.com
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: SRS - Relaying bounces coming back into my mail

Post by LesD » 2015-02-26 23:13

SorenR wrote:Are you building SRS0 with a script or simply relaying the message from mxxx.net ?
To the best of my knowledge I am doing nothing other than allowing someone to relay.

I assume it is hMS that is generating this SRS string automatically.

I have seen emails that have been successfully relayed and the headers contains a "Return-Path: SRS0=...." line.

The problem seems to me is that hMS should not be sending the bounce to me (the relayer) when it is unable to relay - either it should send the bounce straight back to where the email came from, or if it is using the SRS address then it should interpret it correctly and again send the bounce back to the originator.

This is not an area I am familiar with so I hope the above makes sense.

User avatar
mattg
Moderator
Moderator
Posts: 20781
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SRS - Relaying bounces coming back into my mail

Post by mattg » 2015-02-26 23:29

LesD wrote:I assume it is hMS that is generating this SRS string automatically.
I don't believe that hMailserver has SRS implemented

You can add a vote for it here if you like
viewtopic.php?f=2&t=11698
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3562
Joined: 2006-08-21 15:38
Location: Denmark

Re: SRS - Relaying bounces coming back into my mail

Post by SorenR » 2015-02-26 23:50

LesD wrote:
SorenR wrote:Are you building SRS0 with a script or simply relaying the message from mxxx.net ?
To the best of my knowledge I am doing nothing other than allowing someone to relay.

I assume it is hMS that is generating this SRS string automatically.

I have seen emails that have been successfully relayed and the headers contains a "Return-Path: SRS0=...." line.

The problem seems to me is that hMS should not be sending the bounce to me (the relayer) when it is unable to relay - either it should send the bounce straight back to where the email came from, or if it is using the SRS address then it should interpret it correctly and again send the bounce back to the originator.

This is not an area I am familiar with so I hope the above makes sense.
hMS is not doing any SRS...

I suspect the following is happening...

Marketing Client -> Marketing Mail Server -> ListServer (have distribution list and add SRS0) -> Your Server (YOU are supposed to change SRS0 to SRS1 plus some other stuff) -> Target User

I Googled SRS and nothing much has been done with it over the past many many years, except a CPAN Perl Module... :roll:
I found an 11 year old Win32 lib - which by the way do not compile ...
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: SRS - Relaying bounces coming back into my mail

Post by LesD » 2015-02-27 09:46

Thank you both for confirming that hMS is not altering the return-path line.

The conclusion must be that it is the sending software that is doing it.

Let me explain what is happening - maybe that will give someone a clue.

The emails are coming from a client of ours, using our business package. The package contains a 'bulk-email' option allowing the package to send out correspondence to suppliers and the like. This option is provided via a third party dll for which we have purchased a license. This dll is doing the actual SMTP sending. I'm waiting to hear from our developers as to the details of this dll.

Normally, our clients enter the details of their mail service provider's MTA and that is it. This client has switched to MS Office 365 and as of yet they can't send out via that route, so we have set them up to use our hMS as the relay.

The conclusion must be that the dll is building this SRS return-path. I do not understand that as surely it should be the receiving MTA that should be doing it.

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: SRS - Relaying bounces coming back into my mail

Post by LesD » 2015-02-27 16:13

I have been told that

"we are using CDO class - its part of Windows"

User avatar
SorenR
Senior user
Senior user
Posts: 3562
Joined: 2006-08-21 15:38
Location: Denmark

Re: SRS - Relaying bounces coming back into my mail

Post by SorenR » 2015-02-27 19:39

LesD wrote:I have been told that

"we are using CDO class - its part of Windows"
Problem is that for SRS to be a sucess, then EVERY MTA on the Internet must support it :roll:

If you look at this http://www.openspf.org/SRS then you are regarded as the "third forwarder" and should change SRS0 to SRS1 etc...

SRS as I see it is simply a "backtrack" method of returning mail and from the "Reply-To" address you are able to find the previous server... The original server is the only one adding a hash value (to verify mail) and also the time value that tell you how long the email is valid.
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

User avatar
mattg
Moderator
Moderator
Posts: 20781
Joined: 2007-06-14 05:12
Location: 'The Outback' Australia

Re: SRS - Relaying bounces coming back into my mail

Post by mattg » 2015-02-28 01:33

So easier to remove all SRS headers??
Just 'cause I link to a page and say little else doesn't mean I am not being nice.
https://www.hmailserver.com/documentation

User avatar
SorenR
Senior user
Senior user
Posts: 3562
Joined: 2006-08-21 15:38
Location: Denmark

Re: SRS - Relaying bounces coming back into my mail

Post by SorenR » 2015-02-28 02:31

I believe the SRS info is flawed to begin with with...

Image
Image

The thing here is that the email is not "forwarded", it is "relayed"... And the SRS info is added BEFORE it is relayed - on behalf of the relayer.

In the ideal world the string "SRS0=0nJMEd=DM=mxxx.net=accounts@yyyygroup.org" should be built by the relay (forwarder).

Anyways. I think the fix to this problem is to script a function that looks at return path and simply relays the NDR back to accounts@mxxx.net with the original SRS0 intact.
SørenR.

“With age comes wisdom, but sometimes age comes alone.”
- Oscar Wilde

LesD
Senior user
Senior user
Posts: 343
Joined: 2009-01-15 20:22
Location: London, UK.

Re: SRS - Relaying bounces coming back into my mail

Post by LesD » 2015-03-01 01:54

SorenR wrote:Anyways. I think the fix to this problem is to script a function that looks at return path and simply relays the NDR back to accounts@mxxx.net with the original SRS0 intact.
Having looked again at the logs carefully, I now understand that the return-path is coming direct from the MS dll that we are using to send the mail.

I'm sure that our software is not building the return path explicitly. It is the dll that is deciding to build the SRS string.

When SMTP conversation starts, my hMS responds with a 220 containing my mail server's domain which differs from the domain that the email is coming from and therefore the dll has decided to generate the SRS address. That is my guess.

According to my understanding (based on what you wrote) it should really be the relaying mta doing the SRS build but ....

Maybe there is an option to turn off SRC in the dll. I will get my developers to investigate.

Post Reply