<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>



<p class="MsoNormal">Hi,</p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">I'm new to this list but not new to Python ... I've been on
and off coding in it for years. Still I remain just a hobbyist :)</p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">Recently my interest in Python was rekindled when I started
hosting a game I used to play (VGA Planets or VGAP) and, because I was also a
player in the same game (something frowned upon or at least viewed suspiciously
in some VGAP circles) I wanted to host the game as neutrally as possible so I
set about writing an automatic hosting (AutoHost) program. VGAP is a multi-player,
strategic, space-based play-by-email game where the host runs, generates result
(RST) files, these get sent to the players who then create turn (TRN) files, effectively
a list of commands, that they then return to the host for the next run. </p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">The general idea of my program is that AutoHost runs (on a
separate machine, Windows 200 Professional) the host, sends out the RST files to
the players and waits for them to send their TRN files back. Once a specific
time has passed or all the TRN's have come back the host runs again and in
between AutoHost sends status updates and receipts for submitted TRN's. </p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">I have had some problems ... initially I wasn't able to get mail
functioning at all and was forced to rely on three DOS command line programs
which I called by means of Python's sys (os module) function. In addition I had
a number of issues with the receipt of mail (for some reason unknown to me the
command line utility which had been working after a fashion suddenly decided to
receive attached files as uuencoded text) and I was forced to abandon it as a
means of getting the TRN's and I switched to FTP instead. The program ran as a
series of separate instances fired off by means of an external scheduler. </p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">This worked but was unsatisfactory ... broadly speaking I'm
pleased with the result but I've got a bit fired up and want to improve it. Firstly
I wanted to internalise the scheduler and have since done so using a timer
routine I found on the internet and the program now runs permanently with
events being triggered by that timer. Secondly I wanted to send &amp; receive mail
using Python's own routines ... I have been successful with SMTP sending but
receiving mail still eludes me probably because it is via POP3. Part of the
reason may be because my POP3 user isn't a single ID as such but a sub-mailbox
from my family one i.e. the VGAP user has a username of mailbox+vgap and
requires authentication. </p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">I have used the a number of variations on the following code
with no luck, even though I know there are messages in the box I get back
nothing.</p>

<p class="MsoNormal"><span style="font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>import getpass, poplib<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>M = poplib.POP3('mail.isp.net')<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>M.user(getpass.getuser())<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>M.pass_(getpass.getpass())<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>numMessages = len(M.list()[1])<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span>for i in range(numMessages):<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;&nbsp;&nbsp; </span>for j in
M.retr(i+1)[1]:<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>print j<o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;">]<span style="">&nbsp;&nbsp;&nbsp;&nbsp; </span><o:p></o:p></span></b></p>

<p class="MsoNormal"><b style=""><span style="font-size: 10pt; font-family: &quot;Courier New&quot;;"><o:p>&nbsp;</o:p></span></b></p>

<p class="MsoNormal">So, if anyone can offer any help I'd appreciate it :)</p>

<p class="MsoNormal"><o:p>&nbsp;</o:p></p>

<p class="MsoNormal">Kyu<o:p></o:p></p>

</div></div><br>
                <hr size=1> 
New Yahoo! Mail is the ultimate force in competitive emailing. Find out more at the <a href="http://uk.rd.yahoo.com/mail/uk/taglines/default/championships/games/*http://uk.rd.yahoo.com/evt=44106/*http://mail.yahoo.net/uk/">Yahoo! Mail Championships</a>. Plus: play games and win prizes.</body></html>