home bbs files messages ]

Just a sample of the Echomail archive

Cooperative anarchy at its finest, still active today. Darkrealms is the Zone 1 Hub.

   JAMNNTPD      Support for the JAMNNTPD software client      2,630 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,161 of 2,630   
   Matt Bedynek to All   
   Python script to read echomail.jam and o   
   04 Jul 15 20:50:13   
   
   All,   
      
   Realize there may be similar things out there but this is what I wrote.  It   
   assumes your message base file name is the same as your echo tag. It is   
   embedded in my processing logic.   It will create a unique list of output   
   echoes to scan.   
      
   The python may not be elegant but I have only been writing python for less   
   than a week.  If you have suggestions please provide them!   
      
      
   -----8<-------   
      
   #!/usr/local/bin/python   
      
   import re   
   import os   
      
   echomailJam = '/opt/ftn/mail/echomail.jam'   
   echotossLog = '/opt/ftn/mail/echotoss.log'   
      
   try:   
           fp = open(echomailJam, "rb")   
           echoes = []   
           for line in fp:   
                   msgbase = re.match(r'.*/(\S+)\s+\d+',line.rstrip())   
                   if msgbase.group(1) not in echoes:   
                           echoes.append(msgbase.group(1))   
   except:   
           print ("unable to read: " + echomailJam)   
   finally:   
           fp.close()   
      
      
   try:   
           fp = open(echotossLog, "ab")   
           for tag in echoes:   
                   fp.write(tag + "\n")   
   except:   
           print ("unable to write: " + echotossLog)   
   finally:   
           fp.close()   
           os.remove(echomailJam) if os.path.exists(echomailJam) else None   
      
   --- Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.   
    * Origin: *** nntp://rbb.bbs.fi *** Lake Ylo *** Finland *** (2:221/361)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca