| | |
| | | #!/usr/bin/php |
| | | #!/usr/bin/env php |
| | | <?php |
| | | if (php_sapi_name() != 'cli') { |
| | | die('Not on the "shell" (php-cli).'); |
| | | } |
| | | |
| | | define('INSTALL_PATH', preg_replace('/bin\/$/', '', getcwd()) . '/'); |
| | | define('INSTALL_PATH', realpath(dirname(__FILE__) . '/..') . '/' ); |
| | | ini_set('memory_limit', -1); |
| | | |
| | | require_once INSTALL_PATH.'program/include/iniset.php'; |
| | |
| | | $from = current($IMAP->decode_address_list($headers->from, 1, false)); |
| | | |
| | | fwrite($out, sprintf("From %s %s UID %d\n", $from['mailto'], $headers->date, $headers->uid)); |
| | | fwrite($out, iil_C_FetchPartHeader($IMAP->conn, $IMAP->mailbox, $i, null)); |
| | | fwrite($out, iil_C_HandlePartBody($IMAP->conn, $IMAP->mailbox, $i, null, 1)); |
| | | fwrite($out, iil_C_FetchPartHeader($IMAP->conn, $mbox, $i, null)); |
| | | fwrite($out, iil_C_HandlePartBody($IMAP->conn, $mbox, $i, null, 1)); |
| | | fwrite($out, "\n\n\n"); |
| | | |
| | | progress_update($i, $count); |
| | |
| | | vputs("IMAP login failed.\n"); |
| | | } |
| | | |
| | | ?> |
| | | ?> |