How to mark a single message as Spam in Horde
I was searching Google on how to mark an individual item as Spam in Horde using cPanel. The first query leads me to cpanel.net's e-mail discussion forum where someone asked the question and was told it wasn't possible. I figured I'd let you know that this is possible to do with Horde and cPanel, just in case anyone else comes here looking for the answer and thinks it cannot be done. It does involve a little bit of work. This is how I did it:
We need to create a Horde overlay file so when cPanel updates Horde, our changes to the configuration file doesn't get erased. I did this by creating the appropriate directories under the /tmp/ directory (via an SSH shell).
Then I created the backends.local.php file under that directory:
I added this to that file (you can just copy and paste it)
You can save the file (ctrl-x and then 'y' when it asks if you want to save). After that, you need to copy the file to the horde config directory for changes to take effect.
Afterwards, log into your Horde webmail user interface to make sure it's working. If it's not, double check everything or write here. If it does work, then you need to create the overlay.tar.gz file and copy it to the /var/cpanel/horde/ directory
When cPanel updates Horde, it'll first remove the /usr/local/cpanel/base/horde directory, replace it with the new version, and then uncompress the overlay.tar.gz archive into the /usr/local/cpanel/base/horde directory. Your backends.local.php file will be put into that directory and you should always see the button in Horde to report individual and selected e-mails as Spam. The last step you should take is cleaning up the /tmp directory.
I hope this helps other cPanel users who come here looking for a way to add the Spam button. I'd like to add that I got the format of the backends.local.php config file from the Horde mailing list. I just modified it a bit to work with cPanel. Thanks!
mkdir -p /tmp/horde/imp/config
Then I created the backends.local.php file under that directory:
nano -w /tmp/horde/imp/config/backends.local.php
I added this to that file (you can just copy and paste it)
= array(
// Disabled, we will use the Advanced IMAP Server instead
'disabled' => true,
'name' => 'IMAP Server',
'hostspec' => 'localhost',
'hordeauth' => 'full',
'protocol' => 'imap',
'port' => 143,
// Plaintext logins are disabled by default on IMAP servers (see RFC 3501
// [6.2.3]), so TLS is the only guaranteed authentication available by
// default.
'secure' => 'tls',
);
// POP3 server
$servers['pop"> = array(
// Disabled by default
'disabled' => true,
'name' => 'POP3 Server',
'hostspec' => 'localhost',
'hordeauth' => false,
'protocol' => 'pop',
'port' => 110,
// Default to secure TLS authentication by default (see RFC 2595 [4]).
'secure' => 'tls',
);
// Advanced IMAP Server
$servers['advanced"> = array(
// Enabled (with 'Spam' button)
'disabled' => false,
'name' => 'Advanced IMAP Server',
'hostspec' => 'localhost',
'hordeauth' => 'full',
'protocol' => 'imap',
'port' => 143,
'secure' => 'tls',
'maildomain' => '',
'smtp' => array(
// 'auth' => true,
// 'debug' => false,
// 'horde_auth' => false,
// 'host' => 'smtp.example.com',
// 'localhost' => 'localhost',
// 'password' => null,
// /* Mail from a MUA SHOULD be sent via the mail submission port (587)
// * rather than the MTA port (25). Note that mail submission
// * REQUIRES some method of authentication (whether explicit
// * user/password credentials or configuring the mail submission
// * agent to automatically authenticate this host based on the
// * network location). */
// 'port' => 587,
// 'username' => null
),
'spam' => array(
'innocent' => array(
'display' => true,
//
// // Email reporting driver
// 'email' => null,
// 'email_format' => 'digest',
//
// // Null reporting driver
// 'null' => true,
//
// // Program reporting driver
'program' => '/usr/local/cpanel/3rdparty/bin/spamc -C revoke -u %l',
),
'spam' => array(
'display' => true,
//
// // Email reporting driver
// 'email' => null,
// 'email_format' => 'digest',
//
// // Null reporting driver
// 'null' => true,
//
// // Program reporting driver
'program' => '/usr/local/cpanel/3rdparty/bin/spamc -C report -u %l',
),
// // It is possible to directly define additional spam drivers.
// // The 'drivers' array should contain a list of driver objects
// // (these classes must implement the IMP_Spam_Base class).
// 'drivers' => array(
// new IMP_Example_Spam_Driver()
// )
),
'admin' => array(
// 'user' => 'cyrus',
// 'password' => 'cyrus_pass',
// 'userhierarchy' => 'user.'
),
'acl' => true,
'cache' => false,
// 'debug' => '/tmp/imp_imap.log',
// 'debug_raw' => false,
'quota' => array(
'driver' => 'imap',
'params' => array(
'hide_when_unlimited' => true,
'unit' => 'MB'
)
),
'special_mboxes' => array(
IMP_Mailbox::MBOX_DRAFTS => 'INBOX.Drafts',
IMP_Mailbox::MBOX_SENT => 'INBOX.Sent',
IMP_Mailbox::MBOX_SPAM => 'INBOX.Spam',
// IMP_Mailbox::MBOX_TEMPLATES => 'INBOX.Templates',
IMP_Mailbox::MBOX_TRASH => 'INBOX.Trash',
// IMP_Mailbox::MBOX_USERSPECIAL => array(
// 'Example' => _("Example Special Mailbox")
// )
),
'autocreate_special' => true,
);
You can save the file (ctrl-x and then 'y' when it asks if you want to save). After that, you need to copy the file to the horde config directory for changes to take effect.
cp -p /tmp/horde/imp/config/backends.local.php /usr/local/cpanel/base/horde/imp/config/
Afterwards, log into your Horde webmail user interface to make sure it's working. If it's not, double check everything or write here. If it does work, then you need to create the overlay.tar.gz file and copy it to the /var/cpanel/horde/ directory
cd /tmp
tar -czvf /var/cpanel/horde/overlay.tar.gz horde
When cPanel updates Horde, it'll first remove the /usr/local/cpanel/base/horde directory, replace it with the new version, and then uncompress the overlay.tar.gz archive into the /usr/local/cpanel/base/horde directory. Your backends.local.php file will be put into that directory and you should always see the button in Horde to report individual and selected e-mails as Spam. The last step you should take is cleaning up the /tmp directory.
rm -rf /tmp/horde
I hope this helps other cPanel users who come here looking for a way to add the Spam button. I'd like to add that I got the format of the backends.local.php config file from the Horde mailing list. I just modified it a bit to work with cPanel. Thanks!
-
Hello, Thank you for providing the workaround. I've moved this thread to our "Workarounds" forum. You may also want to open a feature request if you'd like to see this functionality included with the version of Horde provided with cPanel: Submit A Feature Request Thanks! 0 -
Thanks @cPanelMichael. I created the feature request ( Add "Spam" button to Horde so users can mark individual messages as spam ). It's awaiting moderation. If you, or any other cPanel moderators feel that it can be worded better, please feel free to edit it. Thanks. 0
Please sign in to leave a comment.
Comments
2 comments