[Tutor] "Hidden" stmpd module with Python 2.1?

Scot Stevenson scot@possum.in-berlin.de
Tue, 14 May 2002 01:21:35 +0200


Hello Kalle, 

> If you have the time, I'm sure some contributed documentation would be
> appreciated.

Well, after going thru the code I'm not sure that it is acutally intended 
for general use yet. You might want to take a look at lines 237 to 239 - 
personally, I think it is funny as hell, but then not everybody might, 
especially if their address contains a 'stimpy'. 

Or, er, am I missing a joke here?

> As an aside, I think you'd be better off by using a well tested SMTP
> daemon with a large user base than rolling your own.  I use Postfix,
> and I'm happy with it.  Many use sendmail, though, and I'd be a bit
> surprised if the lost mail was really caused by a sendmail bug.

Of course you right, but then I'm using my fury over having lost mail to 
constructive ends like learning more about SMTP. This is better than, say, 
taking a large axe to my modem. 

What seems to have happened (the exact details are not clear) is that 
while configuring the firewall and other security stuff, I screwed up 
either in /etc/hosts.allow or /etc/inetd.conf. So when sendmail got the 
mail that comes in from uucico (yeah, I'm one of those people) via rmail, 
sendmail didn't know where to put it. Now, I would expect sendmail to at 
least save it to some backup file somewhere, but no, it did a "panic" on 
me and "lost" the mail. /Wunderbar/. 

This probably doesn't qualify as a bug, but it my mind, it shouldn't have 
happened.

But my basic problem is that sendmail is so completely overkill for a 
"mail leaf node" computer that doesn't forward anything to anywhere and 
only has one provider who is the "smart host" anyway. However, most other 
programs don't support uucp (anymore), and I like to pick up my mail in 
batches without having to worry about port scans and all the other dangers 
of TCP/IP (but that is a rant for another day). 

Actually, I don't think it should be too hard to write a crude Python 
program for my special situation: 

- Address resolution for incoming mail is reducted to the question if the 
user (or an alias) is on this computer or not. Any "not" is sent back with 
an error message. 

- Use standard Unix-style mailboxes. This lets the user read his mail with 
any POP3 capable program (kmail and pine in my case). Writing to 
Unix-style mailboxes can't be an insurmoutable problem, either.

- Have the users use smtp for sending their mail. Anything that isn't 
local gets sent to the smart host, and so again address resolution is very 
basic. 

Well, there are some challenges: A surprising number of programs use the 
"mail" command that also interfaces with sendmail in some way that I don't 
think is SMTP, but that should be well documented, too. 

The real problem I see is the  interaction with uucp. Probably what you 
would end up doing is invoking uucico with "--nouuxqt" so that the mail 
stays in the queue and is not sent to rmail, which, as the man page tells 
us, is "explicitly designed for use with uucp and sendmail". Then you have 
to write a routine that converts whatever baroque format the stuff is in 
into "normal" mail that can go in a mailbox.  

I'll play around with it for a while and if anything comes out it, I'll 
let you know =8).

Y, Scot