[Tutor] Barking mad, simply barking mad, but here it is thus far...

Kirk Bailey deliberatus@my995internet.com
Fri, 30 Nov 2001 01:32:25 -0500


Ok, call me a fool, but I am working on a psuedo code outline for the
receive/resend
module of the tinylist list manager. This is very rough at this point,
but if ya want
a look, squint on. Laughter is understood.

All it does is check to see if the sender is a subscriber (and reply
with a refusal message if they are not) and send the letter indivigually
(seperate envlopes) if sender is in the subscriber list.

Ought to look into setting a X header in the thing to prevent mail
loops, and checking for them.
Ought to go to bed.
Ought to go to college for computersci...
ZZZzzz...




------------------shallow mockery of programming
follows--------------------------
#!/usr/local/bin/python
#
# This rough work is a jumble of psuedo code, Python, and wierdshit from
the back
# of my mind back in the days of compiler basic!!!
#
incomingletter = raw_input()
#<stdin> provides the input from the alias,
# which is structured as
#
# listname:"|/path/programname"
#
# Note there is no command line arguement, nor is one needed.
# We KNOW it's a valid list, it came here from an alias!
# Were there no valid identity for that list, we would never see it
here!
#
# therefore, we just read the first part of the TO: field to know it's
name!
# and store that as LISTNAME.
#
letter{}=Parse(incomingletter)
#gotta read more on how to parse a incoming letter. Dummy code for now.
#
listname=leftstr$(len(letter{'To:'}),pos(letter{'To:'},"@")letter{'To:'})
# in other words, set variable listname to everything to the LEFT of '@'
in the
# 'To:' field of the incoming letter.
#
sender = rstrong$(letter{'From'},len(letter{'From:'}-5))
# In other words, trim off the left 5 chars of that field, which 
# would be 'From:' of course. Whatever is left is what we want.
#
# now check to see if the sender string is to be found in the 
# contents of a file with the name of the list in the path specfied.
#
if included('/etc/lists/'+listname, sender)
        # It is in there, so he is a subscriber, and may therefore post
to the list.
        open mail('message','s')
        letter{'Subject:'}
        subject="["+ listname + "]" + letter{'subject'}
        letter{'Subject:'}=subject
        for i in a1:
                mail.send(a1,listname+@+domain, letter{'subject'},
letter{body})
        exit(0)
else
        #This block executes if they are not subscribers to the list!
        open mail('message','s')
        message = "To:"+letter{'From'}
        message = "Subject: RE:"+letter{subject:}
        message = """Body:

Sorry, you are not a subscriber to this list, so you may not post.
Goodby.

This list is mangled by tinylist, so there.
"""
# this line could have read a file for the reply to use, but I got
bigger
# conceptual fish to fry right now.
        close a1

exit(0)
-----------------end of drooling madness------------------------------

Part of me feels the fool for displaying such crude code, but this is a
tutor list for newbies and such, so if not here, where?

Oh- I have got a book about python cgi for the web coming from the
library from out of town, my posts should leap upeards to the merely
confusing soon.

-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/


-- 
Respectfully,
             -Kirk D Bailey (C)2001
              Addme! icq #27840081
end


Within the sweep of his sword, Each man is an Ubar.

http://www.howlermonkey.net/
http://www.sacredelectron.org/