🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #186972

Re: slrn and pgp/smime

#186972
From: Troy Piggins
Date: Mon, 26 Jun 2006 18:20
85 lines
4435 bytes
* gregor herrmann wrote:
> On 17 Jun 2006 04:48:44 GMT, Bruno Glint wrote:
>
>> Does anyone know of a macro for slrn that will allow it to verify 
>> pgp/mime and s/mime messages?
>
> I've hacked something together that kind of does the job (it least it
> displays the message):
> http://info.comodo.priv.at/blog/articles/slrn_pgpmime/

I tried your "hack" and doesn't work on this MIME/pgp message from the
comp.mail.misc group:

Message-ID: <cone.1151266682.543995.18735.500@commodore.email-scan.com>

I use Sam's messages to test because he is the only regular in the
groups I visit that use it.  Does it work for you?

Here's my solution.  Requires demime.

#v+
% Put this in your macro file and make sure it's interpretted in .slrnrc
% thanks to Christian Ebert from the slrn-user mailing list.
define demime_pgp ()
{
  variable xcharset = extract_displayed_article_header("Content-Type");
  if (string_match(xcharset,"\\Cmultipart/signed",1))
  {
    variable demime_tmp, raw_art, fp, art_demime;
    variable macro_sig =
               "\n-- \n[demime_pgp macro removed MIME PGP signature]";
    demime_tmp = "/tmp/slrn_demime."+ string (getpid () );
    raw_art = raw_article_as_string ();
    fp = fopen (demime_tmp, "w");
    if (fp == NULL)
      error (_function_name () +": could not open "+demime_tmp);
    fputs (raw_art, fp);
    fclose (fp);
    fp = popen ("/usr/local/bin/demime --quiet - < "+demime_tmp, "r");
    if (fp == NULL)
      error (_function_name () +": demime pipe failed" );
    art_demime = strjoin (fgetslines (fp), "");
    pclose (fp);
    if (art_demime != "") replace_article (art_demime+macro_sig);
    else error (_function_name () +": failed");
    system ("rm "+demime_tmp);
  }
}
() = register_hook ("read_article_hook", "demime_pgp");
#v-

Couple of things I noticed about your script:
- the name of the file you download is actually pl00000.pl, not
  pgp-verify as it should be.  Would make it easier if it downloaded
  correct filename to save rename.
- you mention you need some perl modules.  There are others that seem to
  be needed, and my install of them failed during dependancy install of
  GnuPG::Interface module :

#v+
Failed Test             Stat Wstat Total Fail  Failed  List of Failed
-------------------------------------------------------------------------------
t/clearsign.t                          2    2 100.00%  1-2
t/detach_sign.t                        2    2 100.00%  1-2
t/encrypt.t                            3    3 100.00%  1-3
t/list_secret_keys.t                   4    1  25.00%  2
t/passphrase_handling.t                3    3 100.00%  1-3
t/sign.t                               2    2 100.00%  1-2
t/sign_and_encrypt.t                   2    2 100.00%  1-2
Failed 7/20 test scripts, 65.00% okay. 15/51 subtests failed, 70.59%
okay.
make: *** [test_dynamic] Error 255
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
#v-

The above is probably my setup, as opposed to a problem with your script.  I'd
be interested to hear whether yours works on the mentioned M-ID.

-- 
Troy Piggins :                            "My karma just ran over my dogma"
 ,-o  
o   ) Ubuntu linux 6.06 http://ubuntu.com  RLU#415538 http://counter.li.org
 `-o  uptime: 03:16:18 up 23 days,23 min,2 users,load average:0.01,0.05,0.06
Technical Details
Message-ID: <20060627031618@usenet.piggo.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nntp.waia.asn.au!203.59.27.186.MISMATCH!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
References: <VLFCBKYX38885.0283449074@anonymous.poster> <f18dm3-2fq.ln1@news.comodo.priv.at>

Show Full Headers
Complete Article Headers
Message-ID: <20060627031618@usenet.piggo.com>
Subject: Re: slrn and pgp/smime
Date: Tue, 27 Jun 2006 04:20:05 +1000
From: Troy Piggins <usenet-0606@piggo.com>
References: <VLFCBKYX38885.0283449074@anonymous.poster> <f18dm3-2fq.ln1@news.comodo.priv.at>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.20140922.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nntp.waia.asn.au!203.59.27.186.MISMATCH!newsfeed.iinet.net.au!newsfeed.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsstorage1.iinet.net.au!per-qv1-newsreader-01.iinet.net.au!not-for-mail
Newsgroups: news.software.readers
Reply-To: usenet-0606@piggo.com
User-Agent: slrn/0.9.8.1/rt (Linux)
Lines: 85
NNTP-Posting-Host: 203.206.109.220
X-Trace: 1151346401 per-qv1-newsreader-01.iinet.net.au 6628 203.206.109.220