Hi there,for our ticket system, we pre-sort incoming mails to one of several shared IMAP folders, which correspond to different working groups / OSticket topics.Below comes a small code hack that allows to specify the IMAP folder to fetch mail from. In our case, there are several email "accounts" in OSticket that share the same credentials, but use separate folders for mail inflow and process mails in different ways, depending on the folder that the mail was sorted into.include/class.mailfetch.php, around line 130: function open($box='') {
if ($this->mbox)
$this->close();
if ( $box == '' ) {
if ( isset($this->ht) ) {
$box = $this->ht;
} else {
$box = "INBOX";
}
}and function MailFetcher (ca. line 56): //Max fetch per poll
if(!$this->ht || !is_numeric($this->ht))
$this->ht = 20;
if ( ! isset($this->ht) ) {
if ( FALSE !== ( $p = strpos($this->ht, '/') ) ) {
$this->ht = substr($this->ht,$p+1);
$this->ht = substr($this->ht, 0, $p);
}
}After applying these additions, specify (optional) the folder to use right after the servername in the IMAP configuration, like mail.example.com/foldername (append / and the foldername to the server name). Note that sometimes, folders are children of e.g. Inbox, so maybe something like mail.example.com/INBOX.foldername or mail.example.com/inbox/foldername is needed, depending on your setup.Comments welcome.