[Tutor] further ignorant babbling

Kirk Bailey deliberatus@my995internet.com
Sat, 01 Dec 2001 21:20:40 -0500


OK, newest and latest shot at looking like an idiot in front of my
betters.

---------------stubbling code attempt---------------
#!/usr/sbin/python
# preceeeding line must point to the python executable!
import strings
import mail
#
# define path information and domain name in the lines below
domainname = 'howlermonkey.net'
pathtosubscribers = '/www/www.howlermonkey.net/cgi-bin/lists'
#
# receive the incoming letter from <stdin>
incoming=raw_input()
#
# parse the letter into a dictionary
letter{}=Mail.parse(incoming)
#
# clip off preceeding and trailing whitespace chars if any
to=string.string(to)
#
# this next gives us the part after 'To:' and before '@'
to = string.string( letter, string.pos("@",3, 'to:'))
#
# ok, we now know the name of the list to referr to.
in.open(pathtosubscribers+to,'r')
# Dig, this tupple is the total subscriber file loaded,
# and is referred to with a index number!
subscribers = in
close in
# the subscriber list is now in the tupple 'in'
#
# note the 'from' field is LISTNAME.DOMAINNAME!
letter{'From:') = to + domainname
#
# append [listname] in FRONT of the existing subject.
X = '['+ to + ']' + letter{Subject:}
letter{subject:} = X
#
# open the footer file and read it into the variable footer
# then close it.
c = b.open(pathtostuff+footer,'r')
footer= raw_input(c)
close b
#
# append footer to the end of 'Body:' in dictionary 'letter'.
letter{'Body:'} = letter{'Body:'}+footer
#
#now send a seperate envlope and letter to each person in that
subscriber file
for i in subscribers():
	letter{'To:'}=subscribers[i]
	# This feeds a copy of the complete letter to sendmail
	# with To: coming from the tupple subscribers
	mail.send(letter{})

--------end of fumbling about--------------

ok, I know, it won't work, but it's improving.

General scheme of operation:

*It's a real list. This is because it came here from the alias file,
 so it must be a list you created, so we assume it exists and there
 is a subscriber file for it.

*We want FROM to point at the listname@domainname so they can reply to
it easily.

*The footer rile provides useful information for people using the list,
such as how to unsubscribe

	
Oh, and the library called, and said the interlibrary loan about python
just arrived, I will pick it up monday.	
	
-- 
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/