[fetchmail]PopDel.py patch

Joshua Crawford mortarn_lists@yahoo.com.au
Tue, 16 Nov 2004 19:17:17 +1100


--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

* Matthias Andree <ma@dt.e-technik.uni-dortmund.de> [2004-11-16 01:11 +0100=
]:
> Joshua Crawford <mortarn_lists@yahoo.com.au> writes:
>=20
>> I tried sending this patch 4 days ago, before I'd subscribed to the list=
=2E I
>> received an automated message saying it was being held for review by the
>> moderator. As it hasn't appeared here yet, and 4 days is close enough to
>> forever in the online world :), perhaps it was lost in a spam filter or
>> something. My apologies to the moderator if he's just busy or
>> something.
>=20
> G'day Joshua,

G'day Matthias.

> long time no see! I'd indeed think ESR is "busy"...

Heh.

> I take it that you've debugged the new PopDel.py because you weren't
> satisfied with the prior version?

# 	Out of range error fixed

The prior version didn't work. The choice variable was initialised to the
wrong value, so the user was never prompted for the message to delete, it
just tried to delete the last one straight away. But, luckily, there was
another error that meant it actually tried to delete the message after the
last one, which obviously can't exist.

#	Allow for all caps SUBJECT:

Many viruses have this, and they're the ones we want to delete.

#	Display email address

Makes things clearer when checking multiple accounts.

#	Don't prompt for save if no changes
#	Don't clear the screen until we're displaying a menu

Cosmetic.

#	Check for invalid choice
#	Check all arguments exist
#	Check for errors in POP

Error-checking.

#	Return 1 on errors, 0 otherwise

Again for checking multiple accounts. E.g, I run
 python PopDel.py pop.mail.yahoo.com.au joshua_gordon_crawford <password> &=
& \
 python PopDel.py pop.mail.yahoo.com.au mortarn_cash <password> && \
 python PopDel.py pop.mail.yahoo.com.au mortarn_lists <password> && \
 python PopDel.py pop.mail.yahoo.com.au mortarn_usenet <password>
whenever fetchmail warns me there's oversize messages on yahoo. If yahoo's
inaccessible (maybe I went offline in the meantime), it only trys to connect
once.

> I'm asking because I wouldn't want to commit untested code to the SVN
> repository.

I wouldn't submit untested code.

> I figured one typo at superficial inspection, "n" missing in username:
>=20
>> +		if (len(sys.argv) < 4):
>> +			print 'Usage: ' + sys.argv[0] + ' pop3.host.name userame password'

Oops.

> Please post further code snippets to the fetchmail-devel list,
> subscription info at http://developer.berlios.de/mail/?group_id=3D1824

Okay, will do. That one isn't linked from the catb.org webpage. It says to
"discuss fixes and improvements in fetchmail and help co-develop it" here.
--=20
Joshua 'bruce' Crawford ... http://www.geocities.com/mortarn

Don't worry if you're a kleptomaniac, you can always take something for it.

--LZvS9be/3tNcYl/X
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBmbeNfNeFlNwRVjIRAlTCAKC2JyBN/eGuG6yWyhc5X+41BkCDyACg4s7V
4aKuNg57tlJSnNZ562PXOO8=
=It3z
-----END PGP SIGNATURE-----

--LZvS9be/3tNcYl/X--