[2] | 1 | <?php |
---|
[1040] | 2 | |
---|
[2360] | 3 | /*************************************************************************** |
---|
| 4 | * Expresso Livre * |
---|
| 5 | * http://www.expressolivre.org * |
---|
| 6 | * -------------------------------------------- * |
---|
| 7 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 8 | * under the terms of the GNU General Public License as published by the * |
---|
| 9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 10 | * option) any later version. * |
---|
| 11 | \**************************************************************************/ |
---|
| 12 | |
---|
[2053] | 13 | require_once '../../header.session.inc.php'; |
---|
| 14 | |
---|
[2] | 15 | $username = $_SESSION['phpgw_info']['expressomail']['user']['userid']; |
---|
| 16 | $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; |
---|
| 17 | $imap_server = $_SESSION['phpgw_info']['expressomail']['email_server']['imapServer']; |
---|
| 18 | $imap_port = $_SESSION['phpgw_info']['expressomail']['email_server']['imapPort']; |
---|
| 19 | $msg_folder = $_GET['msg_folder']; |
---|
[205] | 20 | $msg_folder = mb_convert_encoding($msg_folder,"UTF7-IMAP", mb_detect_encoding($msg_folder, "UTF-8, ISO-8859-1", true)); |
---|
[27] | 21 | if ($_SESSION['phpgw_info']['expressomail']['email_server']['imapTLSEncryption'] == 'yes') |
---|
| 22 | { |
---|
| 23 | $imap_options = '/tls/novalidate-cert'; |
---|
| 24 | } |
---|
| 25 | else |
---|
| 26 | { |
---|
| 27 | $imap_options = '/notls/novalidate-cert'; |
---|
| 28 | } |
---|
[2] | 29 | |
---|
[205] | 30 | if (is_array($_SESSION['phpgw_info']['expressomail']['email_server'])) |
---|
| 31 | { |
---|
| 32 | $mb = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password); |
---|
[2] | 33 | |
---|
[205] | 34 | if ($mb) |
---|
| 35 | { |
---|
| 36 | $msgno = $_GET['msg_num']; |
---|
| 37 | $embedded_part = $_GET['msg_part']; |
---|
| 38 | |
---|
| 39 | $embedded_body = imap_fetchbody($mb, $msgno, $embedded_part, FT_UID); |
---|
| 40 | |
---|
| 41 | header("Content-Type: image/jpeg"); |
---|
| 42 | header("Content-Disposition: inline"); |
---|
| 43 | echo imap_base64($embedded_body); |
---|
| 44 | } |
---|
| 45 | } |
---|
[1037] | 46 | ?> |
---|