RE: Help - How to unwind an SRS address?
Mark <[email protected]> Sat, 20 Nov 2004 16:01:28 GMT
| Newsgroups | gmane.mail.spam.srs.general |
|---|---|
| Organization | Asarian-host |
| Message-ID | <[email protected]> |
Chris, Having had extensive dealings with SRS over the last year, allow me to set the record straight on a few things. Roger Moser wrote: > > SRS0 addresses have the form: SRS0=opaque-part@domain-part > > where opaque-part may be defined by the SRS0 forwarder, and may only > > be interpreted by this same host. > > So it is not possible to reconstruct the original email address. Quite untrue. The 'opaque' part only refers to the hash. SRS0 addresses are in the form of: [email protected] In actuality, the srs.pdf as libsrs2.org says: "SRS0=HHH=TT=hostname=local-part@LOCAL-PART" (capitalization mine); which I'm sure is a typo. :) Consider the following rewrite: Input: [email protected] Output: [email protected] As you can see, the original address can be trivially extracted. Chris Drake wrote: > 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, It all sounds quite daunting; and this is compounded, I'm sure, by the fact that some older docs of SRS still float about the net. Still, finding a regex for SRS addresses is quite easy. In fact, I use such a regex myself, in the 'reverse' call of SRS.pm: sub reverse { my ($self, $address) = @_; $address =~ s/[<>]//g; if ($address =~ /^SRS0[+-=]\S+=\S{2}=\S+=\S+\@\S+$/i) { } elsif ($address =~ /^SRS1[+-=]\S+=\S+==\S+=\S{2}=\S+\@\S+$/i) { } else { return undef; } Mind you, my added address-test is NOT part of the distributed SRS.pm; I just added it myself, at some point, to have an early-out for non-SRS addresses, and to ensure the return of 'undef' in those cases. Koen Martens wrote: > 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 Stacked SRS0 rewrites are no longer allowed/possible. Each SRS0 address you rewrite, will automatically become a SRS1 address: [email protected] SRS1=CaygymUx=asarian-host.net==5QqmApog=OG=isp.nl=tester@asarian-host.net As you can see, Chris, the original address can still be easily distilled. Also, to take away another of your confusions, the double "==" only occurs on SRS1 addresses. Although only Shevek can make a statement like this with absolute authority, the SRS protocol is pretty much fixed, and is likely to remain unchanged. Cheers, - Mark System Administrator Asarian-host.org --- "If you were supposed to understand it, we wouldn't call it code." - FedEx