Re: [exim] Saving and/or processing attachments

Top Page
Delete this message
Reply to this message
Author: Jasen Betts
Date:  
To: exim-users
Subject: Re: [exim] Saving and/or processing attachments
On 2013-10-07, Aurelin <code@???> wrote:
>
>> Woah. Why? If you deliver to pipe, the pipe gets the whole mail.
>> No need to invoke use of $message_body at all.
>
> Uhm, great! But how do I actually process the e-mail that is piped to
> a script?


generally using the libc-client bindings for your scripting lsanguage.

> mailpost:
> driver = accept
> local_part_prefix = post-
> domains = services.squareflo.com
> transport = send_to_script
>
> So in post_to_site.php, how would I catch the e-mail content?


something like this:


$fn=tempnam('/home/user-name/imap/','mail_');
$o=fopen($fn,'w');
       while(!feof(STDIN))
       fwrite($o,fread(STDIN,8192));
fclose($o);


$ifn=preg_replace("<^.*/imap/>","imap/",$fn);

$strm=imap_open("$ifn",'','');
if(! $strm)
        fail("can't open $ifn\n");



there's a bunch of file-permission issues.
php's "imap" module (which is a wrapper around libc-client) is unneccessarily hard to use.

The python equivalent can read from stdin.


--
⚂⚃ 100% natural