473,467 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP email parser?

Before I laboriously write one, I was trying to find a PHP script that
would take an email spool file and parse it, putting each part into an
array (including attachments).

The eventual goal would be to take each individual array element and put
them into a MySQL database.

I've searched a bit and can't find one. Anyone know of one?
--
[ Sugapablo ]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
[ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

Jul 17 '05 #1
5 8607
Sugapablo <ru**@removesugapablo.com> wrote:
Before I laboriously write one, I was trying to find a PHP script that
would take an email spool file and parse it, putting each part into an
array (including attachments).


An email spool file... what do you mean with that? IMHO email spool
files are things you shouldn't touch since they are under control of a
smtpd. And I guess that the spoolfiles are different for different
smtp daemons.

Jul 17 '05 #2
On Sat, 23 Apr 2005 12:38:38 +0000, Daniel Tryba wrote:
An email spool file... what do you mean with that? IMHO email spool
files are things you shouldn't touch since they are under control of a
smtpd. And I guess that the spoolfiles are different for different
smtp daemons.


Excuse me. I mean more properly, the mbox files stored in your $HOME
directory for apps like pine.
--
[ Sugapablo ]
[ http://www.sugapablo.net <--personal | http://www.sugapablo.com <--music ]
[ http://www.2ra.org <--political | http://www.subuse.net <--discuss ]

Jul 17 '05 #3
Sugapablo <ru**@removesugapablo.com> wrote:
An email spool file... what do you mean with that? IMHO email spool
files are things you shouldn't touch since they are under control of a
smtpd. And I guess that the spoolfiles are different for different
smtp daemons.


Excuse me. I mean more properly, the mbox files stored in your $HOME
directory for apps like pine.


The IMAP module could be used AFAIK (according to the imap_open user
notes by supplying an absolute path to the mbox). imap_structure can be
used to construct the array you need.

But also I remember Manuel Lemos posting some class to do this to a
similar question.

Jul 17 '05 #4
On Sat, 23 Apr 2005 09:15:43 -0400, Sugapablo wrote:
On Sat, 23 Apr 2005 12:38:38 +0000, Daniel Tryba wrote:
An email spool file... what do you mean with that? IMHO email spool
files are things you shouldn't touch since they are under control of a
smtpd. And I guess that the spoolfiles are different for different
smtp daemons.


Excuse me. I mean more properly, the mbox files stored in your $HOME
directory for apps like pine.


Try with Mail_Mime PEAR package. They also have an example.

--
Egoist: A person of low taste, more interested in themselves than in me.

Jul 17 '05 #5
Sugapablo wrote:
Before I laboriously write one, I was trying to find a PHP script that would take an email spool file and parse it, putting each part into an array (including attachments).

The eventual goal would be to take each individual array element and put them into a MySQL database.

I've searched a bit and can't find one. Anyone know of one?


http://www.php.net/mailparse

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Jul 17 '05 #6

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

Similar topics

3
by: Stuart D. Gathman | last post by:
Running the following with Python 2.2.2: from email.Parser import Parser txt = """Subject: IE is Evil Content-Type: image/pjpeg; name="Jim&amp;&amp;Jill" <html> </html> """
1
by: Thomas Williams | last post by:
Thanks, I tried it and it stop at: f = file("mail.txt") with the error message. TypeError: 'str' object is not callable Tom Williams
4
by: Paul Schmidt | last post by:
Dear list: I am new to python, and I am trying to figure out the short answer on something. I want to open a POP3 mailbox, read the enclosed mail using the POP3 module, , and then process it...
0
by: prefetch | last post by:
hi people - i'm new to python, but i'm quickly becoming a fan. i'm using BaseHTTPServer and wrote a do_POST method, which i'd like to read posted files and write them to disk. seems like it...
0
by: Barry Warsaw | last post by:
Python 2.4 final will probably be released in a few hours so this seems like a good time to release the standalone email package, version 3.0 final. Unless there's some last second snafu, this...
1
by: Karalius, Joseph | last post by:
Can anyone explain what is happening here? I haven't found any useful info on Google yet. Thanks in advance. mmagnet:/home/jkaralius/src/zopeplone/Python-2.3.5 # make gcc -pthread -c...
0
by: Andrey Smirnov | last post by:
I am getting the following traceback after upgrading my app to Python 2.4.1. It's telling me that there is an error in Parser.py. It tells me that 'fp.read(8192)' is given 2 arguments, but it is...
0
by: Li-fan Chen | last post by:
Hi, We work with email in a large CRM solution and one of the email-related tasks that has plagued us is our decision to make use of a 3rd-party local-sourcer to work on the parsing of inbound...
1
by: mneagul | last post by:
Hello, I want to use email.Parser for parsing some email messages but I have a small problem: it is very, very slow... For 110MB of email messages it takes ~29-30 seconds for parsing. Do you...
0
by: UncleRic | last post by:
Environment: Mac OS X (10.4.10) on MacBook Pro I'm a Perl Neophyte. I've downloaded the XML::Parser module and am attempting to install it in my working directory (referenced via PERL5LIB env): ...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.