md = userhome+"/Mail/"


# advanced usage: spawn xtell, and write there the name or address of the sender,
# and subject.
a=os.popen("xtell "+username+" >/dev/null 2>&1", "w")
a.write("Mail from "+(ADDR_FROM[0] or ADDR_FROM[1])+":"+SUBJECT+"\n")
a.close()


# well-known spammer
if contains(FROM, "spammer@yahoo.com"):
    destination = [DevNull()]
    stop()

# sort mailing list: bablo@view.net.au is the address, it can be either recipient
# or in Cc:
if "bablo@view.net.au" in ADDRLIST_TO+ADDRLIST_CC:
    destination = [MailBox(md+"bablo")]
    stop()

# better handled mailing list, it has header X-Mailing-list
# we write it to the mailbox and forward to a friend who was too lazy to subscribe by himself
# (this is better for the network, too...)
if isinheader("X-Mailing-list", "debian-devel"):
    destination = [MailBox(md+"debian-devel"), MailForward("krivanek@dmpc.dbp.fmph.uniba.sk")]
    stop()


