Import Ruty
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
Roundcube Webmail MarkAsJunk Plugin
|
||||
===================================
|
||||
This plugin adds "mark as spam" or "mark as not spam" button to the message
|
||||
menu.
|
||||
|
||||
When not in the Junk mailbox:
|
||||
Messages are moved into the Junk mailbox and marked as read
|
||||
|
||||
When in the Junk mailbox:
|
||||
The buttons are changed to "mark as not spam" or "this message is not spam"
|
||||
and the message is moved to the Inbox
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
This plugin is released under the [GNU General Public License Version 3+][gpl].
|
||||
|
||||
Even if skins might contain some programming work, they are not considered
|
||||
as a linked part of the plugin and therefore skins DO NOT fall under the
|
||||
provisions of the GPL license. See the README file located in the core skins
|
||||
folder for details on the skin license.
|
||||
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
The default config file is plugins/markasjunk/config.inc.php.dist
|
||||
Rename this to plugins/markasjunk/config.inc.php
|
||||
|
||||
All config parameters are optional.
|
||||
|
||||
|
||||
The Learning Driver
|
||||
-------------------
|
||||
|
||||
The learning driver allows you to perform additional processing on each message
|
||||
marked as spam/ham. A driver must contain a class named markasjunk_{driver
|
||||
file name}. The class must contain 3 functions:
|
||||
|
||||
**spam:** This function should take 2 arguments: an array of UIDs of message(s)
|
||||
being marked as spam, the name of the mailbox containing those messages
|
||||
|
||||
**ham:** This function should take 2 arguments: an array of UIDs of message(s)
|
||||
being marked as ham, the name of the mailbox containing those messages
|
||||
|
||||
**init:** Optional, this function should take 0 arguments. eg: allows drivers
|
||||
to add JS to the page to control which of the spam/ham options are displayed.
|
||||
The `jsevents` driver is available to show how to use the JS events.
|
||||
|
||||
Several drivers are provided by default they are:
|
||||
|
||||
**cmd_learn:** This driver calls an external command (for example salearn) to
|
||||
process the message
|
||||
|
||||
**dir_learn:** This driver places a copy of the message in a predefined folder,
|
||||
for example to allow for processing later
|
||||
|
||||
**email_learn:** This driver emails the message either as an attachment or
|
||||
directly to a set address. This driver requires Roundcube 1.4 or above.
|
||||
|
||||
**sa_blacklist:** This driver adds the sender address of a spam message to the
|
||||
users blacklist (or whitelist of ham messages) Requires SAUserPrefs plugin
|
||||
|
||||
**amavis_blacklist:** This driver adds the sender address of a spam message to
|
||||
the users blacklist (or whitelist of ham messages) Requires Amacube plugin.
|
||||
Driver by Der-Jan
|
||||
|
||||
**sa_detach:** If the message is a Spamassassin spam report with the original
|
||||
email attached then this is detached and saved in the Inbox, the spam report is
|
||||
deleted
|
||||
|
||||
**edit_headers:** Edit the message headers. Headers are edited using
|
||||
preg_replace.
|
||||
|
||||
**WARNING:** Be sure to match the entire header line, including the name of the
|
||||
header, and include the ^ and $ and test carefully before use on real messages.
|
||||
This driver alters the message source
|
||||
|
||||
|
||||
Running multiple drivers
|
||||
------------------------
|
||||
|
||||
**WARNING:** This is very dangerous please always test carefully. Run multiple
|
||||
drivers at your own risk! It may be safer to create one driver that does
|
||||
everything you want.
|
||||
|
||||
It is possible to run multiple drivers when marking a message as spam/ham. For
|
||||
example running sa_blacklist followed by cmd_learn or edit_headers and
|
||||
cmd_learn. An [example multi-driver][multidriver] is available. This is a
|
||||
starting point only, it requires modification for individual cases.
|
||||
|
||||
|
||||
Spam learning commands
|
||||
----------------------
|
||||
|
||||
Spamassassin:
|
||||
|
||||
```sa-learn --spam --username=%u %f``` or
|
||||
```sa-learn --spam --prefs-file=/var/mail/%d/%l/.spamassassin/user_prefs %f```
|
||||
|
||||
|
||||
Ham learning commands
|
||||
---------------------
|
||||
|
||||
Spamassassin:
|
||||
|
||||
```sa-learn --ham --username=%u %f``` or
|
||||
```sa-learn --ham --prefs-file=/var/mail/%d/%l/.spamassassin/user_prefs %f```
|
||||
|
||||
|
||||
edit_headers example config
|
||||
---------------------------
|
||||
|
||||
**WARNING:** These are simple examples of how to configure the driver options,
|
||||
use at your own risk
|
||||
|
||||
```php
|
||||
$config['markasjunk_spam_patterns'] = array(
|
||||
'patterns' => array('/^(Subject:\s*)(.*)$/m'),
|
||||
'replacements' => array('$1[SPAM] $2')
|
||||
);
|
||||
```
|
||||
|
||||
```php
|
||||
$config['markasjunk_ham_patterns'] = array(
|
||||
'patterns' => array('/^(Subject:\s*)\[SPAM\](.*)$/m'),
|
||||
'replacements' => array('$1$2')
|
||||
);
|
||||
```
|
||||
|
||||
[gpl]: https://www.gnu.org/licenses/gpl.html
|
||||
[multidriver]: https://gist.github.com/johndoh/8173505
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"name": "roundcube/markasjunk",
|
||||
"type": "roundcube-plugin",
|
||||
"description": "Adds buttons to mark messages as Junk/Non-Junk with moving to the Junk folder and Spam/Ham learning.",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"version": "2.0",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Thomas Bruederli",
|
||||
"email": "roundcube@gmail.com",
|
||||
"role": "Lead"
|
||||
},
|
||||
{
|
||||
"name": "Philip Weir",
|
||||
"email": "roundcube@tehinterweb.co.uk",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"repositories": [
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://plugins.roundcube.net"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.3.0",
|
||||
"roundcube/plugin-installer": ">=0.1.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
// Learning driver
|
||||
// Use an external process such as sa-learn to learn from spam/ham messages. Default: null.
|
||||
// Please see the README for more information
|
||||
$config['markasjunk_learning_driver'] = null;
|
||||
|
||||
// Ham mailbox
|
||||
// Mailbox messages should be moved to when they are marked as ham. null = INBOX
|
||||
// set to FALSE to disable message moving
|
||||
$config['markasjunk_ham_mbox'] = null;
|
||||
|
||||
// Spam mailbox
|
||||
// Mailbox messages should be moved to when they are marked as spam.
|
||||
// null = the mailbox assigned as the spam folder in Roundcube settings
|
||||
// set to FALSE to disable message moving
|
||||
$config['markasjunk_spam_mbox'] = null;
|
||||
|
||||
// Mark messages as read when reporting them as spam
|
||||
$config['markasjunk_read_spam'] = false;
|
||||
|
||||
// Mark messages as unread when reporting them as ham
|
||||
$config['markasjunk_unread_ham'] = false;
|
||||
|
||||
// Add flag to messages marked as spam (flag will be removed when marking as ham)
|
||||
// If you do not want to use message flags set this to false
|
||||
$config['markasjunk_spam_flag'] = 'Junk';
|
||||
|
||||
// Add flag to messages marked as ham (flag will be removed when marking as spam)
|
||||
// If you do not want to use message flags set this to false
|
||||
$config['markasjunk_ham_flag'] = 'NonJunk';
|
||||
|
||||
// Write output from spam/ham commands to the log for debug
|
||||
$config['markasjunk_debug'] = false;
|
||||
|
||||
// The mark as spam/ham icon can either be displayed on the toolbar or as part of the mark messages menu.
|
||||
// Set to False to use Mark menu instead of the toolbar. Default: true.
|
||||
$config['markasjunk_toolbar'] = true;
|
||||
|
||||
// Learn any message moved to the spam mailbox as spam (not just when the button is pressed)
|
||||
$config['markasjunk_move_spam'] = false;
|
||||
|
||||
// Learn any message moved from the spam mailbox to the ham mailbox as ham (not just when the button is pressed)
|
||||
$config['markasjunk_move_ham'] = false;
|
||||
|
||||
// Some drivers create new copies of the target message(s), in this case the original message(s) will be deleted
|
||||
// Rather than deleting the message(s) (moving to Trash) setting this option true will cause the original message(s) to be permanently removed
|
||||
$config['markasjunk_permanently_remove'] = false;
|
||||
|
||||
// Display only a mark as spam button
|
||||
$config['markasjunk_spam_only'] = false;
|
||||
|
||||
// Activate markasjunk for selected mail hosts only. If this is not set all mail hosts are allowed.
|
||||
// Example: $config['markasjunk_allowed_hosts'] = ['mail1.domain.tld', 'mail2.domain.tld'];
|
||||
$config['markasjunk_allowed_hosts'] = null;
|
||||
|
||||
// Load specific config for different mail hosts
|
||||
// Example: $config['markasjunk_host_config'] = [
|
||||
// 'mail1.domain.tld' => 'mail1_config.inc.php',
|
||||
// 'mail2.domain.tld' => 'mail2_config.inc.php',
|
||||
// ];
|
||||
$config['markasjunk_host_config'] = null;
|
||||
|
||||
// cmd_learn Driver options
|
||||
// ------------------------
|
||||
// The command used to learn that a message is spam
|
||||
// The command can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %i is replaced with the email address from the user's default identity
|
||||
// %s is replaced with the email address the message is from
|
||||
// %f is replaced with the path to the message file
|
||||
// %h:<header name> is replaced with the content of that header from the message (lower case) eg: %h:x-dspam-signature
|
||||
// If you do not want to run the command set this to null
|
||||
$config['markasjunk_spam_cmd'] = null;
|
||||
|
||||
// The command used to learn that a message is ham
|
||||
// The command can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %i is replaced with the email address from the user's default identity
|
||||
// %s is replaced with the email address the message is from
|
||||
// %f is replaced with the path to the message file
|
||||
// %h:<header name> is replaced with the content of that header from the message (lower case) eg: %h:x-dspam-signature
|
||||
// If you do not want to run the command set this to null
|
||||
$config['markasjunk_ham_cmd'] = null;
|
||||
|
||||
// dir_learn Driver options
|
||||
// ------------------------
|
||||
// The full path of the directory used to store spam (must be writable by webserver)
|
||||
$config['markasjunk_spam_dir'] = null;
|
||||
|
||||
// The full path of the directory used to store ham (must be writable by webserver)
|
||||
$config['markasjunk_ham_dir'] = null;
|
||||
|
||||
// The filename prefix
|
||||
// The filename can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %t is replaced with the type of message (spam/ham)
|
||||
$config['markasjunk_filename'] = null;
|
||||
|
||||
// email_learn Driver options
|
||||
// --------------------------
|
||||
// The email address that spam messages will be sent to
|
||||
// The address can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %i is replaced with the email address from the user's default identity
|
||||
// If you do not want to send an email set this to null
|
||||
$config['markasjunk_email_spam'] = null;
|
||||
|
||||
// The email address that ham messages will be sent to
|
||||
// The address can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %i is replaced with the email address from the user's default identity
|
||||
// If you do not want to send an email set this to null
|
||||
$config['markasjunk_email_ham'] = null;
|
||||
|
||||
// Should the spam/ham message be sent as an attachment
|
||||
$config['markasjunk_email_attach'] = true;
|
||||
|
||||
// The email subject (when sending as attachment)
|
||||
// The subject can contain the following macros that will be expanded as follows:
|
||||
// %u is replaced with the username (from the session info)
|
||||
// %l is replaced with the local part of the username (if the username is an email address)
|
||||
// %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
|
||||
// %t is replaced with the type of message (spam/ham)
|
||||
$config['markasjunk_email_subject'] = 'learn this message as %t';
|
||||
|
||||
// sa_blacklist Driver options
|
||||
// ---------------------------
|
||||
// Path to SAUserPrefs config file
|
||||
$config['markasjunk_sauserprefs_config'] = '../sauserprefs/config.inc.php';
|
||||
|
||||
// amavis_blacklist Driver options
|
||||
// ---------------------------
|
||||
// Path to amacube config file
|
||||
$config['markasjunk_amacube_config'] = '../amacube/config.inc.php';
|
||||
|
||||
// edit_headers Driver options
|
||||
// ---------------------------
|
||||
// Patterns to match and replace headers for spam messages
|
||||
// Replacement method uses preg_replace - http://www.php.net/manual/function.preg-replace.php
|
||||
// WARNING: Be sure to match the entire header line, including the name of the header, also use ^ and $ and the 'm' flag
|
||||
// see the README for an example
|
||||
// TEST CAREFULLY BEFORE USE ON REAL MESSAGES
|
||||
$config['markasjunk_spam_patterns'] = [
|
||||
'patterns' => [],
|
||||
'replacements' => []
|
||||
];
|
||||
|
||||
// Patterns to match and replace headers for spam messages
|
||||
// Replacement method uses preg_replace - http://www.php.net/manual/function.preg-replace.php
|
||||
// WARNING: Be sure to match the entire header line, including the name of the header, also use ^ and $ and the 'm' flag
|
||||
// see the README for an example
|
||||
// TEST CAREFULLY BEFORE USE ON REAL MESSAGES
|
||||
$config['markasjunk_ham_patterns'] = [
|
||||
'patterns' => [],
|
||||
'replacements' => []
|
||||
];
|
||||
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* AmavisD Blacklist driver
|
||||
*
|
||||
* @version 1.0
|
||||
* @requires Amacube plugin
|
||||
*
|
||||
* @author Der-Jan
|
||||
*
|
||||
* Copyright (C) 2014 Der-Jan
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
/* # 'SELECT wb'.
|
||||
* # ' FROM wblist JOIN mailaddr ON wblist.sid=mailaddr.id'.
|
||||
* # ' WHERE wblist.rid=? AND mailaddr.email IN (%k)'.
|
||||
* # ' ORDER BY mailaddr.priority DESC';
|
||||
*/
|
||||
|
||||
class markasjunk_amavis_blacklist
|
||||
{
|
||||
private $user_email = '';
|
||||
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_list($uids, true);
|
||||
}
|
||||
|
||||
public function ham($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_list($uids, false);
|
||||
}
|
||||
|
||||
private function _do_list($uids, $spam)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$this->user_email = $rcube->user->data['username'];
|
||||
|
||||
$config_file = $rcube->config->get('markasjunk_amacube_config');
|
||||
|
||||
if (is_file($config_file) && !$rcube->config->load_from_file($config_file)) {
|
||||
rcube::raise_error([
|
||||
'code' => 527, 'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Failed to load config from $config_file"
|
||||
], true, false
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$db = rcube_db::factory($rcube->config->get('amacube_db_dsn'), '', true);
|
||||
$db->set_debug((bool) $rcube->config->get('sql_debug'));
|
||||
$db->db_connect('w');
|
||||
|
||||
$debug = $rcube->config->get('markasjunk_debug');
|
||||
|
||||
// check DB connections and exit on failure
|
||||
if ($err_str = $db->is_error()) {
|
||||
rcube::raise_error([
|
||||
'code' => 603,
|
||||
'type' => 'db',
|
||||
'message' => $err_str
|
||||
], false, true
|
||||
);
|
||||
}
|
||||
|
||||
$sql_result = $db->query("SELECT `id` FROM `users` WHERE `email` = ?", $this->user_email);
|
||||
if ($sql_result && ($res_array = $db->fetch_assoc($sql_result))) {
|
||||
$rid = $res_array['id'];
|
||||
}
|
||||
else {
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', $this->user_email . ' not found in users table');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$message = new rcube_message($uid);
|
||||
$email = $message->sender['mailto'];
|
||||
|
||||
// skip invalid emails
|
||||
if (!rcube_utils::check_email($email, false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql_result = $db->query("SELECT `id` FROM `mailaddr` WHERE `email` = ? ORDER BY `priority` DESC", $email);
|
||||
|
||||
if ($sql_result && ($res_array = $db->fetch_assoc($sql_result))) {
|
||||
$sid = $res_array['id'];
|
||||
}
|
||||
else {
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', "$email not found in mailaddr table - add it");
|
||||
}
|
||||
|
||||
$sql_result = $db->query("INSERT INTO `mailaddr` ( `priority`, `email` ) VALUES ( 20, ? )", $email);
|
||||
|
||||
if ($sql_result) {
|
||||
$sid = $db->insert_id();
|
||||
}
|
||||
else {
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', "Cannot add $email to mailaddr table: " . $db->is_error($sql_result));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$wb = '';
|
||||
$sql_result = $db->query("SELECT `wb` FROM `wblist` WHERE `sid` = ? AND `rid` =?", $sid, $rid);
|
||||
|
||||
if ($sql_result && ($res_array = $db->fetch_assoc($sql_result))) {
|
||||
$wb = $res_array['wb'];
|
||||
}
|
||||
|
||||
if (!$wb || (!$spam && preg_match('/^([BbNnFf])[\s]*\z/', $wb)) || ($spam && preg_match('/^([WwYyTt])[\s]*\z/', $wb))) {
|
||||
$newwb = 'w';
|
||||
|
||||
if ($spam) {
|
||||
$newwb = 'b';
|
||||
}
|
||||
|
||||
if ($wb) {
|
||||
$sql_result = $db->query("UPDATE `wblist` SET `wb` = ? WHERE `sid` = ? AND `rid` = ?",
|
||||
$newwb, $sid, $rid);
|
||||
}
|
||||
else {
|
||||
$sql_result = $db->query("INSERT INTO `wblist` (`sid`, `rid`, `wb`) VALUES (?, ?, ?)",
|
||||
$sid, $rid, $newwb);
|
||||
}
|
||||
|
||||
if (!$sql_result) {
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', "Cannot update wblist for user {$this->user_email} with $email");
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Command line learn driver
|
||||
*
|
||||
* @version 3.1
|
||||
*
|
||||
* @author Philip Weir
|
||||
* Patched by Julien Vehent to support DSPAM
|
||||
* Enhanced support for DSPAM by Stevan Bajic <stevan@bajic.ch>
|
||||
*
|
||||
* Copyright (C) 2009-2018 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_cmd_learn
|
||||
{
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_salearn($uids, true, $src_mbox);
|
||||
}
|
||||
|
||||
public function ham($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_salearn($uids, false, $src_mbox);
|
||||
}
|
||||
|
||||
private function _do_salearn($uids, $spam, $src_mbox)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$temp_dir = realpath($rcube->config->get('temp_dir'));
|
||||
$command = $rcube->config->get($spam ? 'markasjunk_spam_cmd' : 'markasjunk_ham_cmd');
|
||||
$debug = $rcube->config->get('markasjunk_debug');
|
||||
|
||||
if (!$command) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (strpos($command, '%h') !== false) {
|
||||
preg_match_all('/%h:([\w_-]+)/', $command, $header_names, PREG_SET_ORDER);
|
||||
$header_names = array_column($header_names, 1);
|
||||
}
|
||||
|
||||
// backwards compatibility %xds removed in markasjunk v1.12
|
||||
$command = str_replace('%xds', '%h:x-dspam-signature', $command);
|
||||
$command = str_replace('%u', escapeshellarg($_SESSION['username']), $command);
|
||||
$command = str_replace('%l', escapeshellarg($rcube->user->get_username('local')), $command);
|
||||
$command = str_replace('%d', escapeshellarg($rcube->user->get_username('domain')), $command);
|
||||
if (strpos($command, '%i') !== false) {
|
||||
$identity = $rcube->user->get_identity();
|
||||
$command = str_replace('%i', escapeshellarg($identity['email']), $command);
|
||||
}
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
// reset command for next message
|
||||
$tmp_command = $command;
|
||||
|
||||
if (strpos($tmp_command, '%s') !== false) {
|
||||
$message = new rcube_message($uid);
|
||||
$tmp_command = str_replace('%s', escapeshellarg($message->sender['mailto']), $tmp_command);
|
||||
}
|
||||
|
||||
if (!empty($header_names)) {
|
||||
$storage = $rcube->get_storage();
|
||||
$storage->check_connection();
|
||||
$headers = $storage->conn->fetchHeader($src_mbox, $uid, true, false, $header_names);
|
||||
|
||||
foreach ($header_names as $header) {
|
||||
$val = null;
|
||||
if ($headers) {
|
||||
$val = $headers->get($header);
|
||||
$val = is_array($val) ? array_first($val) : $val;
|
||||
}
|
||||
|
||||
if (!empty($val)) {
|
||||
$tmp_command = str_replace('%h:' . $header, escapeshellarg($val), $tmp_command);
|
||||
}
|
||||
else {
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', "header {$header} not found in message {$src_mbox}/{$uid}");
|
||||
}
|
||||
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (strpos($command, '%f') !== false) {
|
||||
$tmpfname = tempnam($temp_dir, 'rcmSALearn');
|
||||
file_put_contents($tmpfname, $rcube->storage->get_raw_body($uid));
|
||||
$tmp_command = str_replace('%f', escapeshellarg($tmpfname), $tmp_command);
|
||||
}
|
||||
|
||||
$output = shell_exec($tmp_command);
|
||||
|
||||
if ($debug) {
|
||||
if ($output) {
|
||||
$tmp_command .= "\n$output";
|
||||
}
|
||||
|
||||
rcube::write_log('markasjunk', $tmp_command);
|
||||
}
|
||||
|
||||
if (isset($tmpfname)) {
|
||||
unlink($tmpfname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Copy spam/ham messages to a directory for learning later
|
||||
*
|
||||
* @version 2.0
|
||||
*
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2009-2014 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_dir_learn
|
||||
{
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_messagemove($uids, true);
|
||||
}
|
||||
|
||||
public function ham($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_messagemove($uids, false);
|
||||
}
|
||||
|
||||
private function _do_messagemove($uids, $spam)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$dest_dir = unslashify($rcube->config->get($spam ? 'markasjunk_spam_dir' : 'markasjunk_ham_dir'));
|
||||
|
||||
if (!$dest_dir) {
|
||||
return;
|
||||
}
|
||||
|
||||
$debug = $rcube->config->get('markasjunk_debug');
|
||||
$filename = $rcube->config->get('markasjunk_filename');
|
||||
$filename = str_replace('%u', $_SESSION['username'], $filename);
|
||||
$filename = str_replace('%t', ($spam) ? 'spam' : 'ham', $filename);
|
||||
$filename = str_replace('%l', $rcube->user->get_username('local'), $filename);
|
||||
$filename = str_replace('%d', $rcube->user->get_username('domain'), $filename);
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$tmpfname = tempnam($dest_dir, $filename);
|
||||
file_put_contents($tmpfname, $rcube->storage->get_raw_body($uid));
|
||||
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', $tmpfname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Edit headers
|
||||
*
|
||||
* @version 1.0
|
||||
*
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2012-2014 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_edit_headers
|
||||
{
|
||||
public function spam(&$uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_edit_headers($uids, true, $dst_mbox);
|
||||
}
|
||||
|
||||
public function ham(&$uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_edit_headers($uids, false, $dst_mbox);
|
||||
}
|
||||
|
||||
private function _edit_headers(&$uids, $spam, $dst_mbox)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$args = $rcube->config->get($spam ? 'markasjunk_spam_patterns' : 'markasjunk_ham_patterns');
|
||||
|
||||
if (empty($args['patterns'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$new_uids = [];
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$raw_message = $rcube->storage->get_raw_body($uid);
|
||||
$raw_headers = $rcube->storage->get_raw_headers($uid);
|
||||
|
||||
$updated_headers = preg_replace($args['patterns'], $args['replacements'], $raw_headers);
|
||||
$raw_message = str_replace($raw_headers, $updated_headers, $raw_message);
|
||||
|
||||
$saved = $rcube->storage->save_message($dst_mbox, $raw_message);
|
||||
|
||||
if ($saved !== false) {
|
||||
$rcube->output->command('markasjunk_move', null, [$uid]);
|
||||
array_push($new_uids, $saved);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($new_uids) > 0) {
|
||||
$uids = $new_uids;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,169 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Email learn driver
|
||||
*
|
||||
* @version 3.0
|
||||
*
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2009-2017 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_email_learn
|
||||
{
|
||||
private $rcube;
|
||||
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_emaillearn($uids, true);
|
||||
}
|
||||
|
||||
public function ham($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_emaillearn($uids, false);
|
||||
}
|
||||
|
||||
private function _do_emaillearn($uids, $spam)
|
||||
{
|
||||
$this->rcube = rcube::get_instance();
|
||||
$identity = $this->rcube->user->get_identity();
|
||||
$from = $identity['email'];
|
||||
$from_string = format_email_recipient($from, $identity['name']);
|
||||
$attach = $this->rcube->config->get('markasjunk_email_attach', false);
|
||||
$debug = $this->rcube->config->get('markasjunk_debug');
|
||||
$product = $this->rcube->config->get('product_name');
|
||||
$temp_dir = unslashify($this->rcube->config->get('temp_dir'));
|
||||
|
||||
$subject = (string) $this->rcube->config->get('markasjunk_email_subject');
|
||||
$mailto = (string) $this->rcube->config->get($spam ? 'markasjunk_email_spam' : 'markasjunk_email_ham');
|
||||
$subject = $this->_parse_vars($subject, $spam, $from);
|
||||
$mailto = $this->_parse_vars($mailto, $spam, $from);
|
||||
|
||||
// no address to send to, exit
|
||||
if (!$mailto) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($uids as $i => $uid) {
|
||||
$MESSAGE = new rcube_message($uid);
|
||||
$message_file = null;
|
||||
|
||||
// set message charset as default
|
||||
if (!empty($MESSAGE->headers->charset)) {
|
||||
$this->rcube->storage->set_charset($MESSAGE->headers->charset);
|
||||
}
|
||||
|
||||
$OUTPUT = $this->rcube->output;
|
||||
$SENDMAIL = new rcmail_sendmail(null, [
|
||||
'sendmail' => true,
|
||||
'from' => $from,
|
||||
'mailto' => $mailto,
|
||||
'dsn_enabled' => false,
|
||||
'charset' => 'UTF-8',
|
||||
'error_handler' => function(...$args) use ($OUTPUT) {
|
||||
call_user_func_array([$OUTPUT, 'show_message'], $args);
|
||||
$OUTPUT->send();
|
||||
}
|
||||
]);
|
||||
|
||||
if ($attach) {
|
||||
$headers = [
|
||||
'Date' => $this->rcube->user_date(),
|
||||
'From' => $from_string,
|
||||
'To' => $mailto,
|
||||
'Subject' => $subject,
|
||||
'User-Agent' => $this->rcube->config->get('useragent'),
|
||||
'Message-ID' => $this->rcube->gen_message_id($from),
|
||||
'X-Sender' => $from
|
||||
];
|
||||
|
||||
$message_text = ($spam ? 'Spam' : 'Ham') . " report from $product";
|
||||
|
||||
// create attachment
|
||||
$orig_subject = $MESSAGE->get_header('subject');
|
||||
$disp_name = (!empty($orig_subject) ? $orig_subject : 'message_rfc822') . '.eml';
|
||||
$message_file = tempnam($temp_dir, 'rcm');
|
||||
$attachment = [];
|
||||
|
||||
if ($fp = fopen($message_file, 'w')) {
|
||||
$this->rcube->storage->get_raw_body($uid, $fp);
|
||||
fclose($fp);
|
||||
|
||||
$attachment = [
|
||||
'name' => $disp_name,
|
||||
'mimetype' => 'message/rfc822',
|
||||
'path' => $message_file,
|
||||
'size' => filesize($message_file),
|
||||
'charset' => $MESSAGE->headers->charset
|
||||
];
|
||||
}
|
||||
|
||||
// create message
|
||||
$MAIL_MIME = $SENDMAIL->create_message($headers, $message_text, false, [$attachment]);
|
||||
|
||||
if (count($attachment) > 0) { // sanity check in case creating the attachment failed
|
||||
$folding = (int) $this->rcube->config->get('mime_param_folding');
|
||||
|
||||
$MAIL_MIME->addAttachment($attachment['path'],
|
||||
$attachment['mimetype'], $attachment['name'], true,
|
||||
'8bit', 'attachment', $attachment['charset'], '', '',
|
||||
$folding ? 'quoted-printable' : null,
|
||||
$folding == 2 ? 'quoted-printable' : null,
|
||||
'', RCUBE_CHARSET
|
||||
);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$headers = [
|
||||
'Resent-From' => $from_string,
|
||||
'Resent-To' => $mailto,
|
||||
'Resent-Date' => $this->rcube->user_date(),
|
||||
'Resent-Message-ID' => $this->rcube->gen_message_id($from)
|
||||
];
|
||||
|
||||
// create the bounce message
|
||||
$MAIL_MIME = new rcmail_resend_mail([
|
||||
'bounce_message' => $MESSAGE,
|
||||
'bounce_headers' => $headers,
|
||||
]);
|
||||
}
|
||||
|
||||
$SENDMAIL->deliver_message($MAIL_MIME, $i == count($uids) - 1);
|
||||
|
||||
// clean up
|
||||
if ($message_file) {
|
||||
unlink($message_file);
|
||||
}
|
||||
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', $uid . ($spam ? ' SPAM ' : ' HAM ') . $mailto . ' (' . $subject . ')');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function _parse_vars($data, $spam, $from)
|
||||
{
|
||||
$data = str_replace('%u', $_SESSION['username'], $data);
|
||||
$data = str_replace('%t', $spam ? 'spam' : 'ham', $data);
|
||||
$data = str_replace('%l', $this->rcube->user->get_username('local'), $data);
|
||||
$data = str_replace('%d', $this->rcube->user->get_username('domain'), $data);
|
||||
$data = str_replace('%i', $from, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* MarkAsJunk JS events example
|
||||
* This is an example of how to interact with the markasjunk JS event
|
||||
* markasjunk-update to change the spam/ham options shown for specific
|
||||
* folders
|
||||
*
|
||||
* @version 0.1
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2016 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see http://www.gnu.org/licenses/.
|
||||
*/
|
||||
|
||||
class markasjunk_jsevent
|
||||
{
|
||||
private $addition_spam_folders = ['spam2', 'spam3'];
|
||||
private $suspicious_folders = ['unknown1', 'unknown2'];
|
||||
|
||||
public function init()
|
||||
{
|
||||
$rcmail = rcmail::get_instance();
|
||||
|
||||
// only execute this code on page load
|
||||
if ($rcmail->output->type != 'html') {
|
||||
return;
|
||||
}
|
||||
|
||||
$js_addition_spam_folders = json_encode($this->addition_spam_folders);
|
||||
$js_suspicious_folders = json_encode($this->suspicious_folders);
|
||||
|
||||
$script = <<<EOL
|
||||
rcmail.addEventListener('markasjunk-update', function(props) {
|
||||
var addition_spam_folders = {$js_addition_spam_folders};
|
||||
var suspicious_folders = {$js_suspicious_folders};
|
||||
|
||||
// ignore this special code when in a multifolder listing
|
||||
if (rcmail.is_multifolder_listing())
|
||||
return;
|
||||
|
||||
if ($.inArray(rcmail.env.mailbox, addition_spam_folders) > -1) {
|
||||
props.disp.spam = false;
|
||||
props.disp.ham = true;
|
||||
}
|
||||
else if ($.inArray(rcmail.env.mailbox, suspicious_folders) > -1) {
|
||||
props.disp.spam = true;
|
||||
props.disp.ham = true;
|
||||
|
||||
// from here it is also possible to alter the buttons themselves...
|
||||
props.objs.spamobj.find('a > span').text('As possibly spam');
|
||||
}
|
||||
else {
|
||||
props.objs.spamobj.find('a > span').text(rcmail.get_label('markasjunk.markasjunk'));
|
||||
}
|
||||
|
||||
return props;
|
||||
});
|
||||
EOL;
|
||||
|
||||
$rcmail->output->add_script($script, 'docready');
|
||||
}
|
||||
|
||||
public function spam(&$uids, $mbox)
|
||||
{
|
||||
// Treat message as spam...
|
||||
}
|
||||
|
||||
public function ham(&$uids, $mbox)
|
||||
{
|
||||
// Treat message as ham...
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SpamAssassin Blacklist driver
|
||||
*
|
||||
* @version 2.0
|
||||
* @requires SAUserPrefs plugin
|
||||
*
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2010-2014 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_sa_blacklist
|
||||
{
|
||||
private $sa_user;
|
||||
private $sa_table;
|
||||
private $sa_username_field;
|
||||
private $sa_preference_field;
|
||||
private $sa_value_field;
|
||||
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_list($uids, true);
|
||||
}
|
||||
|
||||
public function ham($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$this->_do_list($uids, false);
|
||||
}
|
||||
|
||||
private function _do_list($uids, $spam)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$this->sa_user = $rcube->config->get('sauserprefs_userid', "%u");
|
||||
$this->sa_table = $rcube->config->get('sauserprefs_sql_table_name');
|
||||
$this->sa_username_field = $rcube->config->get('sauserprefs_sql_username_field');
|
||||
$this->sa_preference_field = $rcube->config->get('sauserprefs_sql_preference_field');
|
||||
$this->sa_value_field = $rcube->config->get('sauserprefs_sql_value_field');
|
||||
|
||||
// SAv4 compatibility
|
||||
$blocklist_pref_name = $rcube->config->get('sauserprefs_sav4', false) ? "blocklist_from" : "blacklist_from";
|
||||
$welcomelist_pref_name = $rcube->config->get('sauserprefs_sav4', false) ? "welcomelist_from" : "whitelist_from";
|
||||
|
||||
$identity = $rcube->user->get_identity();
|
||||
$identity = $identity['email'];
|
||||
|
||||
$this->sa_user = str_replace('%u', $_SESSION['username'], $this->sa_user);
|
||||
$this->sa_user = str_replace('%l', $rcube->user->get_username('local'), $this->sa_user);
|
||||
$this->sa_user = str_replace('%d', $rcube->user->get_username('domain'), $this->sa_user);
|
||||
$this->sa_user = str_replace('%i', $identity, $this->sa_user);
|
||||
|
||||
$config_file = $rcube->config->get('markasjunk_sauserprefs_config');
|
||||
$debug = $rcube->config->get('markasjunk_debug');
|
||||
|
||||
if (is_file($config_file) && !$rcube->config->load_from_file($config_file)) {
|
||||
rcube::raise_error([
|
||||
'code' => 527, 'file' => __FILE__, 'line' => __LINE__,
|
||||
'message' => "Failed to load config from $config_file"
|
||||
], true, false
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$db = rcube_db::factory($rcube->config->get('sauserprefs_db_dsnw'), $rcube->config->get('sauserprefs_db_dsnr'), $rcube->config->get('sauserprefs_db_persistent'));
|
||||
$db->set_debug((bool) $rcube->config->get('sql_debug'));
|
||||
$db->db_connect('w');
|
||||
|
||||
// check DB connections and exit on failure
|
||||
if ($err_str = $db->is_error()) {
|
||||
rcube::raise_error([
|
||||
'code' => 603,
|
||||
'type' => 'db',
|
||||
'message' => $err_str
|
||||
], false, true
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$message = new rcube_message($uid);
|
||||
$email = $message->sender['mailto'];
|
||||
|
||||
// skip invalid emails
|
||||
if (!rcube_utils::check_email($email, false)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($spam) {
|
||||
// delete any welcomelisting for this address
|
||||
$db->query(
|
||||
"DELETE FROM `{$this->sa_table}` WHERE `{$this->sa_username_field}` = ? "
|
||||
. "AND `{$this->sa_preference_field}` = ? AND `{$this->sa_value_field}` = ?",
|
||||
$this->sa_user,
|
||||
$welcomelist_pref_name,
|
||||
$email
|
||||
);
|
||||
|
||||
// check address is not already blocklisted
|
||||
$sql_result = $db->query(
|
||||
"SELECT `value` FROM `{$this->sa_table}` WHERE `{$this->sa_username_field}` = ? "
|
||||
. "AND `{$this->sa_preference_field}` = ? AND `{$this->sa_value_field}` = ?",
|
||||
$this->sa_user,
|
||||
$blocklist_pref_name,
|
||||
$email
|
||||
);
|
||||
|
||||
if (!$db->fetch_array($sql_result)) {
|
||||
$db->query(
|
||||
"INSERT INTO `{$this->sa_table}` (`{$this->sa_username_field}`, `{$this->sa_preference_field}`, `{$this->sa_value_field}`)"
|
||||
. " VALUES (?, ?, ?)",
|
||||
$this->sa_user,
|
||||
$blocklist_pref_name,
|
||||
$email
|
||||
);
|
||||
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', $this->sa_user . ' blocklist ' . $email);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// delete any blocklisting for this address
|
||||
$db->query(
|
||||
"DELETE FROM `{$this->sa_table}` WHERE `{$this->sa_username_field}` = ? AND "
|
||||
. "`{$this->sa_preference_field}` = ? AND `{$this->sa_value_field}` = ?",
|
||||
$this->sa_user,
|
||||
$blocklist_pref_name,
|
||||
$email
|
||||
);
|
||||
|
||||
// check address is not already welcomelisted
|
||||
$sql_result = $db->query(
|
||||
"SELECT `value` FROM `{$this->sa_table}` WHERE `{$this->sa_username_field}` = ? "
|
||||
. "AND `{$this->sa_preference_field}` = ? AND `{$this->sa_value_field}` = ?",
|
||||
$this->sa_user,
|
||||
$welcomelist_pref_name,
|
||||
$email
|
||||
);
|
||||
|
||||
if (!$db->fetch_array($sql_result)) {
|
||||
$db->query(
|
||||
"INSERT INTO `{$this->sa_table}` (`{$this->sa_username_field}`, `{$this->sa_preference_field}`, `{$this->sa_value_field}`)"
|
||||
. " VALUES (?, ?, ?)",
|
||||
$this->sa_user,
|
||||
$welcomelist_pref_name,
|
||||
$email);
|
||||
|
||||
if ($debug) {
|
||||
rcube::write_log('markasjunk', $this->sa_user . ' welcomelist ' . $email);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* SpamAssassin detach ham driver
|
||||
*
|
||||
* @version 2.0
|
||||
*
|
||||
* @author Philip Weir
|
||||
*
|
||||
* Copyright (C) 2011-2014 Philip Weir
|
||||
*
|
||||
* This driver is part of the MarkASJunk plugin for Roundcube.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk_sa_detach
|
||||
{
|
||||
public function spam($uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
||||
public function ham(&$uids, $src_mbox, $dst_mbox)
|
||||
{
|
||||
$rcube = rcube::get_instance();
|
||||
$storage = $rcube->storage;
|
||||
$new_uids = [];
|
||||
|
||||
foreach ($uids as $uid) {
|
||||
$saved = false;
|
||||
$message = new rcube_message($uid);
|
||||
|
||||
foreach ($message->attachments as $part) {
|
||||
if (
|
||||
$part->ctype_primary == 'message'
|
||||
&& $part->ctype_secondary == 'rfc822'
|
||||
&& !empty($part->ctype_parameters['x-spam-type'])
|
||||
&& $part->ctype_parameters['x-spam-type'] == 'original'
|
||||
) {
|
||||
$orig_message_raw = $message->get_part_body($part->mime_id);
|
||||
|
||||
if ($saved = $storage->save_message($dst_mbox, $orig_message_raw)) {
|
||||
$rcube->output->command('markasjunk_move', null, [$uid]);
|
||||
array_push($new_uids, $saved);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count($new_uids) > 0) {
|
||||
$uids = $new_uids;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
|
||||
$messages['reportedasjunk'] = 'تم الإبلاغ عنه كبريد غير مرغوب فيه بنجاح';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'هذه الرسالة غير مهمة';
|
||||
$labels['asjunk'] = 'كغير مهم';
|
||||
$labels['markasjunk'] = 'وضع علامة على أنه غير مرغوب فيه';
|
||||
$labels['buttonnotjunk'] = 'هذه الرسالة ليست غير مهمة';
|
||||
$labels['asnotjunk'] = 'ليس وهمي';
|
||||
$labels['markasnotjunk'] = 'ضع علامة ليست غير مهمة';
|
||||
$labels['notjunk'] = 'ليس وهمي';
|
||||
$messages['reportedasjunk'] = 'تم الإبلاغ عن أنه غير هام بنجاح';
|
||||
$messages['reportedasnotjunk'] = 'تم الإبلاغ عن أنه ليس بريدًا غير مهم بنجاح';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Това писмо е Спам';
|
||||
$labels['asjunk'] = 'Като Спам';
|
||||
$labels['markasjunk'] = 'Маркирай като Спам';
|
||||
$labels['buttonnotjunk'] = 'Това писмо не е Спам';
|
||||
$labels['asnotjunk'] = 'Като не Спам';
|
||||
$labels['markasnotjunk'] = 'Маркирай като не Спам';
|
||||
$labels['notjunk'] = 'Не е Спам';
|
||||
$messages['reportedasjunk'] = 'Писмото е маркирано като Спам успешно';
|
||||
$messages['reportedasnotjunk'] = 'Писмото е маркирано като не Спам успешно';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Aquest missatge és brossa';
|
||||
$labels['asjunk'] = 'Com a brossa';
|
||||
$labels['markasjunk'] = 'Marca-ho com a brossa';
|
||||
$labels['buttonnotjunk'] = 'Aquest missatge no és brossa';
|
||||
$labels['asnotjunk'] = 'Com a no brossa';
|
||||
$labels['markasnotjunk'] = 'Marca-ho com a no brossa';
|
||||
$labels['notjunk'] = 'No brossa';
|
||||
$messages['reportedasjunk'] = 'S\'ha informat correctament com a brossa';
|
||||
$messages['reportedasnotjunk'] = 'S\'ha informat correctament com a no brossa';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Tato zpráva je nevyžádaná';
|
||||
$labels['asjunk'] = 'Jako nevyžádanou poštu';
|
||||
$labels['markasjunk'] = 'Označit jako nevyžádanou poštu';
|
||||
$labels['buttonnotjunk'] = 'Tato zpráva není nevyžádaná';
|
||||
$labels['asnotjunk'] = 'Jako vyžádanou poštu';
|
||||
$labels['markasnotjunk'] = 'Označit jako vyžádanou poštu';
|
||||
$labels['notjunk'] = 'Vyžádaná pošta';
|
||||
$messages['reportedasjunk'] = 'Nahlášeno jako nevyžádaná pošta';
|
||||
$messages['reportedasnotjunk'] = 'Nahlášeno jako vyžádaná pošta';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Mae\'r neges hwn yn sbwriel';
|
||||
$labels['asjunk'] = 'Fel sbwriel';
|
||||
$labels['markasjunk'] = 'Nodi fel sbwriel';
|
||||
$labels['buttonnotjunk'] = 'Nid yw\'r neges hwn yn sbwriel';
|
||||
$labels['asnotjunk'] = 'Fel nid sbwriel';
|
||||
$labels['markasnotjunk'] = 'Nodi fel nid sbwriel';
|
||||
$labels['notjunk'] = 'Nid sbwriel';
|
||||
$messages['reportedasjunk'] = 'Adroddwyd yn llwyddiannus fel sbwriel';
|
||||
$messages['reportedasnotjunk'] = 'Adroddwyd yn llwyddiannus fel nid sbwriel';
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Denne meddelelse er spam';
|
||||
$labels['asjunk'] = 'Som spam';
|
||||
$labels['markasjunk'] = 'Marker som spam';
|
||||
$labels['buttonnotjunk'] = 'Denne besked er ikke spam';
|
||||
$labels['asnotjunk'] = 'Som ikke spam';
|
||||
$labels['markasnotjunk'] = 'Marker som ikke spam';
|
||||
$labels['notjunk'] = 'Ikke spam';
|
||||
$messages['reportedasjunk'] = 'Succesfuldt rapporteret som spam';
|
||||
$messages['reportedasnotjunk'] = 'Succesfuldt rapporteret som ikke spam
|
||||
';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Diese Nachricht ist Spam';
|
||||
$labels['asjunk'] = 'Als Spam';
|
||||
$labels['markasjunk'] = 'Als Spam markieren';
|
||||
$labels['buttonnotjunk'] = 'Diese Nachricht ist kein Spam';
|
||||
$labels['asnotjunk'] = 'als kein Spam';
|
||||
$labels['markasnotjunk'] = 'Als kein Spam markieren';
|
||||
$labels['notjunk'] = 'Kein Spam';
|
||||
$messages['reportedasjunk'] = 'Erfolgreich als Spam gemeldet';
|
||||
$messages['reportedasnotjunk'] = 'Erfolgreich als kein Spam gemeldet';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Diese Nachricht ist Spam';
|
||||
$labels['asjunk'] = 'Als Spam';
|
||||
$labels['markasjunk'] = 'als SPAM markieren';
|
||||
$labels['buttonnotjunk'] = 'Diese Nachricht ist kein Spam';
|
||||
$labels['asnotjunk'] = 'als kein Spam';
|
||||
$labels['markasnotjunk'] = 'Markierung Spam entfernen';
|
||||
$labels['notjunk'] = 'Kein Spam';
|
||||
$messages['reportedasjunk'] = 'Erfolgreich als SPAM gemeldet';
|
||||
$messages['reportedasnotjunk'] = 'Erfolgreich als kein SPAM gemeldet';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Αυτό το μήνυμα είναι ανεπιθύμητο';
|
||||
$labels['asjunk'] = 'Ως ανεπιθύμητο';
|
||||
$labels['markasjunk'] = 'Σημείωση ως ανεπιθύμητο';
|
||||
$labels['buttonnotjunk'] = 'Αυτό το μήνυμα δεν είναι ανεπιθύμητο';
|
||||
$labels['asnotjunk'] = 'Ως μη ανεπιθύμητο';
|
||||
$labels['markasnotjunk'] = 'Σημείωση ως μη ανεπιθύμητο';
|
||||
$labels['notjunk'] = 'Μη ανεπιθύμητο';
|
||||
$messages['reportedasjunk'] = 'Αναφέρθηκε ως ανεπιθύμητο με επιτυχία';
|
||||
$messages['reportedasnotjunk'] = 'Αναφέρθηκε ως μη Ανεπιθύμητο με επιτυχία';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'This message is spam';
|
||||
$labels['asjunk'] = 'As spam';
|
||||
$labels['markasjunk'] = 'Mark as spam';
|
||||
$labels['buttonnotjunk'] = 'This message is not spam';
|
||||
$labels['asnotjunk'] = 'As not spam';
|
||||
$labels['markasnotjunk'] = 'Mark as not spam';
|
||||
$labels['notjunk'] = 'Not spam';
|
||||
$messages['reportedasjunk'] = 'Successfully reported as spam';
|
||||
$messages['reportedasnotjunk'] = 'Successfully reported as not spam';
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels = [];
|
||||
$labels['buttonjunk'] = 'This message is junk';
|
||||
$labels['asjunk'] = 'As junk';
|
||||
$labels['markasjunk'] = 'Mark as junk';
|
||||
$labels['buttonnotjunk'] = 'This message is not junk';
|
||||
$labels['asnotjunk'] = 'As not junk';
|
||||
$labels['markasnotjunk'] = 'Mark as not junk';
|
||||
$labels['notjunk'] = 'Not junk';
|
||||
|
||||
$messages = [];
|
||||
$messages['reportedasjunk'] = 'Successfully reported as junk';
|
||||
$messages['reportedasnotjunk'] = 'Successfully reported as not junk';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Este mensaje es spam';
|
||||
$labels['asjunk'] = 'Es spam';
|
||||
$labels['markasjunk'] = 'Marcar como spam';
|
||||
$labels['buttonnotjunk'] = 'Este mensaje no es spam';
|
||||
$labels['asnotjunk'] = 'No es spam';
|
||||
$labels['markasnotjunk'] = 'Marcar como no spam';
|
||||
$labels['notjunk'] = 'No es spam';
|
||||
$messages['reportedasjunk'] = 'Reportado como spam exitosamente';
|
||||
$messages['reportedasnotjunk'] = 'Marcado como no spam exitosamente';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Marcar como Spam';
|
||||
$labels['asjunk'] = 'Es spam';
|
||||
$labels['markasjunk'] = 'Marcar como Spam';
|
||||
$labels['buttonnotjunk'] = 'Este mensaje no es spam';
|
||||
$labels['asnotjunk'] = 'No es spam';
|
||||
$labels['markasnotjunk'] = 'Marcado como no spam';
|
||||
$labels['notjunk'] = 'No es spam';
|
||||
$messages['reportedasjunk'] = 'Reportado como SPAM, correctamente';
|
||||
$messages['reportedasnotjunk'] = 'Mensaje movido a la bandeja de entrada';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'See kiri on rämpspost';
|
||||
$labels['asjunk'] = 'Kui rämpspost';
|
||||
$labels['markasjunk'] = 'Märgi rämpspostiks';
|
||||
$labels['buttonnotjunk'] = 'See kiri ei ole rämpspost';
|
||||
$labels['asnotjunk'] = 'Kui mitte rämpspost';
|
||||
$labels['markasnotjunk'] = 'Märgi mitte rämpspostiks';
|
||||
$labels['notjunk'] = 'Pole rämpspost';
|
||||
$messages['reportedasjunk'] = 'Edukalt teatatud kui räpspost';
|
||||
$messages['reportedasnotjunk'] = 'Edukalt teatatud kui mitte räpspost';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Mezu hau zaborra da';
|
||||
$labels['asjunk'] = 'Zaborra moduan';
|
||||
$labels['markasjunk'] = 'Markatu zaborra moduan';
|
||||
$labels['buttonnotjunk'] = 'Mezu hau ez da zaborra';
|
||||
$labels['asnotjunk'] = 'Ez zaborra moduan';
|
||||
$labels['markasnotjunk'] = 'Markatu ez zaborra moduan';
|
||||
$labels['notjunk'] = 'Ez da zaborra';
|
||||
$messages['reportedasjunk'] = 'Zabor gisa informatu da';
|
||||
$messages['reportedasnotjunk'] = 'Ez zaborra gisa informatu da';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Tämä viesti on roskapostia';
|
||||
$labels['asjunk'] = 'Roskapostina';
|
||||
$labels['markasjunk'] = 'Merkitse roskapostiksi';
|
||||
$labels['buttonnotjunk'] = 'Tämä viesti ei ole roskapostia';
|
||||
$labels['asnotjunk'] = 'Ei roskapostina';
|
||||
$labels['markasnotjunk'] = 'Poista roskaposti-merkintä';
|
||||
$labels['notjunk'] = 'Ei roskaposti';
|
||||
$messages['reportedasjunk'] = 'Merkittiin roskapostiksi';
|
||||
$messages['reportedasnotjunk'] = 'Roskaposti-merkintä poistettiin';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Ce courriel est indésirable';
|
||||
$labels['asjunk'] = 'Comme indésirable';
|
||||
$labels['markasjunk'] = 'Marquer comme indésirable';
|
||||
$labels['buttonnotjunk'] = 'Ce courriel est acceptable';
|
||||
$labels['asnotjunk'] = 'Comme acceptable';
|
||||
$labels['markasnotjunk'] = 'Marquer comme acceptable';
|
||||
$labels['notjunk'] = 'Acceptable';
|
||||
$messages['reportedasjunk'] = 'Signalé avec succès comme indésirable';
|
||||
$messages['reportedasnotjunk'] = 'Signalé avec succès comme acceptable';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Is bruscar é an teachtaireacht sin';
|
||||
$labels['asjunk'] = 'Mar bhruscar';
|
||||
$labels['markasjunk'] = 'Rianaigh mar bhruscar í';
|
||||
$labels['buttonnotjunk'] = 'Ní bruscar é an teachtaireacht sin';
|
||||
$labels['asnotjunk'] = 'Nach bruscar é';
|
||||
$labels['markasnotjunk'] = 'Rianaigh nach bruscar é';
|
||||
$labels['notjunk'] = 'Ní bruscar í';
|
||||
$messages['reportedasjunk'] = 'Tuairiscíodh go rathúil gur bruscar í';
|
||||
$messages['reportedasnotjunk'] = 'Tuairiscíodh go rathúil nach bruscar í';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'הודעה זו היא דואר זבל';
|
||||
$labels['asjunk'] = 'יש לתייג כזבל';
|
||||
$labels['markasjunk'] = 'יש לסמן כזבל';
|
||||
$labels['buttonnotjunk'] = 'הודעה זו אינה זבל';
|
||||
$labels['asnotjunk'] = 'יש לתייג כהודעה שאינה זבל';
|
||||
$labels['markasnotjunk'] = 'יש לסמן שאינה זבל';
|
||||
$labels['notjunk'] = 'לא זבל';
|
||||
$messages['reportedasjunk'] = 'סומנה בהצלחה כזבל';
|
||||
$messages['reportedasnotjunk'] = 'סומנה בהצלחה שאינה זבל';
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
|
||||
$messages['reportedasjunk'] = 'Uspješno prijavljeno kao Junk';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Ez az üzenet kéretlen';
|
||||
$labels['asjunk'] = 'Kéretlenként';
|
||||
$labels['markasjunk'] = 'Kéretlennek jelölés';
|
||||
$labels['buttonnotjunk'] = 'Ez az üzenet nem kéretlen';
|
||||
$labels['asnotjunk'] = 'Nem kéretlenként';
|
||||
$labels['markasnotjunk'] = 'Nem kéretlennek jelölés';
|
||||
$labels['notjunk'] = 'Nem kéretlen';
|
||||
$messages['reportedasjunk'] = 'Sikeresen kéretlennek jelentve';
|
||||
$messages['reportedasnotjunk'] = 'Sikeresen nem kéretlennek jelentve';
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
|
||||
$messages['reportedasjunk'] = 'Sukses dilaporkan sebagai sampah';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Þessi skilaboð eru ruslpóstur';
|
||||
$labels['asjunk'] = 'Sem ruslpóstur';
|
||||
$labels['markasjunk'] = 'Merkja sem ruslpóst';
|
||||
$labels['buttonnotjunk'] = 'Þessi skilaboð eru ekki ruslpóstur';
|
||||
$labels['asnotjunk'] = 'Sem ekki-ruslpóstur';
|
||||
$labels['markasnotjunk'] = 'Merkja sem ekki-ruslpóst';
|
||||
$labels['notjunk'] = 'Ekki ruslpóstur';
|
||||
$messages['reportedasjunk'] = 'Tókst að tilkynna sem ruslpóst';
|
||||
$messages['reportedasnotjunk'] = 'Tókst að tilkynna sem ekki-ruslpóst';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Questo messaggio è indesiderato';
|
||||
$labels['asjunk'] = 'Come indesiderato';
|
||||
$labels['markasjunk'] = 'Contrassegna come indesiderato';
|
||||
$labels['buttonnotjunk'] = 'Questo messaggio è accettabile';
|
||||
$labels['asnotjunk'] = 'Come accettabile';
|
||||
$labels['markasnotjunk'] = 'Contrassegna come accettabile';
|
||||
$labels['notjunk'] = 'Accettabile';
|
||||
$messages['reportedasjunk'] = 'Segnalato con successo come indesiderato';
|
||||
$messages['reportedasnotjunk'] = 'Segnalato con successo come accettabile';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'このメッセージは迷惑メール';
|
||||
$labels['asjunk'] = '迷惑メール';
|
||||
$labels['markasjunk'] = '迷惑メールとしてマーク';
|
||||
$labels['buttonnotjunk'] = 'このメッセージは迷惑メールではない';
|
||||
$labels['asnotjunk'] = '非迷惑メール';
|
||||
$labels['markasnotjunk'] = '迷惑メールでないとマーク';
|
||||
$labels['notjunk'] = '非迷惑メール';
|
||||
$messages['reportedasjunk'] = '迷惑メールとして報告';
|
||||
$messages['reportedasnotjunk'] = '非迷惑メールとして報告';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = '이 메시지를 스팸으로 처리';
|
||||
$labels['asjunk'] = '스팸 처리';
|
||||
$labels['markasjunk'] = '스팸으로 표시';
|
||||
$labels['buttonnotjunk'] = '이 메시지는 정상임';
|
||||
$labels['asnotjunk'] = '정상 처리';
|
||||
$labels['markasnotjunk'] = '정상으로 표시';
|
||||
$labels['notjunk'] = '정상';
|
||||
$messages['reportedasjunk'] = '스팸 메일로 성공적으로 보고함';
|
||||
$messages['reportedasnotjunk'] = '정상 메일로 성공적으로 보고함';
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Ev peyam nebaş e';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Šis laiškas yra brukalas';
|
||||
$labels['asjunk'] = 'Kaip brukalą';
|
||||
$labels['markasjunk'] = 'Žymėti kaip brukalą';
|
||||
$labels['buttonnotjunk'] = 'Šis laiškas nėra brukalas';
|
||||
$labels['asnotjunk'] = 'Kaip ne brukalą';
|
||||
$labels['markasnotjunk'] = 'Žymėti kaip ne brukalą';
|
||||
$labels['notjunk'] = 'Ne brukalas';
|
||||
$messages['reportedasjunk'] = 'Sėkmingai pranešta, jog laiškas yra brukalas';
|
||||
$messages['reportedasnotjunk'] = 'Sėkmingai pranešta, jog laiškas nėra brukalas';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Šis ziņojums ir mēstule';
|
||||
$labels['asjunk'] = 'Kā mēstuli';
|
||||
$labels['markasjunk'] = 'Atzīmēt kā mēstuli';
|
||||
$labels['buttonnotjunk'] = 'Šis ziņojums nav mēstule';
|
||||
$labels['asnotjunk'] = 'Ne kā mēstuli';
|
||||
$labels['markasnotjunk'] = 'Atzīmēt kā nemēstuli';
|
||||
$labels['notjunk'] = 'Nav mēstule';
|
||||
$messages['reportedasjunk'] = 'Veiksmīgi noziņots kā mēstule';
|
||||
$messages['reportedasnotjunk'] = 'Veiksmīgi noziņots kā nemēstule';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Denne meldingen er søppelpost';
|
||||
$labels['asjunk'] = 'Som søppelpost';
|
||||
$labels['markasjunk'] = 'Merk som søppelpost';
|
||||
$labels['buttonnotjunk'] = 'Denne meldingen er ikke søppelpost';
|
||||
$labels['asnotjunk'] = 'Som ikke-søppelpost';
|
||||
$labels['markasnotjunk'] = 'Merk som ikke søppelpost';
|
||||
$labels['notjunk'] = 'Ikke søppelpost';
|
||||
$messages['reportedasjunk'] = 'Rapportering av søppelpost var vellykket';
|
||||
$messages['reportedasnotjunk'] = 'Rapportering av ikke-søppelpost var vellykket';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Dit bericht is spam';
|
||||
$labels['asjunk'] = 'Als spam';
|
||||
$labels['markasjunk'] = 'Markeer als spam';
|
||||
$labels['buttonnotjunk'] = 'Dit bericht is geen spam';
|
||||
$labels['asnotjunk'] = 'Als niet spam';
|
||||
$labels['markasnotjunk'] = 'Markeer als niet spam';
|
||||
$labels['notjunk'] = 'Niet spam';
|
||||
$messages['reportedasjunk'] = 'Succesvol gerapporteerd als spam';
|
||||
$messages['reportedasnotjunk'] = 'Succesvol gerapporteerd als niet spam';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Wiadomość jest spamem.';
|
||||
$labels['asjunk'] = 'Jako spam';
|
||||
$labels['markasjunk'] = 'Oznacz jako spam';
|
||||
$labels['buttonnotjunk'] = 'Wiadomość nie jest spamem';
|
||||
$labels['asnotjunk'] = 'Jako nie-spam';
|
||||
$labels['markasnotjunk'] = 'Oznacz jako nie-spam';
|
||||
$labels['notjunk'] = 'Nie-spam';
|
||||
$messages['reportedasjunk'] = 'Pomyślnie oznaczono jako spam';
|
||||
$messages['reportedasnotjunk'] = 'Pomyślnie oznaczono jako nie spam';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Esta mensagem é lixo';
|
||||
$labels['asjunk'] = 'Como lixo';
|
||||
$labels['markasjunk'] = 'Marcar como lixo';
|
||||
$labels['buttonnotjunk'] = 'Esta mensagem não é lixo';
|
||||
$labels['asnotjunk'] = 'Como não lixo';
|
||||
$labels['markasnotjunk'] = 'Marcar como não lixo';
|
||||
$labels['notjunk'] = 'Não é lixo';
|
||||
$messages['reportedasjunk'] = 'Reportado como lixo com sucesso';
|
||||
$messages['reportedasnotjunk'] = 'Reportado como não lixo com sucesso';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Esta mensagem é lixo';
|
||||
$labels['asjunk'] = 'Como lixo';
|
||||
$labels['markasjunk'] = 'Marcar como lixo';
|
||||
$labels['buttonnotjunk'] = 'Esta mensagem não é lixo';
|
||||
$labels['asnotjunk'] = 'Como não lixo';
|
||||
$labels['markasnotjunk'] = 'Marcar como não sendo lixo';
|
||||
$labels['notjunk'] = 'Não é lixo';
|
||||
$messages['reportedasjunk'] = 'Reportada com sucesso como lixo';
|
||||
$messages['reportedasnotjunk'] = 'Reportada com sucesso como não sendo lixo';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Это сообщение спам';
|
||||
$labels['asjunk'] = 'Как спам';
|
||||
$labels['markasjunk'] = 'Пометить как спам';
|
||||
$labels['buttonnotjunk'] = 'Это сообщение не спам';
|
||||
$labels['asnotjunk'] = 'Как не спам';
|
||||
$labels['markasnotjunk'] = 'Пометить как не спам';
|
||||
$labels['notjunk'] = 'Не спам';
|
||||
$messages['reportedasjunk'] = 'Успешно помечено как спам';
|
||||
$messages['reportedasnotjunk'] = 'Успешно помечено как не спам';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Táto správa je nevyžiadaná';
|
||||
$labels['asjunk'] = 'Ako nevyžiadané';
|
||||
$labels['markasjunk'] = 'Označiť ako nevyžiadané';
|
||||
$labels['buttonnotjunk'] = 'Táto správa nie je nevyžiadaná';
|
||||
$labels['asnotjunk'] = 'Ako užitočné/vyžiadané';
|
||||
$labels['markasnotjunk'] = 'Označiť ako užitočné/vyžiadané';
|
||||
$labels['notjunk'] = 'Nie je nevyžiadané';
|
||||
$messages['reportedasjunk'] = 'Úspešné nahlásené ako nevyžiadané';
|
||||
$messages['reportedasnotjunk'] = 'Úspešne nahlásené ako užitočné/vyžiadané';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Ky mesazh është hedhurinë';
|
||||
$labels['asjunk'] = 'Si hedhurinë';
|
||||
$labels['markasjunk'] = 'Vëri shenjë si hedhurinë';
|
||||
$labels['buttonnotjunk'] = 'Ky mesazh s’është hedhurinë';
|
||||
$labels['asnotjunk'] = 'Si jo hedhurinë';
|
||||
$labels['markasnotjunk'] = 'Vëri shenjë si jo hedhurinë';
|
||||
$labels['notjunk'] = 'Jo hedhurinë';
|
||||
$messages['reportedasjunk'] = 'U raportua me sukses si hedhurinë';
|
||||
$messages['reportedasnotjunk'] = 'U raportua me sukses si jo hedhurinë';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Meddelandet är skräp';
|
||||
$labels['asjunk'] = 'Skräp';
|
||||
$labels['markasjunk'] = 'Markera som skräp';
|
||||
$labels['buttonnotjunk'] = 'Meddelandet är inte skräp';
|
||||
$labels['asnotjunk'] = 'Inte skräp';
|
||||
$labels['markasnotjunk'] = 'Markera som inte skräp';
|
||||
$labels['notjunk'] = 'Inte skräp';
|
||||
$messages['reportedasjunk'] = 'Framgångsrikt rapporterat som skräp';
|
||||
$messages['reportedasnotjunk'] = 'Framgångsrikt rapporterat som inte skräp';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'Bu istenmeyen bir ileti';
|
||||
$labels['asjunk'] = 'İstenmeyen olarak';
|
||||
$labels['markasjunk'] = 'İstenmeyen olarak işaretle';
|
||||
$labels['buttonnotjunk'] = 'Bu istenmeyen bir ileti değil';
|
||||
$labels['asnotjunk'] = 'İstenmeyen değil olarak';
|
||||
$labels['markasnotjunk'] = 'İstenmeyen değil olarak işaretle';
|
||||
$labels['notjunk'] = 'İstenmeyen e-posta değil';
|
||||
$messages['reportedasjunk'] = 'İstenmeyen e-posta olduğu bildirildi';
|
||||
$messages['reportedasnotjunk'] = 'İstenmeyen e-posta olmadığı bildirildi';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = 'بۇ خەت بولسا ئەخلەت';
|
||||
$labels['asjunk'] = 'ئەخلەت سۈپىتىدە';
|
||||
$labels['markasjunk'] = 'ئەخلەت بەلگىسىنى قۇيۇش';
|
||||
$labels['buttonnotjunk'] = 'بۇ خەت ئەخلەت ئەمەس';
|
||||
$labels['asnotjunk'] = 'ئەخلەت ئەمەس سۈپىتىدە';
|
||||
$labels['markasnotjunk'] = 'ئەخلەت ئەمەس بەلگىسىنى قۇيۇش';
|
||||
$labels['notjunk'] = 'ئەخلەت ئەمەس';
|
||||
$messages['reportedasjunk'] = 'ئەخلەت سۈپىتىدە مۇۋاپىقىيەتلىك دوكىلات قىلىندى';
|
||||
$messages['reportedasnotjunk'] = 'ئەخلەت ئەمەسلىكى مۇۋاپىقىيەتلىك دوكىلات قىلىندى';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
+-----------------------------------------------------------------------+
|
||||
| Localization file of the Roundcube Webmail Mark-As-Junk plugin |
|
||||
| |
|
||||
| Copyright (C) The Roundcube Dev Team |
|
||||
| |
|
||||
| Licensed under the GNU General Public License version 3 or |
|
||||
| any later version with exceptions for skins & plugins. |
|
||||
| See the README file for a full license statement. |
|
||||
+-----------------------------------------------------------------------+
|
||||
|
||||
For translation see https://www.transifex.com/projects/p/roundcube-webmail/resource/plugin-markasjunk/
|
||||
*/
|
||||
|
||||
$labels['buttonjunk'] = '這是垃圾郵件';
|
||||
$labels['asjunk'] = '為垃圾郵件';
|
||||
$labels['markasjunk'] = '標示為垃圾郵件';
|
||||
$labels['buttonnotjunk'] = '這不是垃圾郵件';
|
||||
$labels['asnotjunk'] = '為非垃圾郵件';
|
||||
$labels['markasnotjunk'] = '標示為非垃圾郵件';
|
||||
$labels['notjunk'] = '非垃圾郵件';
|
||||
$messages['reportedasjunk'] = '已回報為垃圾郵件';
|
||||
$messages['reportedasnotjunk'] = '已回報為非垃圾郵件';
|
||||
@@ -0,0 +1,137 @@
|
||||
/**
|
||||
* Mark-as-Junk plugin script
|
||||
*
|
||||
* @licstart The following is the entire license notice for the
|
||||
* JavaScript code in this file.
|
||||
*
|
||||
* Copyright (c) The Roundcube Dev Team
|
||||
* Copyright (C) Philip Weir
|
||||
*
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
* and/or modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* @licend The above is the entire license notice
|
||||
* for the JavaScript code in this file.
|
||||
*/
|
||||
|
||||
rcube_webmail.prototype.markasjunk_mark = function(is_spam) {
|
||||
var uids = this.env.uid ? [this.env.uid] : this.message_list.get_selection();
|
||||
if (!uids)
|
||||
return;
|
||||
|
||||
var lock = this.set_busy(true, 'loading');
|
||||
this.http_post('plugin.markasjunk.' + (is_spam ? 'junk' : 'not_junk'), this.selection_post_data({_uid: uids}), lock);
|
||||
}
|
||||
|
||||
rcube_webmail.prototype.markasjunk_move = function(mbox, uids) {
|
||||
var prev_uid = this.env.uid;
|
||||
|
||||
if (this.message_list && uids.length == 1 && !this.message_list.in_selection(uids[0]))
|
||||
this.env.uid = uids[0];
|
||||
|
||||
if (mbox)
|
||||
this.move_messages(mbox);
|
||||
else if (this.env.markasjunk_permanently_remove == true)
|
||||
this.permanently_remove_messages();
|
||||
else
|
||||
this.delete_messages();
|
||||
|
||||
this.env.uid = prev_uid;
|
||||
}
|
||||
|
||||
rcube_webmail.prototype.markasjunk_toggle_button = function() {
|
||||
var spamobj = $('a.junk'),
|
||||
hamobj = $('a.notjunk'),
|
||||
disp = {spam: true, ham: true};
|
||||
|
||||
if (this.env.markasjunk_spam_only) {
|
||||
disp.ham = false;
|
||||
}
|
||||
else if (!this.is_multifolder_listing() && this.env.markasjunk_spam_mailbox) {
|
||||
if (this.env.mailbox != this.env.markasjunk_spam_mailbox)
|
||||
disp.ham = false;
|
||||
else
|
||||
disp.spam = false;
|
||||
}
|
||||
|
||||
// if only 1 button is visible make sure its the last one (for styling)
|
||||
// allow for multiple instances of the buttons, eg toolbar and contextmenu
|
||||
$.each(spamobj, function(i) {
|
||||
var cur_spamobj = spamobj.eq(i),
|
||||
cur_hamobj = hamobj.eq(i),
|
||||
cur_index = spamobj.eq(i).index();
|
||||
|
||||
if (cur_spamobj.parent('li').length > 0) {
|
||||
cur_spamobj = cur_spamobj.parent();
|
||||
cur_hamobj = cur_hamobj.parent();
|
||||
}
|
||||
|
||||
var evt_rtn = rcmail.triggerEvent('markasjunk-update', {objs: {spamobj: cur_spamobj, hamobj: cur_hamobj}, disp: disp});
|
||||
if (evt_rtn && evt_rtn.abort)
|
||||
return;
|
||||
|
||||
disp = evt_rtn ? evt_rtn.disp : disp;
|
||||
|
||||
disp.spam ? cur_spamobj.show() : cur_spamobj.hide();
|
||||
disp.ham ? cur_hamobj.show() : cur_hamobj.hide();
|
||||
|
||||
if (disp.spam && !disp.ham) {
|
||||
if (cur_index < cur_hamobj.index()) {
|
||||
cur_spamobj.insertAfter(cur_hamobj);
|
||||
}
|
||||
}
|
||||
else if (cur_index > cur_hamobj.index()) {
|
||||
cur_hamobj.insertAfter(cur_spamobj);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
rcube_webmail.prototype.markasjunk_is_spam_mbox = function() {
|
||||
return !this.is_multifolder_listing() && this.env.mailbox == this.env.markasjunk_spam_mailbox;
|
||||
}
|
||||
|
||||
if (window.rcmail) {
|
||||
rcmail.addEventListener('init', function() {
|
||||
// register command (directly enable in message view mode)
|
||||
rcmail.register_command('plugin.markasjunk.junk', function() { rcmail.markasjunk_mark(true); }, !rcmail.markasjunk_is_spam_mbox() && rcmail.env.uid);
|
||||
rcmail.register_command('plugin.markasjunk.not_junk', function() { rcmail.markasjunk_mark(false); }, rcmail.env.uid);
|
||||
|
||||
if (rcmail.message_list) {
|
||||
rcmail.message_list.addEventListener('select', function(list) {
|
||||
rcmail.enable_command('plugin.markasjunk.junk', !rcmail.markasjunk_is_spam_mbox() && list.get_selection(false).length > 0);
|
||||
rcmail.enable_command('plugin.markasjunk.not_junk', list.get_selection(false).length > 0);
|
||||
});
|
||||
}
|
||||
|
||||
// make sure the correct icon is displayed even when there is no listupdate event
|
||||
rcmail.markasjunk_toggle_button();
|
||||
});
|
||||
|
||||
rcmail.addEventListener('listupdate', function() { rcmail.markasjunk_toggle_button(); });
|
||||
|
||||
rcmail.addEventListener('beforemove', function(mbox) {
|
||||
if (mbox && typeof mbox === 'object') {
|
||||
mbox = mbox.id;
|
||||
}
|
||||
|
||||
if (!mbox) {
|
||||
return;
|
||||
}
|
||||
|
||||
var is_spam = null;
|
||||
|
||||
// check if destination mbox equals junk box (and we're not already in the junk box)
|
||||
if (rcmail.env.markasjunk_move_spam && mbox == rcmail.env.markasjunk_spam_mailbox && mbox != rcmail.env.mailbox)
|
||||
is_spam = true;
|
||||
// or if destination mbox equals ham box and we are in the junk box
|
||||
else if (rcmail.env.markasjunk_move_ham && mbox == rcmail.env.markasjunk_ham_mailbox && rcmail.env.mailbox == rcmail.env.markasjunk_spam_mailbox)
|
||||
is_spam = false;
|
||||
|
||||
if (is_spam !== null) {
|
||||
rcmail.markasjunk_mark(is_spam);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Mark-as-Junk plugin script
|
||||
*
|
||||
* @licstart The following is the entire license notice for the
|
||||
* JavaScript code in this file.
|
||||
*
|
||||
* Copyright (c) The Roundcube Dev Team
|
||||
* Copyright (C) Philip Weir
|
||||
*
|
||||
* The JavaScript code in this page is free software: you can redistribute it
|
||||
* and/or modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* @licend The above is the entire license notice
|
||||
* for the JavaScript code in this file.
|
||||
*/
|
||||
rcube_webmail.prototype.markasjunk_mark=function(a){var n,e=this.env.uid?[this.env.uid]:this.message_list.get_selection();e&&(n=this.set_busy(!0,"loading"),this.http_post("plugin.markasjunk."+(a?"junk":"not_junk"),this.selection_post_data({_uid:e}),n))},rcube_webmail.prototype.markasjunk_move=function(a,n){var e=this.env.uid;this.message_list&&1==n.length&&!this.message_list.in_selection(n[0])&&(this.env.uid=n[0]),a?this.move_messages(a):1==this.env.markasjunk_permanently_remove?this.permanently_remove_messages():this.delete_messages(),this.env.uid=e},rcube_webmail.prototype.markasjunk_toggle_button=function(){var m=$("a.junk"),s=$("a.notjunk"),t={spam:!0,ham:!0};this.env.markasjunk_spam_only?t.ham=!1:!this.is_multifolder_listing()&&this.env.markasjunk_spam_mailbox&&(this.env.mailbox!=this.env.markasjunk_spam_mailbox?t.ham=!1:t.spam=!1),$.each(m,function(a){var n=m.eq(a),e=s.eq(a),i=m.eq(a).index();0<n.parent("li").length&&(n=n.parent(),e=e.parent());a=rcmail.triggerEvent("markasjunk-update",{objs:{spamobj:n,hamobj:e},disp:t});a&&a.abort||((t=a?a.disp:t).spam?n.show():n.hide(),t.ham?e.show():e.hide(),t.spam&&!t.ham?i<e.index()&&n.insertAfter(e):i>e.index()&&e.insertAfter(n))})},rcube_webmail.prototype.markasjunk_is_spam_mbox=function(){return!this.is_multifolder_listing()&&this.env.mailbox==this.env.markasjunk_spam_mailbox},window.rcmail&&(rcmail.addEventListener("init",function(){rcmail.register_command("plugin.markasjunk.junk",function(){rcmail.markasjunk_mark(!0)},!rcmail.markasjunk_is_spam_mbox()&&rcmail.env.uid),rcmail.register_command("plugin.markasjunk.not_junk",function(){rcmail.markasjunk_mark(!1)},rcmail.env.uid),rcmail.message_list&&rcmail.message_list.addEventListener("select",function(a){rcmail.enable_command("plugin.markasjunk.junk",!rcmail.markasjunk_is_spam_mbox()&&0<a.get_selection(!1).length),rcmail.enable_command("plugin.markasjunk.not_junk",0<a.get_selection(!1).length)}),rcmail.markasjunk_toggle_button()}),rcmail.addEventListener("listupdate",function(){rcmail.markasjunk_toggle_button()}),rcmail.addEventListener("beforemove",function(a){if(a=a&&"object"==typeof a?a.id:a){var n=null;return rcmail.env.markasjunk_move_spam&&a==rcmail.env.markasjunk_spam_mailbox&&a!=rcmail.env.mailbox?n=!0:rcmail.env.markasjunk_move_ham&&a==rcmail.env.markasjunk_ham_mailbox&&rcmail.env.mailbox==rcmail.env.markasjunk_spam_mailbox&&(n=!1),null!==n?(rcmail.markasjunk_mark(n),!1):void 0}}));
|
||||
@@ -0,0 +1,352 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* MarkAsJunk
|
||||
*
|
||||
* A plugin that adds a new button to the mailbox toolbar
|
||||
* to mark the selected messages as Junk and move them to the Junk folder
|
||||
* or to move messages in the Junk folder to the inbox - moving only the
|
||||
* attachment if it is a Spamassassin spam report email
|
||||
*
|
||||
* @author Philip Weir
|
||||
* @author Thomas Bruederli
|
||||
*
|
||||
* Copyright (C) The Roundcube Dev Team
|
||||
* Copyright (C) Philip Weir
|
||||
*
|
||||
* This program is a Roundcube (https://roundcube.net) plugin.
|
||||
* For more information see README.md.
|
||||
* For configuration see config.inc.php.dist.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Roundcube. If not, see https://www.gnu.org/licenses/.
|
||||
*/
|
||||
class markasjunk extends rcube_plugin
|
||||
{
|
||||
public $task = 'mail';
|
||||
|
||||
private $rcube;
|
||||
private $spam_mbox;
|
||||
private $ham_mbox;
|
||||
private $driver;
|
||||
private $flags = [
|
||||
'JUNK' => 'Junk',
|
||||
'NONJUNK' => 'NonJunk'
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* Plugin initialization
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
$this->register_action('plugin.markasjunk.junk', [$this, 'mark_message']);
|
||||
$this->register_action('plugin.markasjunk.not_junk', [$this, 'mark_message']);
|
||||
|
||||
$this->rcube = rcube::get_instance();
|
||||
$this->load_config();
|
||||
$this->_load_host_config();
|
||||
|
||||
// Host exceptions
|
||||
$hosts = $this->rcube->config->get('markasjunk_allowed_hosts');
|
||||
if (!empty($hosts) && !in_array($_SESSION['storage_host'], (array) $hosts)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->ham_mbox = $this->rcube->config->get('markasjunk_ham_mbox', 'INBOX');
|
||||
$this->spam_mbox = $this->rcube->config->get('markasjunk_spam_mbox', $this->rcube->config->get('junk_mbox'));
|
||||
$toolbar = $this->rcube->config->get('markasjunk_toolbar', true);
|
||||
$this->_init_flags();
|
||||
|
||||
if ($this->rcube->action == '' || $this->rcube->action == 'show') {
|
||||
$this->include_script('markasjunk.js');
|
||||
$this->add_texts('localization', true);
|
||||
$this->include_stylesheet($this->local_skin_path() . '/markasjunk.css');
|
||||
|
||||
if ($toolbar) {
|
||||
// add the buttons to the main toolbar
|
||||
$this->add_button([
|
||||
'command' => 'plugin.markasjunk.junk',
|
||||
'type' => 'link',
|
||||
'class' => 'button buttonPas junk disabled',
|
||||
'classact' => 'button junk',
|
||||
'classsel' => 'button junk pressed',
|
||||
'title' => 'markasjunk.buttonjunk',
|
||||
'innerclass' => 'inner',
|
||||
'label' => 'junk'
|
||||
], 'toolbar');
|
||||
|
||||
$this->add_button([
|
||||
'command' => 'plugin.markasjunk.not_junk',
|
||||
'type' => 'link',
|
||||
'class' => 'button buttonPas notjunk disabled',
|
||||
'classact' => 'button notjunk',
|
||||
'classsel' => 'button notjunk pressed',
|
||||
'title' => 'markasjunk.buttonnotjunk',
|
||||
'innerclass' => 'inner',
|
||||
'label' => 'markasjunk.notjunk'
|
||||
], 'toolbar');
|
||||
}
|
||||
else {
|
||||
// add the buttons to the mark message menu
|
||||
$this->add_button([
|
||||
'command' => 'plugin.markasjunk.junk',
|
||||
'type' => 'link-menuitem',
|
||||
'label' => 'markasjunk.asjunk',
|
||||
'id' => 'markasjunk',
|
||||
'class' => 'icon junk disabled',
|
||||
'classact' => 'icon junk active',
|
||||
'innerclass' => 'icon junk'
|
||||
], 'markmenu');
|
||||
|
||||
$this->add_button([
|
||||
'command' => 'plugin.markasjunk.not_junk',
|
||||
'type' => 'link-menuitem',
|
||||
'label' => 'markasjunk.asnotjunk',
|
||||
'id' => 'markasnotjunk',
|
||||
'class' => 'icon notjunk disabled',
|
||||
'classact' => 'icon notjunk active',
|
||||
'innerclass' => 'icon notjunk'
|
||||
], 'markmenu');
|
||||
}
|
||||
|
||||
// add markasjunk folder settings to the env for JS
|
||||
$this->rcube->output->set_env('markasjunk_ham_mailbox', $this->ham_mbox);
|
||||
$this->rcube->output->set_env('markasjunk_spam_mailbox', $this->spam_mbox);
|
||||
$this->rcube->output->set_env('markasjunk_move_spam', $this->rcube->config->get('markasjunk_move_spam', false));
|
||||
$this->rcube->output->set_env('markasjunk_move_ham', $this->rcube->config->get('markasjunk_move_ham', false));
|
||||
$this->rcube->output->set_env('markasjunk_permanently_remove', $this->rcube->config->get('markasjunk_permanently_remove', false));
|
||||
$this->rcube->output->set_env('markasjunk_spam_only', $this->rcube->config->get('markasjunk_spam_only', false));
|
||||
}
|
||||
|
||||
// init learning driver
|
||||
$this->_init_driver();
|
||||
}
|
||||
|
||||
public function mark_message()
|
||||
{
|
||||
$this->add_texts('localization');
|
||||
|
||||
$is_spam = $this->rcube->action == 'plugin.markasjunk.junk';
|
||||
$uids = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_POST);
|
||||
$mbox_name = rcube_utils::get_input_string('_mbox', rcube_utils::INPUT_POST);
|
||||
$messageset = rcmail::get_uids($uids, $mbox_name, $multifolder);
|
||||
$dest_mbox = $is_spam ? $this->spam_mbox : $this->ham_mbox;
|
||||
|
||||
// special case when select all is used, uid is '*', and not in multi folder mode and we are using a driver
|
||||
// rcmail::get_uids does not handle this
|
||||
if ($uids == '*' && !$multifolder && is_object($this->driver)) {
|
||||
$storage = $this->rcube->get_storage();
|
||||
$result_index = $storage->index($mbox_name);
|
||||
$messageset = [$mbox_name => $result_index->get()];
|
||||
}
|
||||
|
||||
$result = $is_spam ? $this->_spam($messageset, $dest_mbox) : $this->_ham($messageset, $dest_mbox);
|
||||
if ($result) {
|
||||
if ($dest_mbox && ($mbox_name !== $dest_mbox || $multifolder)) {
|
||||
$this->rcube->output->command('markasjunk_move', $dest_mbox, $this->_messageset_to_uids($messageset, $multifolder));
|
||||
}
|
||||
else {
|
||||
$this->rcube->output->command('command', 'list', $mbox_name);
|
||||
}
|
||||
|
||||
$this->rcube->output->command('display_message', $this->gettext($is_spam ? 'reportedasjunk' : 'reportedasnotjunk'), 'confirmation');
|
||||
}
|
||||
|
||||
$this->rcube->output->send();
|
||||
}
|
||||
|
||||
public function set_flags($p)
|
||||
{
|
||||
if (!empty($p['message_flags'])) {
|
||||
$p['message_flags'] = array_merge((array) $p['message_flags'], $this->flags);
|
||||
}
|
||||
else {
|
||||
$p['message_flags'] = $this->flags;
|
||||
}
|
||||
|
||||
return $p;
|
||||
}
|
||||
|
||||
private function _spam(&$messageset, $dest_mbox = null)
|
||||
{
|
||||
$storage = $this->rcube->get_storage();
|
||||
$result = true;
|
||||
|
||||
foreach ($messageset as $source_mbox => &$uids) {
|
||||
$storage->set_folder($source_mbox);
|
||||
|
||||
$result = $this->_call_driver('spam', $uids, $source_mbox, $dest_mbox);
|
||||
|
||||
// abort function of the driver says so
|
||||
if (!$result) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->rcube->config->get('markasjunk_read_spam', false)) {
|
||||
$storage->set_flag($uids, 'SEEN', $source_mbox);
|
||||
}
|
||||
|
||||
if (array_key_exists('JUNK', $this->flags)) {
|
||||
$storage->set_flag($uids, 'JUNK', $source_mbox);
|
||||
}
|
||||
|
||||
if (array_key_exists('NONJUNK', $this->flags)) {
|
||||
$storage->unset_flag($uids, 'NONJUNK', $source_mbox);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function _ham(&$messageset, $dest_mbox = null)
|
||||
{
|
||||
$storage = $this->rcube->get_storage();
|
||||
$result = true;
|
||||
|
||||
foreach ($messageset as $source_mbox => &$uids) {
|
||||
$storage->set_folder($source_mbox);
|
||||
|
||||
$result = $this->_call_driver('ham', $uids, $source_mbox, $dest_mbox);
|
||||
|
||||
// abort function of the driver says so
|
||||
if (!$result) {
|
||||
break;
|
||||
}
|
||||
|
||||
if ($this->rcube->config->get('markasjunk_unread_ham', false)) {
|
||||
$storage->unset_flag($uids, 'SEEN', $source_mbox);
|
||||
}
|
||||
|
||||
if (array_key_exists('JUNK', $this->flags)) {
|
||||
$storage->unset_flag($uids, 'JUNK', $source_mbox);
|
||||
}
|
||||
|
||||
if (array_key_exists('NONJUNK', $this->flags)) {
|
||||
$storage->set_flag($uids, 'NONJUNK', $source_mbox);
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function _call_driver($action, &$uids = null, $source_mbox = null, $dest_mbox = null)
|
||||
{
|
||||
// already initialized
|
||||
if (!is_object($this->driver)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($action == 'spam') {
|
||||
$this->driver->spam($uids, $source_mbox, $dest_mbox);
|
||||
}
|
||||
elseif ($action == 'ham') {
|
||||
$this->driver->ham($uids, $source_mbox, $dest_mbox);
|
||||
}
|
||||
|
||||
return empty($this->driver->is_error);
|
||||
}
|
||||
|
||||
private function _messageset_to_uids($messageset, $multifolder)
|
||||
{
|
||||
$a_uids = [];
|
||||
|
||||
foreach ($messageset as $mbox => $uids) {
|
||||
if (is_array($uids)) {
|
||||
foreach ($uids as $uid) {
|
||||
$a_uids[] = $multifolder ? $uid . '-' . $mbox : $uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $a_uids;
|
||||
}
|
||||
|
||||
private function _load_host_config()
|
||||
{
|
||||
$configs = $this->rcube->config->get('markasjunk_host_config');
|
||||
if (empty($configs) || !array_key_exists($_SESSION['storage_host'], (array) $configs)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$file = $configs[$_SESSION['storage_host']];
|
||||
$this->load_config($file);
|
||||
}
|
||||
|
||||
private function _init_flags()
|
||||
{
|
||||
$spam_flag = $this->rcube->config->get('markasjunk_spam_flag');
|
||||
$ham_flag = $this->rcube->config->get('markasjunk_ham_flag');
|
||||
|
||||
if ($spam_flag === false) {
|
||||
unset($this->flags['JUNK']);
|
||||
}
|
||||
elseif (!empty($spam_flag)) {
|
||||
$this->flags['JUNK'] = $spam_flag;
|
||||
}
|
||||
|
||||
if ($ham_flag === false) {
|
||||
unset($this->flags['NONJUNK']);
|
||||
}
|
||||
elseif (!empty($ham_flag)) {
|
||||
$this->flags['NONJUNK'] = $ham_flag;
|
||||
}
|
||||
|
||||
if (count($this->flags) > 0) {
|
||||
// register the ham/spam flags with the core
|
||||
$this->add_hook('storage_init', [$this, 'set_flags']);
|
||||
}
|
||||
}
|
||||
|
||||
private function _init_driver()
|
||||
{
|
||||
$driver_name = $this->rcube->config->get('markasjunk_learning_driver');
|
||||
|
||||
if (empty($driver_name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$driver = $this->home . "/drivers/$driver_name.php";
|
||||
$class = "markasjunk_$driver_name";
|
||||
|
||||
if (!is_readable($driver)) {
|
||||
rcube::raise_error([
|
||||
'code' => 600,
|
||||
'file' => __FILE__,
|
||||
'line' => __LINE__,
|
||||
'message' => "markasjunk plugin: Unable to open driver file $driver"
|
||||
], true, false
|
||||
);
|
||||
}
|
||||
|
||||
include_once $driver;
|
||||
|
||||
if (!class_exists($class, false) || !method_exists($class, 'spam') || !method_exists($class, 'ham')) {
|
||||
rcube::raise_error([
|
||||
'code' => 600,
|
||||
'file' => __FILE__,
|
||||
'line' => __LINE__,
|
||||
'message' => "markasjunk plugin: Broken driver: $driver"
|
||||
], true, false
|
||||
);
|
||||
}
|
||||
|
||||
// call the relevant function from the driver
|
||||
$this->driver = new $class();
|
||||
|
||||
// method_exists check here for backwards compatibility
|
||||
if (method_exists($this->driver, 'init')) {
|
||||
$this->driver->init();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user