To | CZ-debian list <czdebian-l zavinac debian bod cz> |
From | Matej Cepl <matej zavinac ceplovi bod cz> |
Date | Wed, 29 Jan 2003 11:08:19 -0500 |
Mail-followup-to | CZ-debian list <czdebian-l zavinac debian bod cz> |
Organization | Northeastern University |
User-agent | Mutt/1.3.28i |
Kdybyste někdo měli zájem, tak jsem předělal pro exim skriptík, který pohodlně maže poštu v odchozí froně (mmch, u eximu je to mnohem jednodušší, protože jednak je jednodušší výstup z mailq a kromě toho existuje příkaz exim -Mrm). Hezký den Matěj -- Matej Cepl, Finger: 89EF 4BC6 288A BF43 1BAB 25C3 E09F EF25 D964 84AC 138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488 We are told that [St. Anthony] once fell into dejection, finding uninterrupted contemplation above his strength; but was taught to apply himself at intervals to manual labour by a vision of an angel who appeared platting mats of palm-tree leaves, then rising to pray, and after some time sitting down again to work; and who at length said to him, "Do thus, and thou shalt be saved." -- Life of St. Anthony
#!/usr/bin/env python #$Id: rmmail,v 1.7 2003/01/29 16:04:59 matej Exp $ from os import popen, execvp, system from string import split, atoi, whitespace, strip from sys import stdout, stdin, exit list = [] num = 0 mailqf = popen("mailq | tr -s '\n'",'r') rawoutput = mailqf.readlines() mailqf.close() for i in range(len(rawoutput)): if rawoutput[i][1] in whitespace: strinf = strip(str(rawoutput[i])) print chr(9)+strinf else: num = num + 1 stdout.write(str(num)+' : '+str(rawoutput[i])) list.append(split(rawoutput[i])[2]) stdout.write('Which message should be deleted: ') chr = stdin.readline()[:-1] if chr == '': exit(1) else: chr = atoi(chr) print chr,list[chr-1] if ((chr < 0) or (chr > len(list))): exit(2) else: exitval = system("exim -Mrm " + list[chr-1]) exit(exitval)
Attachment:
pgpd3ifTMzuGu.pgp
Description: PGP signature