def spamassassinator(self,author="",subject="",text=""):
    # Use SpamAssassin to check a message and determine its spammy or hammy nature.
    # This is useful for checking posts to sites

    import commands
    from random import Random
    
    # construct a phony e-mail message to pass to spamc

    message = '''From: %s
Subject: %s

%s

''' % (author,subject,text)

    rnd_generator = Random()
    stamp = rnd_generator.randrange(0,100000)

    email_filename = "/tmp/spamassassinator-%d" % (stamp)

    email_file = open(email_filename+".txt","w")
    email_file.write(message);
    email_file.close()

    # process  the message
    commandtorun = "cat /tmp/spamassassinator-%d.txt | spamc -c" % stamp

    returnval = commands.getoutput(commandtorun)

    # Take the return value an evaluate it as a fraction (e.g. '4.9/4.0' --> 1.23)

    returnval = eval(returnval)

    print returnval

    return returnval

