
spf at metro
Nov 20, 2004, 4:04 AM
Post #6 of 27
(7745 views)
Permalink
|
|
Re: [srs-discuss] Help - How to unwind an SRS address?
[In reply to]
|
|
Do also remember that there is no standard or specification of how srs rewritten addresses should look.. The only guarantee someone who implements srs should give is that he himself can reproduce the original sender address.. What you read in the pdf by Shevek is just one way of rewriting addresses, actually it is the one pretty close to what libsrs2 does. In general however, there is no prescribed address format. I think that with the info in the pdf and by studying the implementations (libsrs, libsrs2, Mail::SRS, etc..) you can get a pretty accurate picture of how addresses look like and how to parse them. Instead of =, some other characters are allowed as seperators, and it seems logical to me that these are not allowed in the HHH or TTT fields.. About the field not being 3 characters, this is irrelevant as long as you assume seperator chars are not in there (a safe assumption imho). And even then, with greedy regexps that doesn't matter too much either. Actually, looking at the shevek pdf again, only =, + and - are allowd. = and - are not in base64, so your only problem is with +. AFAIK, SRS0 and SRS1 is all that is used. The number x in SRSx is _not_ a hop counter. It is an enhanced version of the SRS rewriting schemes, that allows for shortcuts instead of stacking multiple SRS0 rewrites on top of each other. So from that perspective it is indeed a version indicator, where there are currently two versions: 0 and 1. I am sorry i don't have the requested regexp readily at hand. But with a bit of work, I think it can be easily figured out from the pdf document and the existing implementations. Kind regards, Koen Martens On Sat, Nov 20, 2004 at 10:25:57PM +1100, Chris Drake wrote: > Hi Koen, > > I just want to extract the original senders email address, not verify > anything at this stage. I know enough to work out that your > simplistic overview is not helpful to me, since I read that "==" might > be "=+" or "=-" depending one something I couldn't fathom, and I've no > idea if SRS2 has more or less "="'s, or if SRS0 has more or less, or > if "HHH" (which is not 3 characters I know, from inspection of SRS > problems I've got already) or TT can contain other funny chars (I'd > guess not "="'s, but I don't want to guess), and I don't know if SRS > can handle existing email addresses starting with "srs0..." or others > containing "=" or if it escapes things or obliterates the original > senders details after a certain number of hops etc etc... hence my > last-resort asking of this question here :-) > > The spec also says that the number after "SRS" is a "Version", but > then seems to change it's mind and use it as a "hop" counter instead, > so how are future versions of SRS going to differentiate themselves, > and if hops exceed 9 does the next digit become "a" or do I expect two > decimals, etc etc etc... > > Kind Regards, > Chris Drake > > Saturday, November 20, 2004, 10:12:11 PM, you wrote: > > KM> Hi, > > KM> There is no regex to do so, since you need to verify the crypthographic > KM> cookie. Without the secret key, you won't be able too. Of course you can > KM> just rewrite it ignoring the cookie, but that isn't something I advice > KM> (depending on the application of course). > > KM> You can use libsrs or libsrs2 or some perl implementation to do reverse > KM> rewrite of an srs address if you know the secret's. > > KM> If you want to ignore the cryptographic cookie, look at > KM> http://www.libsrs2.org/srs/srs.pdf, it clearly states the SRS0 and SRS1 > KM> address format: > > KM> SRS0=HHH=TT=hostname=local-part [at] local-hos > > KM> So the original address is local-part [at] hostnam > > KM> SRS1=HHH=first-forwarder==HHH=TT=hostname=local-part [at] local-hos > > KM> And again, the original address is local-part [at] hostnam > > KM> There ya go, > > KM> Koen > > > KM> On Sat, Nov 20, 2004 at 10:00:17PM +1100, Chris Drake wrote: > >> Hi, > >> > >> Please can someone give me a regex or *simple* instructions on how to > >> reconstruct the real senders email address from an SRS one (pref > >> without installing anything)? > >> > >> And yes - I've looked at the docs, but there's loads and loads of > >> detail - *so* much that I can't figure out easily how to do this with > >> any confidence that it's going to work properly or indefinitely! > >> > >> Many thanks to anyone who can help! > >> > >> Kind Regards, > >> Chris Drake > >> > >> > >> ------- > >> To unsubscribe, change your address, or temporarily deactivate your subscription, > >> please go to > >> http://v2.listbox.com/member/?listname=srs-discuss [at] v2 > > > > > ------- > To unsubscribe, change your address, or temporarily deactivate your subscription, > please go to http://v2.listbox.com/member/?listname=srs-discuss [at] v2 -- K.F.J. Martens, Sonologic, http://www.sonologic.nl/ Networking, embedded systems, unix expertise, artificial intelligence. Public PGP key: http://www.metro.cx/pubkey-gmc.asc Wondering about the funny attachment your mail program can't read? Visit http://www.openpgp.org/ ------- To unsubscribe, change your address, or temporarily deactivate your subscription, please go to http://v2.listbox.com/member/?listname=srs-discuss [at] v2
|