PHP edits to allow use of IMAP folders

rebelde

Active member
Google is going to start charging me $12/month per email address and so I want to get rid of these two:
bounces@mysite.com
unsubscribe@mysite.com

IMAP can download and view individual folders. By default, it accesses the INBOX "folder", but it can also be made to access other folders that the user has set up in the email account.

Xenforo doesn't have a "folder" config option for IMAP access for the unsubscribe and bounce email accounts. So there is no way to configure it without modifying the code (or an add-on).

To do that,
- I would change the emails to aliases of another email address (like contact-us@mysite.com)
- route those to two separate folders /bounces and /unsubscribe

What needs to be done:
- find out and tell me the PHP edits that would allow that.

The library that XF uses allows for use of different folders, but XF doesn't use it
/xenforo/src/vendor/laminas/laminas-mail/src/Protocol/Imap.php
/xenforo/src/vendor/laminas/laminas-mail/src/Storage/Imap.php

These commands will show you many of the relevant lines:
git grep INBOX
git grep Imap
git grep IMAP
git grep imap

So, as I see it, the task is:
- Find the function(s) in the laminas library that xenforo uses
- - It probably has the other map parameters (URL, username, password), but doesn't state the folder, so it defaults to INBOX.
- Figure out how to change the call of the function to use a separate folder, such as "bounced".
- Once you think you have the code figured out, test it with a real folder in an email account
- Then either give me the code changes or create an add-on.

If you think you can do this, let me know! I think it shouldn't be too hard.
 
Back
Top Bottom