Horde_Spam_Email
extends Horde_Spam_Base
in package
Spam reporting driver via e-mail.
Tags
Table of Contents
- $_email : string
- Target e-mail address.
- $_format : string
- E-mail format.
- $_from_addr : string
- Sending e-mail address.
- $_mail : Horde_Mail_Transport
- Mail transport.
- $_opts : array<string|int, mixed>
- Additional options.
- $_user : string
- The reporting user.
- __construct() : mixed
- Constructor.
- report() : int
- Reports a list of messages as innocent/spam.
- setLogger() : mixed
- Sets the log handler.
- _makeStream() : Horde_Stream
- Converts a string or resource into a Horde_Stream object.
- _redirectMessage() : mixed
- Sends a redirect (a/k/a resent) message.
- _reportDigest() : int
- Builds and sends a digest message.
Properties
$_email
Target e-mail address.
protected
string
$_email
$_format
E-mail format.
protected
string
$_format
$_from_addr
Sending e-mail address.
protected
string
$_from_addr
$_mail
Mail transport.
protected
Horde_Mail_Transport
$_mail
$_opts
Additional options.
protected
array<string|int, mixed>
$_opts
$_user
The reporting user.
protected
string
$_user
Methods
__construct()
Constructor.
public
__construct(Horde_Mail_Transport $mail, string $email, string $from, string $user, string $format[, array<string|int, mixed> $opts = array() ]) : mixed
Parameters
- $mail : Horde_Mail_Transport
-
The mail transport to use.
- $email : string
-
E-mail address to send reports to.
- $from : string
-
E-mail address to send reports from.
- $user : string
-
A user name for information purposes.
- $format : string
-
E-mail format. Either 'redirect' or 'digest'.
- $opts : array<string|int, mixed> = array()
-
Additional options:
- digest_limit_msgs: (integer) Maximum number of messages allowed in a digest.
- digest_limit_size: (integer) Maximum size of a digest.
Return values
mixed —report()
Reports a list of messages as innocent/spam.
public
report(array<string|int, mixed> $msgs, mixed $action) : int
Parameters
- $msgs : array<string|int, mixed>
-
List of message contents, either as streams or strings.
- $action : mixed
-
Either Horde_Spam::SPAM or Horde_Spam::INNOCENT.
Return values
int —The number of reported messages.
setLogger()
Sets the log handler.
public
setLogger(Horde_Log_Logger $logger) : mixed
Parameters
- $logger : Horde_Log_Logger
-
The log handler.
Return values
mixed —_makeStream()
Converts a string or resource into a Horde_Stream object.
protected
_makeStream(string|resource $val) : Horde_Stream
Parameters
- $val : string|resource
-
Some content.
Return values
Horde_Stream —A Horde_Stream object with the content.
_redirectMessage()
Sends a redirect (a/k/a resent) message.
protected
_redirectMessage(Horde_Stream $message) : mixed
Parameters
- $message : Horde_Stream
-
Message content.
Tags
Return values
mixed —_reportDigest()
Builds and sends a digest message.
protected
_reportDigest(array<string|int, mixed> $messages, int $action) : int
Parameters
- $messages : array<string|int, mixed>
-
List of message contents (string|resource).
- $action : int
-
Either Horde_Spam::SPAM or Horde_Spam::INNOCENT.
Return values
int —The number of reported messages.