Re: [exim] Saving and/or processing attachments (exim: to ex…

Top Page
Delete this message
Reply to this message
Author: John Mc Murray
Date:  
To: exim-users
Old-Topics: Re: [exim] Saving and/or processing attachments
Subject: Re: [exim] Saving and/or processing attachments (exim: to exclusive)
Wouldn't it just be easier to do this all in PHP? Have PHP log in and
fetch messages and read attachments, etc?
No need to fiddle with exim.. I think I have some basic test code lying
around somewhere if you need.




On 07/10/2013 22:18, Heiko Schlittermann - hs@??? wrote:
> Hi,
>
> Aurelin <code@???> (Mo 07 Okt 2013 17:44:03 CEST):
>> Hi all,
>>
>> My customer wants to be able to send an e-mail with an attached
>> image (up to ~2 MB) to have this posted to their website.
>> Now what I set up is a router that forwards the e-mail to a pipe and
>> then gets processed by a scrip. In order to transmit the e-mail to
>> the script, I use the $message_body and $message_body variables, but
>> here's my problem: If the attachment is bigger than ~50 KB, those
>> variables will not hold the entire e-mail text and the attachment is
>> broken (due to the attachment being sent as a base64 encoded
>> string).
> I do not understand why you use the above mentioned variables.
> If you have a pipe router, it's up to your pipe command to process the
> entire mail.
>
>      begin routers
>      ...

>
>      foo:
>          driver = pipe
>          command = /usr/local/bin/<your command here>

>
> The mail will be send to STDIN of your command. Read more details
> in the "The pipe transport" part of the spec.txt (especially about
> how to setup the user the process runs as, what to do with output on
> STDOUT/STDERR of your command.
>
> It's not up to Exim to decode/extract the message. (But Exim will do so
> as part of the mime acl processing.)
>
>> 3. Would it somehow be possible to change the attachment format from
>> a base64 encoded string to something that uses less characters?
> You're asking for less encoding characters, your lesser size of the encoded
> attachment? It's up to the sender to use some more efficient encoding
> and up to your script to decode this encoding. Exim itself should handle
> any attachment format well, even if it's binary. But a binary attachment
> violates the MIME standard, I think.
>
>      Best regards from Dresden/Germany
>      Viele Grüße aus Dresden
>      Heiko Schlittermann

>
>