1994-09-22 - anonymous poster software

Header Data

From: khijol!erc@apple.com (Ed Carp [Sysadmin])
To: cypherpunks@toad.com
Message Hash: 9a1aca24d483a4b5414c16adce96a1249cc625774129f8ef9f26688439df0d66
Message ID: <m0qnhjk-0004G1C@khijol.uucp>
Reply To: N/A
UTC Datetime: 1994-09-22 08:06:26 UTC
Raw Date: Thu, 22 Sep 94 01:06:26 PDT

Raw message

From: khijol!erc@apple.com (Ed Carp [Sysadmin])
Date: Thu, 22 Sep 94 01:06:26 PDT
To: cypherpunks@toad.com
Subject: anonymous poster software
Message-ID: <m0qnhjk-0004G1C@khijol.uucp>
MIME-Version: 1.0
Content-Type: text


-----BEGIN PGP SIGNED MESSAGE-----

I hacked this up in a little under an hour (with distractions), so it's not
the absolute best software - it could stand some improvement - but it works.
It could, with very minor hacking, do as an anonymous mailer.  I wrote it
in response to someone asking me if I could write such a thing for them in
C.  Yes, there are lots of itty-bitty remailers and posters out there, but
this serves the bill for being totally anonymous and it's pretty quick, being
written in C.

Besides, I didn't want to learn perl or any of that grotesque stuff - I'm a
purist at heart ;)
- ---------------------------------- cut here --------------------------------
/*
 * anonpost - strip headers from incoming message, preserving Subject:, then
 * pass the rest of stdin to inews argv[].
 * 
 * Copyright 1994 by Ed Carp (ecarp@netcom.com).  All rights reserved.
 */

/*
 * How to set this up:
 * 
 * 0. Change "#define INEWS" and "#define SIG"
 *
 * 1. cc -s -o anonpost anonpost.c -O
 * 
 * 2. mv anonpost /usr/local/bin  # or wherever
 * 
 * 3. echo "* * * * * su <whoever> -c '/usr/local/bin/anonpost -n alt.sexual.abuse.recovery -f anonasar@khijol.UUCP -r anonasar@khijol.UUCP < /usr/spool/mail/anonasar;rm /usr/spool/mail/anonasar'" >> /usr/lib/crontab
 * 
 */
#define INEWS "/usr/lib/news/inews "
#define SIG "/home/anon-asar/.signature"
#include <stdio.h>
#undef NULL
#define NULL (0)
main (argc, argv)
int argc;
char **argv;
{
  char inews[1024];
  char subject[128];
  char line[1024];
  FILE *in, *p;
  int i;

  *subject = NULL;
  while (1)
  {
/*
 * read header 
 */
    while (fgets (line, 1022, stdin) != (char *) NULL)
    {
      line[strlen (line) - 1] = NULL;
      if (strlen (line) < 2)
	break;
      if (strncmp (line, "Subject: ", 9) == 0)
	strcpy (subject, line + 9);
    }
    if (*subject == NULL)
      strcpy (subject, "<no subject>");
    strcpy (inews, INEWS);
    for (i = 1; i < argc; i++)
    {
      strcat (inews, argv[i]);
      strcat (inews, " ");
    }
    strcat (inews, "-t '");
    strcat (inews, subject);
    strcat (inews, "'");
    if ((p = popen (inews, "w")) == (FILE *) NULL)
    {
      perror (INEWS);
      exit (1);
    }
/*
 * read the rest of the article, passing it to inews 
 */
    while (fgets (line, 1022, stdin) != (char *) NULL)
    {
      line[strlen (line) - 1] = NULL;
      if ((strcmp (line, "--") == 0) || (strcmp (line, "-- ") == 0))
      {
	while (fgets (line, 1022, stdin) != (char *) NULL)
	  if (strncmp (line, "From", 4) == 0)
	  {
	    *subject = NULL;
	    break;
	  }
      }
      if (strncmp (line, "From", 4) == 0)
      {
	*subject = NULL;
	break;
      }
      fprintf (p, "%s\n", line);
    }
/*
 * append the .signature file in the current directory 
 */
    if ((in = fopen (SIG, "r")) != (FILE *) NULL)
    {
      fprintf (p, "--\n");
      while (fgets (line, 1022, in) != (char *) NULL)
	fprintf (p, "%s", line);
      fclose (in);
    }
/*
 * post 
 */
    pclose (p);
/*
 * make sure we didn't get an EOF 
 */
    if (*subject != NULL)
      break;
  }
}
- -- 
Ed Carp, N7EKG    			Ed.Carp@linux.org, ecarp@netcom.com

Finger ecarp@netcom.com for PGP 2.5 public key		an88744@anon.penet.fi
                       ** PGP encrypted email preferred! **

"What's the use of distant travel if only to discover - you're homeless in
your heart."  --Basia, "Yearning"

-----BEGIN PGP SIGNATURE-----
Version: 2.6

iQCVAwUBLoEldCS9AwzY9LDxAQFEDgP/a0OeUQ//m7KO1dUZhLb3wlI4IzYl70JR
PcYL/x2nf+XaskdrWN0YqXqeeV6jaPk7e1xOT/bvKgYs1MADuaUgEgcd0XynYvOl
wOFYAxYN+qWi8+rC0DTxUSysOYGUH3hgMyaN5/dqCINC8pOYIz5iO+BEQC8yN9U3
H1GMiexO04w=
=371T
-----END PGP SIGNATURE-----




Thread