0

I'm looking to integrate a webmail system into a website I'm building. I'd basically like a webmail interface built into my existing application.

I need mail to be sent to their usernames and be read in the website. But, I'd also like users to be able to access their mail through IMAP as well. I need the user to authenticate with the mail server with their site credentials.

I know PHP can read IMAP boxes, but I'm under the impression that that's not very efficient for a large-scale multi-user environment. I know some mail daemons can store their boxes and messages in MySQL and authenticate against other systems. I'd imagine that'd be a smoother solution, no?

Any ideas on what systems to look into?

  • 1
    Why don't you try to customize SquirrelMail insted of reinventing the wheel? – lrosa Dec 06 '10 at 17:15
  • Use an IMAP server that is smart enough to maintain its index, and does caching (ie Dovecot + maildir) and the concern about IMAP efficience becomes a lot less relevant. – Zoredache Dec 08 '10 at 00:12
  • Try https://github.com/MonstaApps/PHP-IMAP-Fetcher. Pipe or fetch emails, log to MySQL, and save attachments. – Daniel Williams Dec 20 '17 at 01:09

3 Answers3

0

Most mail daemons can authenticate against other backends (MySQL, Postgres, LDAP are most common). If you are using some kind database of for site, just put correct queries in postfix config to authenticate against your site database.
Storing e-mails in database is unefficient because of additional overhead introduced. For most cases, maildir is the way to go.
IMAP handles a lot of things, including mail client concurrency, folders, deletion, authentication - reinventing most of them feels "not right".
I had run webmail for 10 000 clients using roundcube and single box with IMAP (caching imap connection using imapproxy to avoid auth overhead on each request).

Kristaps
  • 2,925
  • 16
  • 22
0

Why reinvent the wheel like Irosa said? Look into Google Apps: http://www.google.com/apps/intl/en/business/index.html

You can host all of your email there and never have to worry about server configurations, mail delivery, ports, security, etc. You can use any domain name and can customize the logo/coloring of the page.

Ben
  • 3,630
  • 17
  • 62
  • 93
0

Please refer the URL http://php.net/manual/en/book.imap.php with help of which you can integrate your Mail (IMAP) with PHP.

Gaurav Singh
  • 497
  • 2
  • 13