home *** CD-ROM | disk | FTP | other *** search
/ The Hacker's Encyclopedia 1998 / hackers_encyclopedia.iso / hacking / internet / remail.10 < prev    next >
Encoding:
Text File  |  2003-06-11  |  37.2 KB  |  1,314 lines

  1. ─ ALT.2600.MODERATED (1:340/26) ─────────────────────────── ALT.2600.MODERATED ─
  2.  Msg  : 15 of 15                                                                
  3.  From : Graham Bullers              1:340/13                05 Jan 97  23:12:38 
  4.  To   : All                                                 07 Jan 97  14:02:48 
  5.  Subj : REMAIL                                                                  
  6. ────────────────────────────────────────────────────────────────────────────────
  7. From: ab756@torfree.net (Graham Bullers)
  8. .RFC-Message-ID: <E3Ks13.549.0.bloor@torfree.net>
  9. .RFC-X-Newsreader: TIN [version 1.2 PL2]
  10. .RFC-Approved: ab756@freenet.toronto.on.ca
  11. .RFC-Path:
  12. news.spydernet.com!news.pinc.com!news.bctel.net!noc.van.hookup.net!nic.win.hooku
  13. p.net!vertex.tor.hookup.net!hookup!news.nstn.ca!news.dal.ca!torn!newsfeeder.toro
  14. nto.ican.net!torfree!ab756
  15.  
  16.  
  17.  
  18.  
  19. __________________________________
  20. REAME.build-remailer
  21. __________________________________
  22.  
  23. This is the 10 second remailer package. The idea is from Sameer, and the
  24. C source is from Matt Ghio. This script will install a bare-bones
  25. cypherpunk style remailer on your shell account.  Making it work is simple:
  26.  
  27. 1) Type:      chmod 700 build-remailer
  28.  
  29. 2) Type:      build-remailer
  30.  
  31. 3) Enter the email address of the remailer. This is optional. You may use
  32.    any address you like, or you may enter none at all. If you don't enter an
  33.    email address here the address "nobody@foo.com" will appear in all
  34.    outbound mail from the mailer, and also in the mailers help files.
  35.  
  36. 4) If no errors are generated, then your all set. Send some mail to
  37.    yourself to test that it is working. Refer to the remailers help file
  38.    for details.
  39.  
  40.  
  41. ___________________________
  42. build-remailer
  43. ---------------------------
  44.  
  45. ----CUT HERE----CUT HERE----CUT HERE----CUT HERE----CUT HERE----
  46.  
  47. echo "Warning: This will DESTROY your existing .forward file."
  48. echo "Type CTRL-C Now To Abort. I'll wait 10 Seconds For You."
  49. sleep 10s
  50. echo "Ok, here we go."
  51. echo -e "\n"
  52. echo "Getting Variables:"
  53. xspool=$MAIL
  54. echo "Found Mailspool as: $xspool"
  55. xsendmail=`which sendmail`
  56. echo "Found Sendmail as: $xsendmail"
  57. xls=`which ls`
  58. echo "Found ls as: $xls"
  59. xdir=$HOME/.mailx
  60. echo "Installing in: $xdir"
  61. mkdir $xdir
  62. echo "Enter the email address of the mailer now."
  63. echo "You can leave this blank if you want."
  64. read xaddr
  65. if [ `echo $xaddr | wc -w` -eq 0 ]
  66. then
  67. xaddr="nobody@nowhere.com"
  68. fi
  69. cd $xdir
  70.  
  71. > remailer.c
  72.  
  73. echo "Building C Source."
  74. echo "
  75. #define DIR \"$xdir\"
  76. #define ANONFROM \"From: $xaddr (Anonymous)\\n\"
  77. #define REMAILERFROM \"From: $xaddr (Remailer)\\n\"
  78. #define REMAILERADDRESS \"$xaddr\"
  79. #define RETURN \"xaddr\"
  80. #define DISCLAIMER \"Comments: Please report misuse of this automated remailing
  81. service to <$xaddr>\\n\"
  82. #define NONANONDISC \"Comments: This message was forwarded by an automated remai
  83. ling service.  No attempt was made to verify the sender's identity.  Please repo
  84. rt misuse to <$xaddr>\\n\"
  85. #define SPOOL \"$xspool\"
  86. #define SPAM_THRESHOLD 25
  87. #define WAIT_SEC 30
  88. #define DEFAULT_LATENCY 0
  89.  
  90. #define PGP \"/usr/local/bin/pgp\"
  91. #define PGPPASS \"password\"
  92. #define PGPPATH DIR
  93. #define INEWS \"/usr/lib/news/inews\"
  94. #define NNTPSERVER \"127.0.0.1\"
  95. #define LS \"$xls\"
  96. #define SENDMAIL \"$xsendmail\"
  97.  
  98. #define BLOCKFROM \"source.block\"
  99. #define BLOCKTO \"dest.block\"
  100. #define INQUEUE \"in.queue\"
  101. #define OUTQUEUE \"out.queue\"
  102. #define TEMPDIR \"temp\"
  103. #define HELPFILE \"remailer-help\"
  104. #define STATSDATA \"statsdata\"
  105.  
  106. #include <stdio.h>
  107. #include <stdlib.h>
  108. #include <signal.h>
  109. #include <time.h>
  110. #include <sys/time.h> /* some os need this one also */
  111. /*File io stuff:*/
  112. #include <sys/types.h>
  113. #include <sys/stat.h>
  114. #include <fcntl.h>
  115.  
  116.  
  117. FILE *infile;
  118. FILE *outfile;
  119. FILE *tempfile;
  120. FILE *file2;
  121. char from[256]=\"\";
  122. char from_address[256]=\"\";
  123. char cutmarks[256]=\"\";
  124. int anon_flag=0;
  125. int help_flag=0;
  126. int stat_flag=0;
  127. int pgp_flag=0;
  128. char replykey[80]=\"\";
  129. char idbuf[17];
  130. int idcount=0;
  131. struct timeval tp;
  132. unsigned long latime;
  133. int blockflag;
  134.  
  135. void getfrom(char *input){
  136.   int x=0,y=0;
  137.   while(input[x]!=':'){x=x+1;}
  138.   x=x+1;
  139.   while(input[x]<=32){x=x+1;}
  140.   while(input[x]>32){
  141.     from_address[y]=input[x];
  142.     x=x+1;y=y+1;
  143.   }
  144.   from_address[y]=0;
  145.   x=0; /* look for <address> */
  146.   while(input[x]>31&&input[x]!='<'){x=x+1;}
  147.   if(input[x]=='<'){
  148.     y=0;x=x+1;
  149.     while(input[x]>32&&input[x]!='>'){
  150.       from_address[y]=input[x];
  151.       x=x+1;y=y+1;
  152.     }
  153.     from_address[y]=0;
  154.   }
  155. }
  156.  
  157. void block_addr(char address[],char *file) {
  158.   char input[256];
  159.   int match=0;
  160.   int x,y,z;
  161.   int exclude;
  162.  
  163.   FILE *killfile;
  164.  
  165.   chdir(DIR);
  166.   if(killfile=fopen(file,\"r\")){
  167.     while(fscanf(killfile,\"%s\",input)>0) {
  168.       if (input[0]!='#'&&input[0]>32) {
  169.         x=0;exclude=0;z=0;
  170.         if (input[0]=='!') {exclude=1;z++;}
  171.         while(address[x]!=0) {
  172.           y=0;
  173.           while ((address[x+y]|32)==(input[y+z]|32)&&input[y+z]!='*'
  174.               &&input[y+z]!=0&&address[x+y]!=0) {
  175.             y++;
  176.           }
  177.           if (input[y+z]==0) match=(1^exclude);
  178.           if (input[y+z]=='*') {z=z+y+1;x=x+y;}
  179.           else x++;
  180.         }
  181.       }
  182.     }
  183.     fclose(killfile);
  184.   }
  185.   if (match==1) address[0]=0;
  186. }
  187.  
  188. int search(char str1[],char str2[]) {
  189.   int x=0;
  190.   int y=0;
  191.   int match=0;
  192.  
  193.   while(str2[x]!=0) {
  194.     y=0;
  195.     while ((str2[x+y]==str1[y]||str2[x+y]==(str1[y]-32))&&str2[x+y]!=0) {
  196.       y++;
  197.       if (str1[y]==0) match=1;
  198.     }
  199.     x++;
  200.   }
  201.   return(match);
  202. }
  203.  
  204. void scanline(char input[],char resend_address[]) {
  205.   int x,y,z;
  206.   int resend_flag=0;
  207.   int cutmarks_flag=0;
  208.   int post_flag=0;
  209.   int latent_plusflag;
  210.   int latent_randflag;
  211.   int latent_h;
  212.   int latent_m;
  213.   int latent_s;
  214.  
  215.   /* Pass thru Subject, Content-Type, and In-Reply-To lines */
  216.   if ((input[0]=='S'||input[0]=='s')&&input[1]=='u'&&input[2]=='b') {
  217.      /* if the subject line is blank, drop it */
  218.     if (input[8]!=0&&input[9]!=0) fprintf(outfile,\"%s\",input);
  219.      /* and handle special case subjects for help and stats */
  220.     if (search(\"remailer-stat\",input)) {
  221.       latime=tp.tv_sec; /* No latency */
  222.       stat_flag=1;
  223.     }
  224.     if (search(\"remailer-help\",input)||search(\"remailer-info\",input)) {
  225.       latime=tp.tv_sec; /* No latency */
  226.       help_flag=1;
  227.     }
  228.   }
  229.   if ((input[0]=='C'||input[0]=='c')&&input[1]=='o'&&input[2]=='n') {
  230.     fprintf(outfile,\"%s\",input);
  231.   }
  232.   if ((input[0]=='I'||input[0]=='i')&&input[1]=='n'&&input[2]=='-') {
  233.     fprintf(outfile,\"%s\",input);
  234.   }
  235.  
  236.   /* Save the from line in case non-anonymous posting is requested */
  237.   if ((input[0]=='F'||input[0]=='f')&&input[1]=='r'&&input[2]=='o') {
  238.     getfrom(input);block_addr(from_address,BLOCKFROM);
  239.     if(from_address[0]==0) blockflag=1; /* Source block */
  240.     block_addr(input,BLOCKTO);
  241.     strcpy(from,input);
  242.   }
  243.  
  244. /* Fuzzy Match headers */
  245.   x=0;
  246.   /* Remail-To? */
  247.   while (input[x]!=0&&(input[x]!=32||x<=2)&&input[x]!=10&&x<256) {
  248.     if (input[x]=='R'||input[x]=='r') {
  249.       while (input[x]!=0&&input[x]!=32&&input[x]!=10&&x<256) {
  250.         if (input[x]=='M'||input[x]=='m') {
  251.           while (input[x]!=0&&input[x]!=10&&x<256) {
  252.             if ((input[x]=='T'||input[x]=='t') &&
  253.               (input[x+1]=='O'||input[x+1]=='o')) {
  254.               while (input[x]!=0&&input[x]!=':'&&input[x]!=32
  255.                      &&input[x]!=10&&x<256) x++;
  256.               if (input[x]==':') {
  257.                 resend_flag=1;
  258.                 anon_flag=1;
  259.                 x=256;
  260.               }
  261.             } else x++;
  262.           }
  263.         } else x++;
  264.       }
  265.     } else x++;
  266.   }
  267.  
  268.   /* Anon-To? */
  269.   x=0;
  270.   while (input[x]!=0&&(input[x]!=32||x<=2)&&input[x]!=10&&x<256) {
  271.     if (input[x]=='A'||input[x]=='a') { x++;
  272.       if (input[x]=='N'||input[x]=='n') {
  273.         while (input[x]!=0&&input[x]!=10&&x<256) {
  274.           if ((input[x]=='T'||input[x]=='t') &&
  275.               (input[x+1]=='O'||input[x+1]=='o')) {
  276.             while (input[x]!=0&&input[x]!=':'&&input[x]!=32
  277.                    &&input[x]!=10&&x<256) x++;
  278.             if (input[x]==':') {
  279.               resend_flag=1;
  280.               anon_flag=1;
  281.             }
  282.             x=256;
  283.           } else x++;
  284.         }
  285.       }
  286.     } else x++;
  287.   }
  288.  
  289.   /* Post? */
  290.   x=0;
  291.   while (input[x]!=0&&input[x]!=32&&input[x]!=10&&x<256) {
  292.     if (input[x]=='P'||input[x]=='p') { x++;
  293.       if (input[x]=='O'||input[x]=='o') { x++;
  294.         if (input[x]=='S'||input[x]=='s') {
  295.           post_flag=1;
  296.           /* Post-To ? */
  297.           while (input[x]!=0&&input[x]!=32&&input[x]!=10&&x<256) {
  298.             if (input[x]=='T'||input[x]=='t') { x++;
  299.               if (input[x]=='O'||input[x]=='o') { x++;
  300.                 if (input[x]==':') {
  301.                   resend_flag=1;
  302.                 }
  303.               }
  304.             } else x++;
  305.           }
  306.           x=256;
  307.         }
  308.       }
  309.     } else x++;
  310.   }
  311.  
  312.   /* soda.berkeley style Send-To ? */
  313.   x=0;
  314.   while (input[x]!=0&&input[x]!=32&&input[x]!=10&&x<256) {
  315.     if (input[x]=='S'||input[x]=='s') { x++;
  316.       if (input[x]=='E'||input[x]=='e') { x++;
  317.         if (input[x]=='N'||input[x]=='n') { x++;
  318.           if (input[x]=='D'||input[x]=='d') {
  319.             while (input[x]!=0&&input[x]!=32&&input[x]!=10&&x<256) {
  320.               if (input[x]=='T'||input[x]=='t') { x++;
  321.                 if (input[x]=='O'||input[x]=='o') { x++;
  322.                   if (input[x]==':') resend_flag=1;
  323.                 }
  324.               } else x++;
  325.             }
  326.           }
  327.         }
  328.       }
  329.     } else x++;
  330.   }
  331.  
  332. /* Check for PGP...   I got a little sloppy here...ohwell*/
  333.   if(input[0]=='E'&&input[1]=='n'&&input[2]=='c'
  334.      &&input[3]=='r'&&input[4]=='y'&&input[5]=='p'
  335.      &&input[6]=='t'&&input[7]=='e'&&input[8]=='d') {
  336.     resend_flag=0;
  337.     pgp_flag=1;
  338.   }
  339.   if(input[0]=='E'&&input[1]=='n'&&input[2]=='c'
  340.      &&input[3]=='r'&&input[4]=='y'&&input[5]=='p'
  341.      &&input[6]=='t'&&input[7]=='-') {
  342.     x=0;y=0;
  343.     while(input[x]!=':'){x=x+1;}
  344.     x=x+1;
  345.     if(input[x]==32){x=x+1;}
  346.     z=x;
  347.     while(input[x]>32){
  348.       replykey[y]=input[x];
  349.       x=x+1;y=y+1;
  350.     }
  351.     replykey[y]=0;
  352.  
  353.   }
  354.   if(input[0]=='C'&&input[1]=='u'&&input[2]=='t') {
  355.     cutmarks_flag=1;
  356.   }
  357.  
  358.   if(resend_flag){
  359.     x=2;y=0; /* x=2 in case Extropians-style ::Header */
  360.     while(input[x]!=':'){x=x+1;}
  361.     x=x+1;
  362.     while(input[x]<=32){x=x+1;}
  363.     z=x;
  364.     if (post_flag==0) {
  365.       while(input[x]>32){
  366.         resend_address[y]=input[x];
  367.         x=x+1;y=y+1;
  368.       }
  369.       resend_address[y]=0;
  370.       x=0; /* look for <address> */
  371.       while(input[x]>31&&input[x]!='<'){x=x+1;}
  372.       if(input[x]=='<'){
  373.         y=0;x=x+1;
  374.         while(input[x]>32&&input[x]!='>'){
  375.           resend_address[y]=input[x];
  376.           x=x+1;y=y+1;
  377.         }
  378.         resend_address[y]=0;
  379.       }
  380.       /* Print out new To: line */
  381.       fprintf(outfile,\"To: \");
  382.       while(input[z]>0){
  383.         fprintf(outfile,\"%c\",input[z]);
  384.         z=z+1;
  385.       }
  386.       block_addr(resend_address,BLOCKTO);
  387.     }
  388.     if (post_flag) {
  389.       fprintf(outfile,\"Newsgroups: \");
  390.       while(input[z]>0){
  391.         fprintf(outfile,\"%c\",input[z]);
  392.         z=z+1;
  393.       }
  394.       resend_address[0]='p';
  395.       resend_address[1]='o';
  396.       resend_address[2]='s';
  397.       resend_address[3]='t';
  398.       resend_address[4]=0;
  399.       block_addr(input,BLOCKTO);if (input[0]==0) resend_address[0]=0;
  400.     }
  401.   }
  402.  
  403.   if(cutmarks_flag){
  404.     x=0;y=0;
  405.     while(input[x]!=':'){x=x+1;}
  406.     x=x+1;
  407.     if(input[x]==32){x=x+1;}
  408.     z=x;
  409.     while(input[x]>32){
  410.       cutmarks[y]=input[x];
  411.       x=x+1;y=y+1;
  412.     }
  413.     cutmarks[y]=0;
  414.   }
  415.  
  416.   if((input[0]|32)=='l'&&(input[1]|32)=='a'&&(input[2]|32)=='t') {
  417.     x=0;
  418.     while(input[x]!=':'){x=x+1;}
  419.     x=x+1;
  420.     if(input[x]==32){x=x+1;}
  421.  
  422.     latent_plusflag=0;latent_randflag=0;
  423.     latent_h=0;latent_m=0;latent_s=0;
  424.  
  425.     while((input[x]<'0'||input[x]>'9')&&input[x]>=32) {
  426.       if (input[x]=='+') latent_plusflag=1;
  427.       if ((input[x]=='r')||(input[x]=='R')) latent_randflag=1;
  428.       x++;
  429.     }
  430.     while (input[x]>='0'&&input[x]<='9') {
  431.       latent_h=(latent_h*10)+(input[x]-48);
  432.       x++;
  433.     }
  434.     if(input[x]==':') {
  435.       x++;
  436.       while (input[x]>='0'&&input[x]<='9') {
  437.         latent_m=(latent_m*10)+(input[x]-48);
  438.         x++;
  439.       }
  440.       if(input[x]==':') {
  441.         x++;
  442.         while (input[x]>='0'&&input[x]<='9') {
  443.           latent_s=(latent_s*10)+(input[x]-48);
  444.           x++;
  445.         }
  446.       }
  447.     }
  448.     while(input[x]>=32) {
  449.       if (input[x]=='+') latent_plusflag=1;
  450.       if ((input[x]=='r')||(input[x]=='R')) latent_randflag=1;
  451.       x++;
  452.     }
  453.  
  454.     latime=(latent_h*3600+latent_m*60+latent_s);
  455.  
  456.     if(latent_plusflag==0) {
  457.       /* Not Supported - Is this really necessary? */
  458.     }
  459.  
  460.     if(latent_randflag&&(latime>1)) {
  461.       /* Simple randomizer */
  462.       latime=abs((tp.tv_sec^latime)+tp.tv_usec+(getpid()*latime))%(latime+1);
  463.     }
  464.  
  465.     latime+=tp.tv_sec;
  466.   }
  467. }
  468.  
  469. char* genid() { /* Generate ascii id from process id and time with shuffle */
  470.   unsigned long int id1,id2;
  471.   int x=0;
  472.  
  473.   id1=getpid()|(idcount<<16);
  474.   id2=tp.tv_sec;
  475.   idcount++;
  476.  
  477.   for(x=32;x--;){
  478.     id1+=1234567890;
  479.     id1^=0xABCDEF12;
  480.     id1=(id1<<1)|(id1>>31);
  481.     id2^=id1;
  482.     id2+=0x12345678;
  483.     id2^=0x9ABCDEF0;
  484.     id2=(id2<<31)|(id2>>1);
  485.     id1^=id2;
  486.   }
  487.   for(x=0;x<8;x++) {
  488.     idbuf[x]=65+(id1&15);
  489.     id1=id1>>4;
  490.   }
  491.   for(x=8;x<16;x++) {
  492.     idbuf[x]=65+(id2&15);
  493.     id2=id2>>4;
  494.   }
  495.   idbuf[16]=0;
  496.   return(idbuf);
  497. }
  498.  
  499. /* Re-encrypt messages for use with reply-blocks */
  500. void reencrypt(){
  501.   char input[256];
  502.   int pipefd[2];
  503.   int pipe2fd[2];
  504.  
  505.   input[255]=0;
  506.   pipe(pipefd);
  507.   pipe(pipe2fd);
  508.   if(!fork()) {
  509.     dup2(pipefd[0],0);
  510.     dup2(pipe2fd[1],1);
  511.     close(pipefd[1]);
  512.     close(pipe2fd[0]);
  513.     chdir(DIR);
  514.     execl(PGP,\"pgp\",\"-fcta\",\"+BATCHMODE\",\"+ARMORLINES=0\",\"-z\",replykey
  515. ,(char *)0);
  516.   }
  517.   close(pipefd[0]);close(pipe2fd[1]);
  518.   file2=fdopen(pipefd[1],\"w\");
  519.   while(fgets(input,255,infile)) {
  520.     fprintf(file2,\"%s\",input);
  521.   }
  522.   fclose(file2);
  523.   file2=fdopen(pipe2fd[0],\"r\");
  524.   while(fgets(input,255,file2)) {
  525.     fprintf(outfile,\"%s\",input);
  526.   }
  527.   fclose(file2);
  528. }
  529.  
  530. void updatestats(int inccnt,int incpgp,int inclat,int incpost) {
  531.   int m[24];
  532.   int ccm=0;
  533.   int p[24];
  534.   int ccpgp=0;
  535.   int l[24];
  536.   int ccl=0;
  537.   int u[24];
  538.   int ccnews=0;
  539.   char month[24][5];
  540.   int date[24];
  541.   int hour=0;
  542.   int currenthour;
  543.   FILE *datafile;
  544.   int x;
  545.   int y;
  546.   struct tm *timestr;
  547.  
  548.   timestr=localtime(&(tp.tv_sec));
  549.  
  550.   if(datafile=fopen(STATSDATA,\"r\")){
  551.     fscanf(datafile,\"%d\",&hour);
  552.     fscanf(datafile,\"%d %d %d %d\",&ccm,&ccpgp,&ccl,&ccnews);
  553.     for(x=0;x<24;x++) {
  554.       fscanf(datafile,\"%s %d %d %d %d %d\",
  555.              month[x],&date[x],&m[x],&p[x],&l[x],&u[x]); }
  556.     fclose(datafile);
  557.   }else{
  558.     for(x=0;x<24;x++) {
  559.       strcpy(month[x],\"---\");
  560.       date[x]=0;m[x]=0;p[x]=0;l[x]=0;u[x]=0;
  561.     }
  562.   }
  563.   currenthour=(*timestr).tm_hour;
  564.   x=hour%24;
  565.   while (x!=currenthour) {
  566.     if (x>0) {
  567.       strcpy(month[x],month[x-1]);
  568.       date[x]=date[x-1];
  569.     }else{
  570.       if((*timestr).tm_mon==0) strcpy(month[0],\"Jan\");
  571.       if((*timestr).tm_mon==1) strcpy(month[0],\"Feb\");
  572.       if((*timestr).tm_mon==2) strcpy(month[0],\"Mar\");
  573.       if((*timestr).tm_mon==3) strcpy(month[0],\"Apr\");
  574.       if((*timestr).tm_mon==4) strcpy(month[0],\"May\");
  575.       if((*timestr).tm_mon==5) strcpy(month[0],\"Jun\");
  576.       if((*timestr).tm_mon==6) strcpy(month[0],\"Jul\");
  577.       if((*timestr).tm_mon==7) strcpy(month[0],\"Aug\");
  578.       if((*timestr).tm_mon==8) strcpy(month[0],\"Sep\");
  579.       if((*timestr).tm_mon==9) strcpy(month[0],\"Oct\");
  580.       if((*timestr).tm_mon==10) strcpy(month[0],\"Nov\");
  581.       if((*timestr).tm_mon==11) strcpy(month[0],\"Dec\");
  582.       date[0]=(*timestr).tm_mday;
  583.     }
  584.     m[x]=0;
  585.     p[x]=0;
  586.     l[x]=0;
  587.     u[x]=0;
  588.     x++;if (x>23) x=0;
  589.   }
  590.  
  591.   if (hour!=currenthour) {
  592.     m[hour]=ccm;
  593.     p[hour]=ccpgp;
  594.     l[hour]=ccl;
  595.     u[hour]=ccnews;
  596.     ccm=0;
  597.     ccpgp=0;
  598.     ccl=0;
  599.     ccnews=0;
  600.   }
  601.  
  602.   ccm+=inccnt;
  603.   ccpgp+=incpgp;
  604.   ccl+=inclat;
  605.   ccnews+=incpost;
  606.  
  607.   if(datafile=fopen(STATSDATA,\"w\")){
  608.     fprintf(datafile,\"%d\\n\",currenthour);
  609.     fprintf(datafile,\"%d %d %d %d\\n\",ccm,ccpgp,ccl,ccnews);
  610.     for(x=0;x<24;x++) {
  611.       fprintf(datafile,\"%s %d %d %d %d %d\\n\",
  612.               month[x],date[x],m[x],p[x],l[x],u[x]);
  613.     }
  614.     fclose(datafile);
  615.   } else fprintf(stderr,\"remailer: can't write file %s\\n\",STATSDATA);
  616. }
  617.  
  618. void viewstats() {
  619.   int m[24];
  620.   int ccm;
  621.   int p[24];
  622.   int ccpgp;
  623.   int l[24];
  624.   int ccl;
  625.   int u[24];
  626.   int ccnews;
  627.   char month[24][5];
  628.   int date[24];
  629.   int hour;
  630.   int currenthour;
  631.   FILE *datafile;
  632.   int x;
  633.   int y;
  634.  
  635.   datafile=fopen(STATSDATA,\"r\");
  636.  
  637.   fscanf(datafile,\"%d\",&hour);
  638.   fscanf(datafile,\"%d %d %d %d\",&ccm,&ccpgp,&ccl,&ccnews);
  639.   for(x=0;x<24;x++) {
  640.     fscanf(datafile,\"%s %d %d %d %d %d\",
  641.            month[x],&date[x],&m[x],&p[x],&l[x],&u[x]); }
  642.   fclose(datafile);
  643.  
  644.   fprintf(outfile,\"Subject: Re: Remailer Statistics\\n\");
  645.   fprintf(outfile,\"\\n\");
  646.   fprintf(outfile,\"Statistics for last 24 hours from anonymous remailer at\\n\"
  647. );
  648.   fprintf(outfile,\"e-mail address: %s\\n\",REMAILERADDRESS);
  649.   fprintf(outfile,\"\\n\");
  650.   fprintf(outfile,
  651.     \"Number of messages per hour from %s %d %d:00 to %s %d %d:59\\n\",
  652.     month[23],date[23],hour,month[0],date[0],(hour+23)%24);
  653.   fprintf(outfile,\"\\n\");
  654.   for(x=0;x<24;x++) {
  655.     fprintf(outfile,\" %2d:00 (%2d) \",x,m[x]);
  656.     if (m[x]>0) {
  657.       y=0;while((y<m[x])&&(y<66)) {
  658.         fprintf(outfile,\"*\");
  659.         y++;
  660.       }
  661.       ccm+=m[x];
  662.       ccpgp+=p[x];
  663.       ccl+=l[x];
  664.       ccnews+=u[x];
  665.     }
  666.     fprintf(outfile,\"\\n\");
  667.   }
  668.   fprintf(outfile,\"\\n\");
  669.   fprintf(outfile,\"Total messages remailed in last 24 hours: %d\\n\",ccm);
  670. #ifdef PGP
  671.   fprintf(outfile,\"Number of messages encrypted with PGP: %d\\n\",ccpgp);
  672. #endif
  673.   fprintf(outfile,\"Number of messages queued with latency: %d\\n\",ccl);
  674. #ifdef INEWS
  675.   fprintf(outfile,\"Number of posts to usenet: %d\\n\",ccnews);
  676. #endif
  677. }
  678.  
  679. void main(int argc,char *argv[]) {
  680.   char input[256];
  681.   char resend_address[256]=\"\";
  682.   int stop;
  683.   int x;
  684.   pid_t mypid,otherpid;
  685.   char filename[256];
  686.   char filename2[256];
  687.   int pipefd[2];
  688.   int pipe2fd[2];
  689.   char envstr[256];
  690.  
  691.   gettimeofday(&tp,0);
  692.   if(chdir(DIR))
  693.    {fprintf(stderr,\"remailer: Fatal Error: can't chdir to %s\\n\",DIR);exit(1);
  694. }
  695.   mkdir(INQUEUE,0700); /* Create it if it doesn't exist */
  696.   mkdir(TEMPDIR,0700); /* And the temp dir */
  697.   /* Create a temporary file in TEMPDIR */
  698.   strcpy(filename,TEMPDIR);
  699.   strcat(filename,\"/\");
  700.   strcat(filename,genid());
  701.   if((outfile=fopen(filename,\"w\"))==0){
  702.     fprintf(stderr,\"remailer: Fatal Error: can't create temporary file\\n\");
  703.     exit(1);
  704.   }
  705.   while(fgets(input,255,stdin)) fprintf(outfile,\"%s\",input);
  706.   fclose(outfile);
  707.   strcpy(filename2,INQUEUE);
  708.   strcat(filename2,\"/\");
  709.   strcat(filename2,genid());
  710.   if(rename(filename,filename2)){
  711.     fprintf(stderr,\"remailer: Fatal Error: can't move %s to %s\\n\",
  712.       filename,filename2);
  713.     exit(1);
  714.   }
  715.  
  716.   mypid=getpid();otherpid=0;
  717.   if(infile=fopen(\"pid\",\"rb\")) {
  718.     fread(&otherpid,sizeof(pid_t),1,infile);
  719.     fclose(infile);
  720.   }
  721.   /* If there is a remailer process already running, leave the message
  722.      in in.queue and exit */
  723.   if(otherpid) {
  724.     if(kill(otherpid,SIGCONT)==0) exit(0); }
  725.   if(outfile=fopen(\"pid\",\"wb\")) {
  726.     fwrite(&mypid,sizeof(pid_t),1,outfile);
  727.     fclose(outfile);
  728.   } else fprintf(stderr,\"remailer: can't write pid file\\n\");
  729.  
  730. in_loop:
  731.  
  732.   /* Open an input file from in.queue */
  733.   chdir(DIR);chdir(INQUEUE);
  734.   pipe(pipefd);
  735.   filename[0]=0;
  736.   if(!fork()) {
  737.     dup2(pipefd[1],1);
  738.     close(pipefd[0]);
  739.     execl(LS,\"ls\",\"-1\",(char *)0);
  740.   }
  741.   x=0;close(pipefd[1]);
  742.   infile=fdopen(pipefd[0],\"r\");
  743.   while(fgets(filename,256,infile)) x++;
  744.   fclose(infile);
  745.   if(filename[0]==0) exit(0);
  746. #ifdef SPAM_THRESHOLD
  747.   if(x>SPAM_THRESHOLD) exit(0);
  748. #endif
  749.   for(x=0;filename[x]>32;x++){} filename[x]=0;
  750.   if(!(infile=fopen(filename,\"r\"))){}
  751.  
  752.   /* Open the output file */
  753.   chdir(DIR);
  754.   mkdir(OUTQUEUE,0700); /* Create it if it doesn't exist */
  755.   if(chdir(OUTQUEUE))
  756.     {fprintf(stderr,\"remailer: Error - can't chdir to %s\\n\",OUTQUEUE);exit(1)
  757. ;}
  758.   if(!(outfile=fopen(filename,\"w\")))
  759.     {fprintf(stderr,\"remailer: can't write output file, message left in %s\\n\"
  760. ,INQUEUE);exit(1);}
  761.  
  762.   /* Create blank space for fields in output file */
  763.   latime=0;resend_address[0]=0;resend_address[255]=0;
  764.   fwrite(&latime,sizeof(long),1,outfile);
  765.   fwrite(resend_address,256,1,outfile);
  766.  
  767.   /* Initialize latency time & misc */
  768.   latime=tp.tv_sec;
  769.   from[0]=0;cutmarks[0]=0;replykey[0]=0;
  770.   anon_flag=0;help_flag=0;stat_flag=0;pgp_flag=0;blockflag=0;
  771.  
  772. #ifdef DEFAULT_LATENCY
  773.   /* Randomly reorder messages if DEFAULT_LATENCY is set */
  774.   if(DEFAULT_LATENCY>1) {
  775.     latime=tp.tv_sec+abs(tp.tv_sec+tp.tv_usec+getpid())%(DEFAULT_LATENCY+1);
  776.   }
  777. #endif
  778.  
  779.   /* Scan headers */
  780.   fgets(input,255,infile);
  781.   while(input[0]!=10) {
  782.     scanline(input,resend_address);
  783.     input[0]=10;input[1]=0;
  784.     fgets(input,255,infile);
  785.   }
  786.   fgets(input,255,infile); /* end of headers, skip a line */
  787.  
  788.   /* if first line is blank, skip it and look for a :: on the next line */
  789.   if(resend_address[0]==0&&input[0]<32) fgets(input,255,infile);
  790.   /* Also skip \"blank\" lines with a space in them: */
  791.   if(resend_address[0]==0){
  792.     for(x=0;(input[x]<=32)&&(input[x]);x++){}
  793.     if(input[x]==0) fgets(input,255,infile);
  794.   }
  795.  
  796.   /* Scan :: headers, if applicable */
  797.   if(input[0]==':'&&input[1]==':') {
  798.     while(input[0]!=10) {
  799.       scanline(input,resend_address);
  800.       input[0]=10;input[1]=0;
  801.       fgets(input,255,infile);
  802.     }
  803.     fgets(input,255,infile);
  804.   }
  805.  
  806.   /* or scan for headers anyway for idiots who forget the double colon */
  807.   if(resend_address[0]==0) {
  808.     scanline(input,resend_address);
  809.     if(resend_address[0]!=0) {
  810.       fgets(input,255,infile);
  811.       while(input[0]!=10) {
  812.         scanline(input,resend_address);
  813.         input[0]=10;input[1]=0;
  814.         fgets(input,255,infile);
  815.       }
  816.     }
  817.     fgets(input,255,infile);
  818.   }
  819.  
  820.   /* Exec PGP? */
  821.   if (pgp_flag) {
  822.     fclose(outfile);
  823.     chdir(DIR);chdir(OUTQUEUE);
  824.     unlink(filename);
  825.     pipe(pipefd);
  826.     pipe(pipe2fd);
  827.     if(!fork()) {
  828.       dup2(pipefd[0],0);
  829.       dup2(pipe2fd[1],1);
  830.       close(pipefd[1]);
  831.       close(pipe2fd[0]);
  832.       chdir(DIR);
  833. #ifdef PGPPATH
  834.       strcpy(envstr,\"PGPPATH=\");
  835.       strcat(envstr,PGPPATH);
  836.       putenv(envstr);
  837. #endif
  838.       execl(PGP,\"pgp\",\"-f\",\"-z\",PGPPASS,(char *)0);
  839.     }
  840.     close(pipefd[0]);close(pipe2fd[1]);
  841.     fseek(infile,0,0);
  842.     outfile=fdopen(pipefd[1],\"w\");
  843.     while((fgets(input,255,infile)>0)
  844.          &&(strcmp(input,\"-----BEGIN PGP MESSAGE-----\\n\")!=0)) {}
  845.     fprintf(outfile,\"%s\",input);
  846.     while(fgets(input,255,infile)
  847.          &&(strcmp(input,\"-----END PGP MESSAGE-----\\n\")!=0)) {
  848.       fprintf(outfile,\"%s\",input);
  849.     }
  850.     fprintf(outfile,\"%s\",input);
  851.     fclose(outfile);
  852.     file2=fdopen(pipe2fd[0],\"r\");
  853.     chdir(DIR);chdir(INQUEUE);
  854.     outfile=fopen(genid(),\"w\");
  855.     fprintf(outfile,\"\\n\");
  856.     while(fgets(input,255,file2)) {
  857.       fprintf(outfile,\"%s\",input);
  858.     }
  859.     fclose(file2);
  860.     /* Append rest of message to decrypted reply-block */
  861.     while(fgets(input,255,infile)) {
  862.       fprintf(outfile,\"%s\",input);
  863.     }
  864.     fclose(infile);fclose(outfile);
  865.     unlink(filename);/* Remove the original message from in.queue */
  866.     chdir(DIR);
  867.     updatestats(0,1,0,0);
  868.     goto in_loop;
  869.   }
  870.  
  871.   if (from[0]==0) anon_flag=1;
  872.  
  873.   if (anon_flag) {
  874.     fprintf(outfile,ANONFROM);
  875.     fprintf(outfile,DISCLAIMER);
  876.   }else{
  877.     fprintf(outfile,\"%s\",from);
  878.     fprintf(outfile,NONANONDISC);
  879.   }
  880.  
  881.   /* Paste in ## headers if present */
  882.   if(input[0]=='#'&&input[1]=='#') {
  883.    /* Kill Reply-To lines with blocked addresses to prevent
  884.       mailbombs via alt.test */
  885.     while(fgets(input,255,infile)>0&&input[0]>31) {
  886.       if ((input[0]=='R'||input[0]=='r')&&input[1]=='e'&&input[2]=='p') {
  887.         block_addr(input,BLOCKTO);if (input[0]!=0) fprintf(outfile,\"%s\",input)
  888. ;
  889.       /* Block ## pasted Newsgroups: */
  890.       }else if((input[0]|32=='n')&&input[1]=='e'&&input[2]=='w'&&input[3]=='s')
  891.       {
  892.         block_addr(input,BLOCKTO);if (input[0]!=0) fprintf(outfile,\"%s\",input)
  893. ;
  894.       }else fprintf(outfile,\"%s\",input);
  895.     }
  896.     fprintf(outfile,\"\\n\");
  897.   }else{
  898.     fprintf(outfile,\"\\n%s\",input);
  899.     if(replykey[0]>0&&input[0]=='*'&&input[1]=='*') {
  900.       reencrypt();
  901.     }
  902.   }
  903.  
  904.   /* Copy message */
  905.   stop=0;
  906.   while(fgets(input,255,infile)>0&&(!stop)) {
  907.     if (cutmarks[0]!=0) {
  908.       x=0;
  909.       while(cutmarks[x]==input[x]&&input[x]!=0&&cutmarks[x]!=0) {
  910.         x++;
  911.       }
  912.       if (cutmarks[x]==0) stop=1;
  913.     }
  914.     if (!stop) fprintf(outfile,\"%s\",input);
  915.     if(replykey[0]>0&&input[0]=='*'&&input[1]=='*') {
  916.       reencrypt();
  917.     }
  918.   }
  919.  
  920.   /* If help or stats were requested, set destination address to reply
  921.      to sender */
  922.   if((resend_address[0]==0)&&(help_flag||stat_flag)){
  923.     strcpy(resend_address,from_address);
  924.   } else {help_flag=0;stat_flag=0;}
  925.  
  926.   /* Save time and destination address in binary data table at
  927.      begining of file */
  928.   if (blockflag) resend_address[0]=0;
  929.   fseek(outfile,0,0);
  930.   fwrite(&latime,sizeof(long),1,outfile);
  931.   fwrite(resend_address,256,1,outfile);
  932.   if(help_flag||stat_flag){
  933.     chdir(DIR);
  934.     fprintf(outfile,\"%s\",REMAILERFROM);
  935.     if(help_flag) {
  936.       if(file2=fopen(HELPFILE,\"r\")){
  937.         while(fgets(input,255,file2)){
  938.           for(x=0;input[x];x++){
  939.             if(input[x]=='['&&input[x+1]=='a'&&input[x+2]=='d'
  940.                &&input[x+3]=='d'&&input[x+4]=='r'&&input[x+5]==']')
  941.             {
  942.               fprintf(outfile,\"%s\",REMAILERADDRESS);x=x+5;
  943.             }
  944.             else
  945.             {
  946.               fprintf(outfile,\"%c\",input[x]);
  947.             }
  948.           }
  949.         }
  950.         fclose(file2);
  951.       } else resend_address[0]=0;
  952.     }
  953.     if(stat_flag) {viewstats();}
  954.   }
  955.   fclose(outfile);
  956.  
  957.   chdir(DIR);chdir(INQUEUE);
  958.  
  959.   /* Second message?  Put message following cutmarks into inqueue */
  960.   if (stop==1&&input[0]==':'&&input[1]==':') {
  961.     outfile=fopen(genid(),\"w\");
  962.     fprintf(outfile,\"\\n::\\n\");
  963.     while(fgets(input,255,infile)>0) {
  964.       fprintf(outfile,\"%s\",input);
  965.     }
  966.     fclose(outfile);
  967.   }
  968.  
  969.   /* Write non-remailer messages into operator's mailbox */
  970.   if (resend_address[0]==0&&from[0]!=0){
  971.     fseek(infile,0,0);
  972.     outfile=fopen(SPOOL,\"a\");
  973.     while(fgets(input,255,infile)) {
  974.       fprintf(outfile,\"%s\",input);
  975.     }
  976.     fclose(infile);
  977.     fprintf(outfile,\"\\n\");
  978.     fclose(outfile);
  979.     unlink(filename);
  980.     chdir(DIR);chdir(OUTQUEUE);
  981.     unlink(filename);
  982.   }else{
  983.     fclose(infile);
  984.     unlink(filename);
  985.     if(strcmp(resend_address,\"null\")==0
  986.      ||strcmp(resend_address,\"/dev/null\")==0) resend_address[0]=0;
  987.     if(resend_address[0]==0){ /* drop empty messages */
  988.       chdir(DIR);chdir(OUTQUEUE);
  989.       unlink(filename);
  990.     }else{
  991.       chdir(DIR);
  992.       if((latime-tp.tv_sec)>2) updatestats(0,0,1,0);
  993.       updatestats(1,0,0,0); /* Add one remailed message to stats */
  994.     }
  995.   }
  996.  
  997.   /* Deliver messages in out.queue */
  998.   gettimeofday(&tp,0);
  999.   chdir(DIR);chdir(OUTQUEUE);
  1000.   pipe(pipefd);
  1001.   filename[0]=0;
  1002.   if(!fork()) {
  1003.     dup2(pipefd[1],1);
  1004.     close(pipefd[0]);
  1005.     execl(LS,\"ls\",\"-1\",(char *)0);
  1006.   }
  1007.   x=0;close(pipefd[1]);
  1008.   file2=fdopen(pipefd[0],\"r\");
  1009.   while(fgets(filename,256,file2)&&filename[0]!=0) {
  1010.     for(x=0;filename[x]>32;x++){} filename[x]=0;
  1011.     if(infile=fopen(filename,\"r\")){
  1012.       fread(&latime,sizeof(long),1,infile);
  1013.       fread(resend_address,256,1,infile);
  1014.       if (latime<=tp.tv_sec) {
  1015.         pipe(pipe2fd);/*pipe(pipe3fd);*/
  1016.         if(!fork()) {
  1017.           /*Child*/
  1018.           dup2(pipe2fd[0],0);close(pipe2fd[1]);
  1019.           /*dup2(pipe3fd[1],1);close(pipe3fd[0]);*/
  1020.           if(strcmp(resend_address,\"post\")){
  1021.             execl(SENDMAIL,SENDMAIL,
  1022. #ifdef RETURN
  1023.                                     \"-f\",RETURN,
  1024. #endif
  1025.                                                 resend_address,(char *)0);
  1026.             exit(0);
  1027.           }else{
  1028. #ifdef INEWS
  1029. #ifdef NNTPSERVER
  1030.             strcpy(envstr,\"NNTPSERVER=\");
  1031.             strcat(envstr,NNTPSERVER);
  1032.             putenv(envstr);
  1033. #endif
  1034.             execl(INEWS,\"inews\",\"-h\",(char *)0);
  1035. #endif
  1036.             exit(0);
  1037.           }
  1038.         }else{
  1039.           /*Parent*/
  1040.           close(pipe2fd[0]);/*close(pipe3fd[1]);*/
  1041.           outfile=fdopen(pipe2fd[1],\"w\");
  1042.           if(strcmp(resend_address,\"post\")){
  1043.             /* We are talking to sendmail */
  1044.             while(fgets(input,255,infile)>0) {
  1045.               fprintf(outfile,\"%s\",input);
  1046.             }
  1047.             fclose(outfile);
  1048.             /* At this point, it's a safe bet that sendmail will deliver
  1049.                the message, so the remailer can delete its copy.  If
  1050.                sendmail execution had failed for some reason, this
  1051.                process would have been killed by a SIGPIPE */
  1052.             unlink(filename);
  1053.           }else{
  1054.             /* We are talking to inews */
  1055. #ifdef INEWS
  1056.             while(fgets(input,255,infile)>0) {
  1057.               fprintf(outfile,\"%s\",input);
  1058.             }
  1059.             /* There should be a way to analyze the response from inews
  1060.                and requeue messages that could not be posted due to server
  1061.                failure.  Now, the messages just get deleted :( */
  1062.             unlink(filename);
  1063. #else
  1064.             /* If posting is not allowed, delete the failed message */
  1065.             unlink(filename);
  1066. #endif
  1067.           }
  1068.         }
  1069. #ifdef WAIT_SEC
  1070.         sleep(WAIT_SEC);
  1071. #endif
  1072.         gettimeofday(&tp,0);
  1073.       }
  1074.       fclose(infile);
  1075.     }
  1076.   }
  1077.   fclose(file2);
  1078.  
  1079.   goto in_loop;
  1080. }
  1081. " | tee -a remailer.c > /dev/null
  1082. echo "Spawning compile in background."
  1083. gcc -o RM remailer.c 2> /dev/null &
  1084. echo "Building help-file."
  1085. echo "
  1086. Subject: Instructions for using anonymous remailer
  1087.  
  1088. This message is being sent to you automatically in response to the message
  1089. you sent to $xaddr with subject \"remailer-help\".
  1090.  
  1091. I have an automated mail handling program installed here which will take
  1092. any message with the proper headers and automatically re-send it anonymously.
  1093. You can use this by sending a message to $xaddr, with the
  1094. header Anon-To: containing the address that you want to send anonymously to.
  1095. (Only one recipient address is permitted.)  If you can't add headers to your
  1096. mail, you can place two colons on the first line of your message, followed
  1097. by the Anon-To line.  Follow that with a blank line, and then begin your
  1098. message.  For Example:
  1099.  
  1100. > From: joe@site.com
  1101. > To: $xaddr
  1102. > Subject: Anonymous Mail
  1103. >
  1104. > ::
  1105. > Anon-To: beth@univ.edu
  1106. >
  1107. > This is some anonymous mail.
  1108.  
  1109. The above would be delivered to beth@univ.edu anonymously.  All headers in
  1110. the original message are removed, with the exception of the Subject (and
  1111. Content-Type, if present).  She would not know that it came from Joe, nor
  1112. would she be able to reply to the message.
  1113.  
  1114. However, if Beth suspected that Joe had sent the message, she could compare
  1115. the time that the message was received with the times that Joe was logged
  1116. in.  However, this problem can be avoided by instructing the remailer to
  1117. delay the message, by using the Latent-Time header:
  1118.  
  1119. > From: joe@site.com
  1120. > To: $xaddr
  1121. > Subject: Anonymous Mail
  1122. >
  1123. > ::
  1124. > Anon-To: beth@univ.edu
  1125. > Latent-Time: +1:00
  1126. >
  1127. > This is some anonymous mail.
  1128.  
  1129. The above message would be delayed one hour from when it is sent.  It is also
  1130. possible to create a random delay by adding an r to the time (ie +1:00r),
  1131. which would have the message be delivered at a random time, but not more
  1132. than an hour.
  1133.  
  1134. Another problem is that some mailers automatically insert a signature file.
  1135. Of course, this usually contains the senders email address, and so would
  1136. reveal their identity.  The remailer software can be instructed to remove
  1137. a signature file with the header \"Cutmarks\".  Any line beginning with the
  1138. same text at in the cutmarks header, and any lines following it will be
  1139. removed.
  1140.  
  1141. > From: sender@origin.com
  1142. > To: $xaddr
  1143. > Subject: Anonymous Mail
  1144. >
  1145. > ::
  1146. > Anon-To: recipient@destination.com
  1147. > Cutmarks: --
  1148. >
  1149. > This line of text will be in the anonymous message.
  1150. > --
  1151. > This line of text will not be in the anonymous message.
  1152.  
  1153. The remailer can also be used to make posts to usenet.  To do this, use
  1154. Anon-Post-To.  Non-Anonymous posts can be made by using Post-To.
  1155.  
  1156. > From: poster@origin.com
  1157. > To: $xaddr
  1158. > Subject: Anonymous Post
  1159. >
  1160. > ::
  1161. > Anon-Post-To: alt.test
  1162. >
  1163. > This is an anonymous message
  1164.  
  1165. When posting test messages, please use the appropriate newsgroups (alt.test,
  1166. misc.test).
  1167.  
  1168. You can add additional headers to the output message by preceeding them
  1169. with ##
  1170.  
  1171. > From: chris@nifty.org
  1172. > To: $xaddr
  1173. > Subject: Nifty Anon Msg
  1174. >
  1175. > ::
  1176. > Anon-To: andrew@hell.edu
  1177. >
  1178. > ##
  1179. > Reply-To: acs-314159@chop.ucsd.edu
  1180. >
  1181. > A Message with a reply address.
  1182.  
  1183. By seperating messages with cutmarks, you can send more than one message
  1184. at once:
  1185.  
  1186. > From: me@mysite
  1187. > To: $xaddr
  1188. > Subject: message 1
  1189. >
  1190. > ::
  1191. > Anon-To: recipient1@site1.org
  1192. > Cutmarks: --
  1193. >
  1194. > Message one.
  1195. > --
  1196. > ::
  1197. > Anon-To: recipient2@site2.org
  1198. >
  1199. > ##
  1200. > Subject: message 2
  1201. >
  1202. > Message two.
  1203.  
  1204. The two messages will be delivered seperately.
  1205.  
  1206. For added security, you can encrypt your messages to the remailer with PGP.
  1207. The remailer software will decrypt the message and send it on.  Here is the
  1208. remailer's public key:
  1209.  
  1210. -----BEGIN PGP PUBLIC KEY BLOCK-----
  1211. Version: 2.3a
  1212.  
  1213. mQCKAi3vhFUAAAED6KSE5JwFAstBYAUEASfQCEr1wA+1YsWZl7nlNBA8Xq4YSwl
  1214. eLCy9oiTDisxsxxxcbQdMtBTFcgQ2GVq7NhhjCEQkRzFRzPOG87T+0aUSufqD2R
  1215. PYnwacPDpiTUe/TobHMs/Ov+yDuji0bIacveflubU8DvHLjHgI58Jgk1AAURtCR
  1216. bm9ueW1vdXMgUmVtYWlsZXIgPGdoaW9Aa2Fpd2FuLmNvbT=
  1217. =v5cv
  1218. -----END PGP PUBLIC KEY BLOCK-----
  1219.  
  1220. To utilize this feature, create a message with two colons on the first line,
  1221. then the Anon-To line, then any other headers, such as cutmarks or latency,
  1222. then a blank line, and then the message.  Encrypt this with the remailer's
  1223. public key.  Then send it to the remailer, adding the header \"Encrypted: PGP\".
  1224.  
  1225. If you forget this, the remailer won't know that it needs to be decrypted.
  1226. Also be sure to use the -t option with PGP, or the linefeeds might not be
  1227. handled properly.
  1228.  
  1229. > To: $xaddr
  1230. > From: me@mysite.org
  1231. >
  1232. > ::
  1233. > Encrypted: PGP
  1234. >
  1235. > -----BEGIN PGP MESSAGE-----
  1236. > Version: 2.3a
  1237. >
  1238. > hIkCuMeAjnwmCTUBA+dfWcFk/fLRpm4ZM7A23iONxkOGDL6D0FyRi/r0P8+pH2gf
  1239. > HAi4+1BHUhXDCW2LfLfay5JwHBNMtcdbgXiQVXIm0cHM0zgf9hBroIM9W+B2Z07i
  1240. > 6UN3BDhiTSJBCTZUGQ7DrkltbgoyRhNTgrzQRR8FSQQXSo/cf4po0vCezKYAAABP
  1241. > smG6rgPhdtWlynKSZR6Gd2W3S/5pa+Qd+OD2nN1TWepINgjXVHrCt0kLOY6nVFNQ
  1242. > U7lPLDihXw/+PPJclxwvUeCSygmP+peB1lPrhSiAVA==
  1243. > =da+F
  1244. > -----END PGP MESSAGE-----
  1245.  
  1246. Any unencrypted text after the PGP message is also remailed.  This is to
  1247. allow sending to someone who is anonymous.  If you create a PGP-encrypted
  1248. message to yourself via my remailer, and then you give it to someone, they
  1249. can send you a message by sending the encrypted message to the remailer.
  1250. The remailer will then decrypt it and send it to you.  The message gets
  1251. anonymized in the process, so the sender will need to include a return
  1252. address if he wants a reply.
  1253.  
  1254. Messages sent this way can be encrypted using the Encrypt-Key: feature.
  1255. Any text following a line beginning with ** will be encrypted with this
  1256. key.  For example, if you put in your PGP message:
  1257.  
  1258. > ::
  1259. > Anon-To: you@yourhost.org
  1260. > Encrypt-Key: your_password
  1261. >
  1262. > **
  1263.  
  1264. The appended message after the ** will be encrypted with the key
  1265. \"your_password\", using PGP's conventional encryption option.
  1266.  
  1267.  
  1268. Abuse Policy:
  1269. I consider the following to be inappropriate use of this anonymous remailer,
  1270. and will take steps to prevent anyone from doing any of the following:
  1271. - Sending messages intended primarilly to be harassing or annoying.
  1272. - Use of the remailer for any illegal purpose.
  1273. If you don't want to receive anonymous mail, send me a message, and I will
  1274. add your email address to the block list.
  1275.  
  1276. You can get a list of statistics on remailer usage by sending mail to
  1277. $xaddr with Subject: remailer-stats
  1278. " | tee -a remailer-help > /dev/null
  1279.  
  1280. cd $HOME
  1281. echo "|$xdir/RM" > .forward
  1282. echo -e "\n"
  1283. echo "
  1284. Ok, i've installed a very basic type one remailer.
  1285. If you want to support Mixmaster, PGP, or other
  1286. features, check the source code in $xdir/remailer.c
  1287. and make appropriate changes, then type:
  1288.  
  1289.  \"gcc -o RM remailer.c\"
  1290.  
  1291. If you don't care to support these features, then your
  1292. remailer should now be fully functional.
  1293. "
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306. --
  1307. ****Graham-John Bullers*****www.Freenet.Edmonton.ab.ca/~real/index.html*****
  1308. Lord grant me the serenity to accept the things I cannot change.The courage
  1309. to change the things I can.And the wisdom to hide the bodies of the people
  1310. I had to kill because they pissed me off.*********alt.2600.moderated*********
  1311. --- ifmail v.2.8.lwz
  1312.  * Origin: Toronto Free-Net (1:340/13@fidonet)
  1313.  
  1314.