Skip to content

bfarrgaynor/BitFunnel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Brendan Farr-Gaynor
Feb 10, 2013
60f64cb · Feb 10, 2013

History

12 Commits
Feb 10, 2013
Dec 24, 2012
Dec 24, 2012
Dec 24, 2012

Repository files navigation

In Brief

Bit Funnel is a work-in-progress small component which will pull existing attachments from a mailbox via IMAP and store them in a local target folder directory. It relies on PHP's IMAP module for I/O (http://php.net/manual/en/intro.imap.php)

I scratched this down out of necessity. I have found there were many attachment ripping functions out there, but nothing that seemed to do the job with any level of reliability. Attachments can be buried in different ways in the message body and this component takes a simple approach to try to catch them all.

Right now this is a crude proof of concept but I hope to break things down into component parts and eliminate the repitition.

Example

Simply set the configuration file with the details for your account and path to the folder you want, then create a BitFunnel(), the constructor connects to the server and starts downloading.

<?php

require("BitFunnel.php");

$myAccount = array(
	'account' => array(
		 'server' => array(
			  'host' => 'imap.gmail.com'
			, 'port' => '993'
		    , 'user' => 'youruser'
		    , 'password' => 'swordfish'
		    , 'flags' => array('imap', 'ssl')
		    , 'mailbox' => "INBOX"
		)
	   , 'savepath' => 'attachments/'
	)
);

//grab the attachments
$bitFunnel = new BitFunnel($myAccount);

?>

About

E-Mail Attachment Capture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages