🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #20024

[Announce] Remail2news script

#20024
From: Peter Alfredsen
Date: Thu, 04 Oct 2001 07:57
210 lines
8396 bytes
[Notice x-post and follow-up]
This is a script that will take you news messages and transfrom them
into mixmaster messages, sending them through the mixmaster network
and into usenet by mail2news gateways.

All script archives are free to include it into their collection.

Comments are as always welcome.


--- Begin Remail2News.hsc
#!hs2
#!load hamster.hsm
#!load hmessage.hsm

#(C) Peter Alfredsen (peteralf@fabel.dk
#This script can be modified as much as you want, and sent to others
#if you just send me a mail including your changes and why you think
#That they are a good idea.

#Notice that mixmaster remailer doesn't cope very well with lines over 80 characters,
#So you might want to use something like korrnews to fold your references header and
#keep the length of your lines to 80 (including quotes).

#This script requires Mixmaster 2.0.4b45

# Constants
var ( $newsoutpath )

$newsoutpath = Hampath + "groups\news.out\"

# Insert your own emailaddress here.

var( $youremail )

$youremail = ""

#Specify where mixmaster is installed

var( $mixmastpath )

$mixmastpath = "F:\MIX\"

#Insert your default remailerchain here.
#Identifying numbers can be had from running "mixmaste.exe",
#inserting a valid address and press enter 2 times.

var( $defaultremailer )

$defaultremailer = "32"

#Variables
var ( $messagelist )
var ( $messagenumber )
var ( $message )
var ( $m2nmess )
var ( $mixmastmsg )
var ( $mixmastto )
var ( $mixmastoutput )
var ( $mixmastinput )
var ( $numcopies )
var ( $counter )
var ( $remailers )

#Initialize
$messagelist = ListAlloc
$message = ListAlloc
$messagenumber = 0

if ( DirExists( Hampath + "tmp\" ) = 0 )
  DirMake( Hampath + "tmp\" )
endif

if ( DirExists( $newsoutpath ) )

  if ( ListFiles( $messagelist, $newsoutpath + "*.msg", true )>0 )

    for( $messagenumber, 0, ListCount($messagelist)-1 )
      
      if ( ListLoad( $message, ListGet( $messagelist, $messagenumber ) )=0 )

#Notice that from here until the next if, you can insert code to make modifications to your message.

#This is where the mixmaster code begins.

        if ( Re_Match( MsgGetHeader( $message, "Newsgroups:" ), "(^|,)(bofh\.|tele\.|paradoxa\.|databasix\.|panix\.|altnet\.|airnews\.|supernews\.|usenetserver\.|easynews\.|giganews\.|spamcop\.|worldonline\.|cybercity\.|net\.|cn\.|claranet\.|hamster\.)" ) != true )

#If you want to exclude any hierarchies from mail2news, you need to edit the code above ^^^^^^.
#You can also make it inclusive by changin the end of it to " = true )"


#The code that has been commented out, is code that allows
#you to use ordinary remailers and/or mail2news gateways only.
#It will need a little tinkering to work.

#          $m2nmess = "!MAIL FROM: <" + $youremail + ">"  + chr(13) + chr(10) _
#                   + "!RCPT TO: <remailer@xganon.com>"  + chr(13) + chr(10) _
#                   + "To: remailer@xganon.com" + chr(13) + chr(10) _
#                   + "From: " + $youremail + chr(13) + chr(10) _
#                   + chr(13) + chr(10) _
#                   + "::" + chr(13) + chr(10) _
#                   + "Request-Remailing-To: mail2news@dizum.com"  + chr(13) + chr(10) _
#                   + chr(13) + chr(10) _
#                   + "##"  + chr(13) + chr(10) _
#                   + ListGetText( $message )


#          $m2nmess = "!MAIL FROM: <" + $youremail + ">"  + chr(13) + chr(10) _
#                   + "!RCPT TO: <mail2news@nym.alias.net>" + chr(13) + chr(10) _
#                   + "!RCPT TO: <mail2news@freedom.gmsociety.org>" + chr(13) + chr(10) _
#                   + "!RCPT TO: <usenet-gateway@mixmaster.shinn.net>" + chr(13) + chr(10) _
#                   + "!RCPT TO: <mail2news@dizum.com>" + chr(13) + chr(10) _
#                   + "!RCPT TO: <" + $youremail + ">" + chr(13) + chr(10) _
#                   + ListGetText( $message )
#
# 
#          ListSetText( $message, $m2nmess )
#
#          ListSave( $message, Hampath + "mails\mail.out\" + str( time ) + ".msg" )

  
          $mixmastinput = Hampath + "\tmp\" + str( time-1000 ) + ".msg"
          $mixmastoutput = Hampath + "mails\mail.out\" + str( time-60000 ) + ".msg"
  
  
          $mixmastmsg = "To: mail2news@nym.alias.net, mail2news@dizum.com" + chr(13) + chr(10) _
                      + "To: mail2news@freedom.gmsociety.org, " + $youremail + chr(13) + chr(10) _
                      + ListGetText( $message )

          ListSetText( $message, $mixmastmsg )
  
          #Defines the number of copies of each individual message to send through a remailerchain. The
          #longer and more insecure the chain gets, the more copies are needed to be sure to get through.
          $numcopies = 3

          #If you want to specify a specific chain of remailers, it can be done in the Summary header like this:
          #12 25 1 25 6

          if ( MsgGetHeader( $message, "Summary:" ) != "" )
            if ( RE_Match( MsgGetHeader( $message, "Summary:" ), "^([0-9][0-9 ]+[0-9]|[0-9]{1,2})$" ) = 1 )
              $remailers = MsgGetHeader( $message, "Summary:" )
              MsgDelHeader( $message, "Summary:" )
            else
              $remailers = $defaultremailer
            endif
          else
            $remailers = $defaultremailer
          endif

          ListSave( $message, $mixmastinput )

          execute( "CMD.EXE /c type " + $mixmastinput + "| " + $mixmastpath + "mixmaste.exe stdin -m -n " + str( $numcopies ) + " -O " + $mixmastoutput + " -l " + $remailers, $mixmastpath )

          #When choosing remailers:
          #Segfault is fast, leaves from, removes message-id
          #Frog2 is slow, leaves from, maintains message-id

          for( $counter, 1, $numcopies )
 
            ListLoad( $message, $mixmastoutput + "." + str( $counter ) )
  
            $mixmastto = MsgGetHeader( $message, "To:" )

            $mixmastmsg = "!MAIL FROM: <" + $youremail + ">"  + chr(13) + chr(10) _
                      + "!RCPT TO: <" + $mixmastto + ">"   + chr(13) + chr(10) _
                      + ListGetText( $message )
          
            ListSetText( $message, $mixmastmsg )
   
            FileDelete( $mixmastoutput + "." + str( $counter ) )

            FileDelete( $mixmastinput )

            ListSave( $message, replace( $mixmastoutput, ".msg", str( $counter ) + ".msg" ) )

          endfor

          FileDelete( ListGet( $messagelist, $messagenumber ) )
        
        else

          ListSave( $message, ListGet( $messagelist, $messagenumber ) )

      else
        Print ( "Problem Loading message from disk" )
     
      endif

    endfor

  else
    Print ( "No messages in " + $newsoutpath )

  endif

else
 Print ( $newsoutpath + " Doesn't Exist" )

endif

ListFree ( $messagelist )
ListFree ( $message )

--- End Remail2News.hsc
-- 
Peter Alfredsen (peteralf@fabel.dk)
"You fuck with America, now you get what you wanted you freaking communist.
 Call me terrorist, whatever. I'm an American soldier, and I'm comming to
 get you!"
Technical Details
Message-ID: <371325456@peter.alfredsen.dq>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-hamster.en.scripts.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!cyclone2.usenetserver.com!usenetserver.com!mtu.ru!news3.cnt.ru!sn-xit-03!sn-post-01!supernews.com!news.supernews.com!peter.alfredsen.dq!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <371325456@peter.alfredsen.dq>
Subject: [Announce] Remail2news script
Date: Thu, 04 Oct 2001 09:57:25 +0200
From: Peter Alfredsen <20011004095725.hamster.en.scripts-alt.privacy.anon-server@peteralf.clara.co.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-hamster.en.scripts.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.ems.psu.edu!news.cis.ohio-state.edu!news.maxwell.syr.edu!cyclone2.usenetserver.com!usenetserver.com!mtu.ru!news3.cnt.ru!sn-xit-03!sn-post-01!supernews.com!news.supernews.com!peter.alfredsen.dq!not-for-mail
Newsgroups: hamster.en.scripts,alt.privacy.anon-server
Followup-To: hamster.en.scripts
Organization: The Secret Danish USENET Cabal (TINSDUC)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Meow: meow
X-Face: GM.c`t/E8??hV>e]2O0r'rR-?,^PsD8ZT^Cka9:=kzr~p#_f')D[Z3gaK3?jj`U^
 YxX"QUCqSw]Yj0P5<Ggi'xi#S+9e87Rfr^|46"VY=#V>-{AR'Q#3>0MTo~
 _.C<u:{)f"[tT%0{V=3[Y97|XXz,o
X-Complaints-To: newsabuse@supernews.com
Lines: 209