开发者

Easiest way to programmatically create email accounts for use by web app?

I have a web app that create groups. Each group gets their own discussion board.

I would like to add the feature of allowing users to send emails to their "group" within the web app to start a new discussion or reply to an email from the "group" to make a new post in an already ongoing discussion.

For example, to start a new discussion a user would send:

From: BillFake@gmail.com

To: group1@example.com

Su开发者_如何学编程bject: Hey guys! Meet up on Tuesday?

Body: Yes? No?

All members of the group would receive an email:

From: BillFake@gmail.com

Subject: Hey guys! Meet up on Tuesday?

Body: Yes? No?

Reply-To: group1@ example.com

And, the app would start a new discussion with:

Author: Bill Fake

Subject: Hey guys! Meet up on Tuesday?

Body: Yes? No?

This is a pretty standard feature for Google Groups and other big sites. So how do us mere mortals go about implementing this? Is there an easy way?

Or do I:

1. Install postfix

2. Write scripts to create new accounts for each new group

3. Access the server periodically via pop3 (or imap?) to retrieve the email messages sent to each account?

4. Parse the message for content

If it's the latter, did I miss a step?


Configure your mail server to run on a database backend (such as MySQL), then you can just insert records from your app to create mail accounts.

I'm not sure if you can make it deliver messages into a MySQL table as well. You might need to access it via IMAP, or perhaps just access the Maildirs directly with Python's Maildir support.

The advantage of IMAP though, is that you could use IMAP notify to save some polling. But I suppose you could use inotify (or something similar) for Maildirs as well.

Since you're using Python, I also recommend taking a look at Lamson. Maybe look into mailman since what you're doing sounds vaguely mailinglistish (but I've heard horror stories about mailman).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜