Has anyone had experience setting up/configuring mail system (reading mails) using Laminas framework on Linux?
My system info: CentOS 8, PHP 7.4.27, Elgg 4.0.0
I have mail system (postfix and dovecot) on my server to store enqueued notification messages. I want to fetch/read those messages. Below are what I have been trying but not working:
1. IMAP
$mail = new Laminas\Mail\Storage\Imap([
'host' => 'localhost',
'username' => 'name_of_mail_account',
'password' => 'password_of_mail_account',
'port' => 143
]);
$messages = $mail->getMessages( );
$messages are empty or have 0 message
2. Maildir
$mail = new \Laminas\Mail\Storage\Maildir([
'dirname' => '/home/mail_owner_account/mail/.imap/INBOX'
]);
$messages = $mail->getMessages( );
error_log('Message count: ' . $message);
It does not even get to the error_log( ) line
Advice and suggestions would be very much appreciated!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- seri_ng@seri_ng
seri_ng - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- seri_ng@seri_ng
seri_ng - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- seri_ng@seri_ng
seri_ng - 0 likes
You must log in to post replies.What do Elgg and notifications have to do with it?
I have a plugin to read enqueued notification messages on Elgg 2's and Elgg 3's servers. The plugin uses Zend Mail framework to fetch/read mail messages. Since Elgg 4 replaces Zend framework with Laminas framework, I want to update my plugin to work with Elgg 4 environment.
Does your plugin save messages to a local folder on your server?
I believe it does (I am not the person who wrote this plugin) because there is a function to read messages from the local account's mail folder
I've never encountered this because all messages and notifications are stored in the database...
My apologies for confusing you with this discussion thread. The mentioned plugin stores only incoming messages sent from mail services (Outlook, Gmail, etc.) when users reply to the notification emails that they received from my Elgg servers.
Thank you for being patient with me and sorry for the confusion again!