Topic: fetching mail with php
==== Required information ====
- iRedMail version: 0.8.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: CentOS 6
- Related log if you're reporting an issue:
====
Hi.
I want to be able to retrieve mails with a php script (for support panel) but i'm having a hard time getting it to work with iredmail.
it goes wrong in the part where it is supposed to go to inbox
Error: Unable to access mail: Can't open mailbox {mailserver:port:}: invalid remote specification[
(mailserver:port stands instead of actual info)
Code:
---------------------------------------------------------------------------
$hostname = '{'.imapserver.':'.imapport.':'.imapauth.'}';
$parse=array();
$deletemail=false;
$inbox = imap_open($hostname, imapuser, imappw) or die('Unable to access mail: ' . imap_last_error());
$emails = imap_search($inbox,'UNSEEN');
if($emails) {
Could someone help out modifying this code to make it work ?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.