Jump to content

IMAP parsing


rbrown

Recommended Posts

I'm using imap_open and when I use imap_headerinfo and output the info, I want to be able to have an array of words to match the fromaddress to.... case-insensitive.

 

I tried ton of different ways...

array_search

array_filter

stripos

stristr

And tried adding strtolower in a few

Tried setting the object as a var and comparing it that way...

 

but it either chokes on the object or the array... Or ignores it completely

For example setting an array like this:

$blacklist_array = array("wl_partners@cupid.com", "Replica Shop", "CJ Adams", "eharmony", "Dr.Maxman", "Credit Check");

 

And the fromaddress has this in it:

Credit Check <check@iamaspammer.com>

 

I can't get it to work to match the Credit Check only part.

 

I got it to work if I do a foreach through the messages and then a foreach through the array then process a good or bad result, but it takes too long if there are a ton of messages to process...

 

The code is a mess right now with all the trial and errors.

 

Any ideas?

I'm kinda brain dead at this point and have been up way to long...

 

Thanks...

 

 

 

 

 

 

 

Link to comment
Share on other sites

I already tried that...

At the point I wrote it I was pretty tired of messing with it...

 

As usual I'm trying to do something that many people don't because it is too difficult... and when they figure it out they won't share it because it was a pain to write...

 

So I'm doing it a different way...

Because I really want the smtp server ip address as well as the email address.

I'm trying to write a mailwasher type program but run it as a cron job on my server.

I have an email address since 1998 and I'm on so many spam lists I get over 800 a day and I run mailwasher pro on my laptop (an old version. when I bought it was supposed to get lifetime updates but that only lasted for 4 years... apparently Firetrust didn't expect you to live that long... lol Now you have to pay...), but I have to manually process the emails. I'm getting tired of it.

I did have software on my dedicated server to do it, but I moved to a shared hosting so I don't have control of the server, so... I'm reinventing the wheel... lol

 

I'm going to use imap_fetchheader and figure out how to parse it in a usable form since each email can have different number of lines...

So I'll need to look at a bunch of emails and decide on how I'm going to split it up...

exploding with the\n doesn't really give you any thing useable since some parts of the email can be multi line.

 

Thanks...

Bob

Link to comment
Share on other sites

but I have to manually process the emails. I'm getting tired of it.

..., so... I'm reinventing the wheel

 

just for curiosity... how much time are you investing in doing all of that?.... how much is the cost of your time?... asking just because a lifetime license of the product that you mentioned cost only around $80  ... your time/efforts worth less than that? ... I probably could understand your effort if they are for your own learning experience... otherwise... well... you got the idea.

Link to comment
Share on other sites

1) that is the problem with the world today...

throw stuff away instead of fixing it...

I use the account for business so changing would be a huge pain...

Because there are too many people out there that have it.

 

2) I'm planning on selling the the script... so my time spent on this is irrelevant and besides it is the principle of not not keeping your promise in business or in life in general... That is another problem with the world today.... And that is why I won't give them any more money.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.