> There is no such tihing as an imap-file. IMAP is a network protocol to
access a mailbox, how the mail is stored is up to the imapd.
The file you have might be in a mbox format, but why don't you describe
the layout?
Well, all the emails are stored as seperate files on the server.
The whole idea is to store the body text of all incoming and outgoing emails
in a PostgreSQL database, together with the relevant information about that
email. (date, time, subject etcetera)
I've made a bash-script to copy the new emails every minute and several
functions in plpgsql to store these emails in the database. That works all
fine. The problem is to translate the qouted-printable bodies into normal
ASCII. I've been working on it for 2 days and I can't manage it to get it
perfect.
In PHP there are several functions who can do the work for me.
Maybe it's a better idea to start all over again and read the new messages
in PHP directly from the IMAP-server and skip the plpgsql-part.
Maybe I should do it as follows:
1. Create e new mail-account
2. Copy all new emails evey minute to the directory of that account
3. Read all new messages from that account with PHP
4. Store 'mail addres from', 'mail address to', 'subject', 'date', 'time'
and 'body text' into the PostgreSQL-database.
What do you think?
Is there a way to read both the text/plain and the text/html part in PHP ?
Thanks.
Regards,
Joachim