2
SmarterMail - forwarding headers (was SRS "secret")
Question asked by Sébastien Riccio - 4/5/2020 at 2:51 AM
Unanswered
Hello Smartertools,

I am actually coding some plugins for our outgoing gateway (based on Haraka, a node.js based MTA).

Our SmarterMail sends forwards using the SRS mechanism and I need our gateway to be able to reverse the SRS encoded from.

However for this it need a "secret" the same used as when the SRS string has been generated by SM.

Question: Is this secret configurable (it should be!)  or is it hardcoded (it should not) ?

We really need to be able to set our own secret so we can reverse the SRS string on the gateway.
(Not sure, but maybe maxAge also need to match.)

Example code to reverse the SRS using the JS lib:


import { SRS } from 'sender-rewriting-scheme';
 
const srs = new SRS({
  separator: '=', // default
  secret: 'test1', // required
  maxAge: 30 // default
});
 
srs.forward('user@example.com', 'forward.com');
// SRS0=5884=RN=example.com=user@forward.com
 
srs.reverse('SRS0=5884=RN=example.com=user@forward.com');
// user@example.com

EDIT: We need this to know (on the gateway) if the mail was an automatic forward and from which account to which recipient.

Another way would be that SmarterMail adds headers when processing an automatic forwarding, like for example gmail does:

X-Forwarded-To: <recipient@domain.com>
X-Forwarded-For: someaccount@gmail.com recipient@domain.com
I currently see no other way to know if the mail was an automatic forward from SM

EDIT: I was wrong about SRS, it can't be reversed to know which local account did the forward, the X-* headers seems to be the best solution for this.
Sébastien Riccio
System & Network Admin

Reply to Thread