Jump to content

nighttraindb

New Members
  • Posts

    3
  • Joined

  • Last visited

nighttraindb's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello and thanks for taking the time to respond. I see my info was to vague. Basically, this program grabs emails... removes all unimportant material for our purposes and sends the rest of the contents to a specified folder as a text file. If the file (the contents of the email says "photo msg replies" it -- should-- put that text file into the -- photo msg-- folder on our server (unfortunately it does not if the file (the contents of the email says "expired...." it should put the text file into the expired folder again unfortuantely it does not. However it does seem to put files that say facebook into the facebook folder. Supplying more content removing the private info Thank You for taking the time to look at this. The key thing is from what I see somehow it is not moving the messages to the correct folders based on the above criterior. $cron = $argv[1] == 'cron=1'; if (isset($_POST['submit']) || $cron) { $from_ts = $cron ? time() - 3600 * 2 : strtotime($_POST['from']); $to_ts = $cron ? time() : strtotime($_POST['to']); $from = date('d M Y', $from_ts); $to = date('d M Y', $to_ts); $users = $_POST['users']; $type = $cron ? 'UNSEEN' : $_POST['type']; $users = explode("\r\n", $users); $users = array_unique($users); $str = ($from == $to ? "ON \"$from\"" : "SINCE \"$from\" BEFORE \"".date('d M Y', $to_ts + 3600 * 24)."\"")." $type"; $dir_name = "$type From ".date('d-m-Y H:i', $from_ts).' To '.date('d-m-Y H:i', $to_ts); $dir = $cron ? "xxxxxxxxxxxxxxxxxxx" : "xxxxxxxxxxxx"; mkdir($dir); $cnt_files = 0; $cnt_msg = 0; foreach ($users as $u) { $check = 0; $imap = "{localhost:143/novalidate-cert}INBOX"; $mailbox = $u.'@xxxxxxxxx.com'; $mbox = imap_open($imap, $mailbox, 'xxxxxxx', OP_READONLY); $emails = imap_search($mbox, $str); $bodies = array(); $body = ''; foreach ($emails as $e) { $msg = imap_headerinfo($mbox, $e); if ($msg->udate > $from_ts && $msg->udate < $to_ts) { $text = preg_replace("/(?:\S{70,}\s*)+/is", 'Image not viewable in corrlinks', remove_facebook(imap_qprint(preg_replace("/textmessage\.org/i", "** xxxxxxxxxxxxxxxxxxxxxrvice ends Saturday 11-04-2015*** write back with UPGRADE! in the subject line", imap_fetchbody($mbox, $e, 1))))); if (!$text) continue; $subj = 'From: '.$msg->fromaddress."\nSent: ".$msg->date."\nTo: ".$msg->toaddress."\nSubject: ".$msg->subject; if (strlen($body) + strlen($text) + strlen($subj) > 6000) { $bodies[] = $body; $body = ''; } $body .= $subj."\n\n".$text."\n".str_repeat('*', 10)."\n"; $cnt_msg++; $check = 1; } } if ($check) { $bodies[] = $body; $cnt_files += count($bodies);
  2. Hello everyone, I have had assistance with this and he has done a great job. Everything works with the script -- except-- this filtering portion. Basically if it sees a specific phrase it should move the text file to a specific folder. However it is not Hoping someone can look at this snippet of coding and let me konw where they see the typo if ($check) { $bodies[] = $body; $cnt_files += count($bodies); foreach ($bodies as $i => $b) { file_put_contents("$dir/$mailbox".($i ? $i + 1 : '').'.txt', $b); if(strpos($b, 'records indicate you are sending text messages on an expired account') !== false){ file_put_contents("EXPIRED/$file_name", $content); } else if(strpos($b, 'PHOTO MSG REPLIES') !== false){ file_put_contents("PHOTO MSG/$file_name", $content); } else{ file_put_contents.....
  3. Hello everyone, whelp I attempted to post this earlier however it appears I did something wrong. So here it is again... I have a struggling business, and am hoping to provide a -- potential -- opportunity. Long story short, I have a payment screen written in PHP... and am looking to add a few items that we now offer. And could use a little / alot of help being pointed in the right direction. below is a link to the actual payment screen I am referring to I also took the liberty of downloading the folder (ssh..) to my desktop below is a listing of the contents. <removed by admin>
×
×
  • 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.