Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have written a forum application and I want to create message boxes for each user.

For example, user member name is Osama his mail box will be osama@mysite.com.

I have installed postfix on my server and converted imap users to MySQL.

I have a table named users containing their mail addresses and passwords

I want import their messages to the database.

The normal way to get the messages is connect to imap and get the user messages.

But I want to make it like users and create table named messages to contain user messages

Then to get messages for a user I would do:

mysql_query("SELECT * FROM messages where mail = $user_mail);

Is there any way to do the import from the mail server using cron jobs or something in postfix?

share|improve this question

migrated from stackoverflow.com Sep 18 '11 at 23:07

This question came from our site for professional and enthusiast programmers.

1 Answer 1

It can be done, but you cannot do it only by configuration magic. If you check out the documentation on how Postfix delivers mails you see that it uses delivery agents for storing incoming mails in different places depending on your configuration.

So basically you need to create a new application/script that takes input message with all the data from Postfix's local(8) and stores this data in database.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.