[Users] Rewrite URLs in message obfuscated by Outlook's safelinks stuff

H.Merijn Brand linux at tux.freedom.nl
Tue Mar 19 13:13:48 UTC 2024


On Tue, 19 Mar 2024 08:42:41 -0400, George Avrunin <avrunin at comcast.net> wrote:

> On Mon, 18 Mar 2024 23:22:33 +0100
> "H.Merijn Brand" <linux at tux.freedom.nl> wrote:
> 
> > I wholeheartedly agree to everything you complain about this insane
> > "security" feature!
> > 
> > My rm_disclaim.pl (perl) script revoves that junk with
> > 
> > --8<---
> > use URL::Encode::XS qw( url_encode url_decode );
> > 
> > # And useless, irritating and obfuscating wrapping of URL's
> > s{\bhttps://[\w.]+\.safelinks\.protection\.outlook\.com/\?url=(.*?)(?:&|&)data=\S+?(?:&|&)reserved=\d+\b}
> >   {url_decode ($1)}ge;  
> > -->8---    
> > 
> > as part of a bigger cleanup, where company logo's, useless HTML
> > attachments, disclaimers and print warnngs are removed and telephone
> > numbers are consistemtly formatted.
> > 
> > Feel free to steal that snippet when you choose to use perl.  
> 
> Thanks!  I haven't done any perl programming since the late 1990s, I
> think, but ... 😉

Late 90's is perl-5.005. A lot has happened since :)
Perl is very much alive. Most recent version is 5.38.2 and 5.40 is
luring around the corner. Chance is that your old perl scripts will
still run on 5.38. Maybe get a few warnings.

> May I ask how your rm_disclaim.pl script is applied?  Do you do this in
> claws-mail, e.g., through an action or something, or is it part of the
> process of receiving mail, or what?

Yes, with an action

 Menu name [ Remove Disclaimer                    ]
 Command   [ /home/merijn/bin/rm_disclaim.pl %f   ]
 (*) Shell command   ( ) filter action

Key binding Shift-Ctrl-D

>   George

-- 
H.Merijn Brand  https://tux.nl   Perl Monger   http://amsterdam.pm.org/
using perl5.00307 .. 5.37        porting perl5 on HP-UX, AIX, and Linux
https://tux.nl/email.html http://qa.perl.org https://www.test-smoke.org
                           
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.claws-mail.org/pipermail/users/attachments/20240319/032641ff/attachment.sig>


More information about the Users mailing list