Newbie question: SMTP -> SQL Server

Larry Bates larry.bates at websafe.com
Thu Jan 11 18:33:17 EST 2007


Steve Holden wrote:
> 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
> client.
> 
> 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.
> 
> regards
>  Steve

Good advice.

BTW-You can use dbi and odbc modules to work with SQL server without
purchasing anything.



More information about the Python-list mailing list