views:

177

answers:

3

I have requirement like, each user of the site will be mailing any other user and I have rules for that communication (let them aside for now). So user1 will be picking an email id like: [email protected] and will be sending an email to user2, whose email id will be like: [email protected]. Like that any number of users will be sending emails to any numbers of users. And any outsider should be able to send an email to [email protected]. My question is,So in this context, do I need to build my own smtp(setup mailing) servers. I am totally a newbie in the smtp arena. Can I achieve the email communication between the users without "mailing server" configurations? Can this be achievable?

+4  A: 

You need a mail server. Even if local email is just directly deposited into a mail directory or database somewhere, something has to be responsible for accepting email from the outside world. I recommend postfix - it's powerful but easy to set up, and the config files don't look like Klingon.

Paul Tomblin
+1  A: 

There are a few django apps out there to handle messaging between users, but the only one that seems to be active is:

django-messages

This gives you all the functionality you asked for, except for outsiders being able to send mail in to users.

This is a much harder problem and will certainly require a mail server and much custom code on your part.

Van Gale
+2  A: 

If you want users to be able to create e-mail accounts in Django, you need Django, your MTA and your IMAP/POP server to use the same user account database.

I've successfully used the following setup:

  • PostgreSQL as the user database
  • Postfix as the MTA
  • Dovecot as the IMAP server
  • a custom Django app as the user account management front-end
  • virtual mail user accounts (not using Unix accounts)

I've only used the Django admin interface to let administrators manage the mail accounts, but a management UI for users is trivial to implement as well.

Some tips and sources of information for such a setup:

  • Design your database schema carefully. I based mine on howtos mentioned below with modifications for easier Django integration.
  • Take care that all components use the same encryption for user passwords.
  • two howtos (first, second) describing how Dovecot and Postfix can authenticate users using PAM and PostgreSQL as backend
  • a howto in German for Dovecot/Postfix/PostgreSQL
  • a howto for gluing together virtual user/domain support for Debian, Postfix 2 with SMTP AUTH, SASL2 with libpam-pgsql for Postfix, PostgreSQL and Dovecot
  • the Postfix PostgreSQL howto

You might also want to check out the Virtual Mail Manager command line tool for managing domains, accounts and aliases with a Dovecot/Postfix/PostgreSQL setup.

akaihola
How do you tie up Django and Postfix(or any other MTA such as sendmail) ?
Maddy