Newbie question: SMTP -> SQL Server

Steve Holden steve at
Thu Jan 11 17:43:54 CET 2007

jrpfinch wrote:
> Thank you.  I have just realised I completely misunderstand how SMTP
> servers work.  From what I can tell, when you run the cookbook script
> it listens locally on port 8025.
> You then have to configure a Linux (in my case) account with a username
> and password so my external piece of software (on another Windows
> machine) can log in and use the SMTP server.
> Then I write the some code in the cookbook example to redirect any mail
> content to the MS SQL server database.
> Note that the external piece of software can only talk SMTP - this is
> why I am having to develop this script.
> Does this sound sensible?  Any tips on how to configure my Linux box (I
> don't have much experience with Linux either)?
> Many thanks
> Jon
Presumably you can configure the external piece of software at least to 
the extent of setting the email address it delivers to?

In that case it will be *much* simpler to set up an account on a mail 
server to receive these emails. That way the server will be available 
whenever the SMTP-based sender wants or needs to send mail, and you can 
use Python to collect the emails in batched using the POP protocol, as a 

Once you receive the email messages then yes, it's perfectly practical 
to save the content in a SQL server database. mxODBC is one possible 
driver package (though it requires you to purchase a license for 
commercial use), and I seem to remember there's another one called 
adodbapi that is open source. There are almost certainly others, but 
it's a while since I used SQL Server with Python.

Steve Holden       +44 150 684 7255  +1 800 494 3119
Holden Web LLC/Ltd
Skype: holdenweb
Blog of Note:

More information about the Python-list mailing list