473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Extract email-body from IMAP-file

Is it possible to extract the email-body from a IMAP-mail-file ?

The function 'imap_body()' expects that I'm connected to an IMAP-server, but
I'm not. I just have the file.

So I'm looking for a possiblity to use imap_body and give the name of the
file as a parameter.

Thanks in advance.

Regards,

Joachim


Jul 17 '05 #1
3 4358
Joachim Smit <jo*****@onzin.abc> wrote:
Is it possible to extract the email-body from a IMAP-mail-file ?


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?

--

Daniel Tryba

Jul 17 '05 #2
> 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


Jul 17 '05 #3
> Is there a way to read both the text/plain and the text/html part in PHP ?

It all works fine now.

Regards,

Joachim


Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Don Crossman | last post by:
Assume a MYSQL table, foo. One column, bar datetime. Two rows: 2004-01-01 08:00:00 2004-02-01 08:00:00 select * from foo where extract(day from bar)=1; 2 rows in set...
1
by: Tim Smith | last post by:
I am looking to extract form element values from html, more generally I have a substring that identifies the beginning of a value and a string that identifies the end of value and I need to extract...
2
by: Darren Ferguson | last post by:
Hey all I am trying to extract the epoch from a timestamp variable in plpgsql. The function is as follows: create or replace function test() returns integer as ' declare _test timestamp with...
10
by: Robert Schultz | last post by:
I have a C/C++ file that I simply want to 'extract' a function from. Something like: extract <function name> <c or cpp file> I want it to return from the beginning of the function, to the end. ...
1
by: Scott Andrew | last post by:
I have my app extracting thumbnails nicely for video and images. I have noticed however that for video there are 5 threads added everytime I call extract. And those threads never go away. Also the...
3
by: jarod1701 | last post by:
Hi, I'm currently trying to create a regular expression that can extract certain elements from a url. The url will be of the following form: http://user:pass@www.sitename.com I want a...
9
by: Brian Hanson | last post by:
Hi, I have an unusual problem that just showed its ugly head at a pretty bad time. I have an asp.net (VB) app that takes data from an Excel sheet and puts it into SQL Server. I get the data...
9
by: chrisspencer02 | last post by:
I am looking for a method to extract the links embedded within the Javascript in a web page: an ActiveX component, or example code in C++/Pascal/etc. I am looking for a general solution, not one...
9
by: flit | last post by:
Hello All, Using poplib in python I can extract only the headers using the .top, there is a way to extract only the message text without the headers? like remove the fields below: "...
1
by: rcamarda | last post by:
I'd need to have a function that allows me to extract 'fields' from within the string I.E. (kinda pseudo code) declare @foo as varchar(100) set @foo = "Robert*Camarda*123 Main Street" select...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.