Automatic email checking - best procedures/suggestions

J

Jon Clements

Hi All,

I'm hoping someone has some experience in this field and could give me
a pointer in the right direction - it's not purely python related
though. Any modules/links someone has tried and found useful would be
greatly appreciated...

I want to have an automated process which basically has its own email
account on the LAN. The basic idea is that upon receipt of an email, it
logs this in a database and then forwards the message on to 'suitable'
recipients. (Well it will do more, but this is perfect to be going on
with and buildable on...)

The database and email account are set up and working fine. Using
smtplib, imaplib or poplib I can send and receive mail - this is not a
problem. What I'm unsure of is the best way to design this. Bear in
mind that network/email server configuration changes can be made. For
instance, do I connect to the email server and keep polling it every
'n' whatever for new messages, or should I be looking to the smtpd
module and get mail via that? (or any other way?)

I think I'm basically after the best way to implement:
Email in ------> Python process ------> Email out

Cheers,

Jon.
 
J

Jorge Godoy

Jon Clements said:
problem. What I'm unsure of is the best way to design this. Bear in
mind that network/email server configuration changes can be made. For
instance, do I connect to the email server and keep polling it every
'n' whatever for new messages, or should I be looking to the smtpd
module and get mail via that? (or any other way?)

I think I'm basically after the best way to implement:
Email in ------> Python process ------> Email out

It depends on your mail server, on what you're willing to do and also on how
"locked" to your mail server you want to be.

Certainly fetching messages from your mailserver through POP3 and reinjecting
them to the correct mailaccounts will be a more portable solution than
writing, e.g., a filter to your mailserver.

On the other hand, if you need the message processed as soon as it arrives you
can make your program a filter -- or have a filter to call it somehow -- to
process the message.

Also consider the startup time of your code for each processed message,
concurrency issues, etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top