Created
August 20, 2013 12:10
-
-
Save voda/6280585 to your computer and use it in GitHub Desktop.
fakemail for php to store emails to imap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
/** | |
* save as /opt/fakemail-imap.php | |
* set execute bit: chmod +x /opt/fakemail-imap.php | |
* add to php.ini: sendmail_path = /opt/fakemail-imap.php | |
*/ | |
$params = array( | |
'mailbox' => '{localhost}INBOX', // see http://php.net/manual/en/function.imap-open.php | |
'user' => '', | |
'password' => '', | |
); | |
$message = file_get_contents("php://stdin"); | |
$imap = imap_open($params['mailbox'], $params['user'], $params['password']); | |
imap_append($imap, $params['mailbox'], $message); | |
imap_close($imap); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment