% $Id: t-prot.sl,v 1.2 2003/06/15 22:53:26 jochen Exp $ % % This file implements articles to be filtered through t-prot before % displayed. They are still filtered if you reply to such a message, % so there might be some need of a nice way to disable and enable this % interactively. Feel free to write some code and submit it to me to % get it included into the t-prot package. % % Activate this by adding "interpret t-prot.sl" to your ~/.slrnrc. define read_article_hook () { variable art, f1, f2, fname, line; art = ""; % Keep in mind that the path should NOT be readable to other users -- % otherwise it might reveal information on what you read, and probably % even be a security hole: f1 = popen ("mktemp -q $HOME/.tmp/slrn/t-prot.sl.XXXXXX | tr -d '\n'", "r"); if (f1 == NULL) return; if (-1 == fgets (&fname, f1)) return; pclose (f1); %pipe_article ("t-prot -aceklmtS --diff --bigq -L$HOME/.mutt/mlfooters -A$HOME/.mutt/adfooters > "+fname); pipe_article ("t-prot -aceklmtS --diff --bigq > "+fname); f2 = fopen (fname, "r"); if (f2 == NULL) error (fname+" could not be opened."); while (-1 != fgets (&line, f2)) { art = art + line; } fclose (f2); % The removal of the tmp file should be made a little more reliable. % Any ideas? system ("rm -f "+fname); replace_article (art); }