rcube_message

Logical representation of a mail message with all its data and related functions

package

Framework

subpackage

Storage

author

Thomas Bruederli roundcube@gmail.com

Methods

__construct

__construct(string $uid, string $folder = null, boolean $is_safe = false) 

Provide a uid, and parse message structure.

see self::$app,

self::$storage, self::$opt, self::$parts

Arguments

$uid

string

The message UID.

$folder

string

Folder name

$is_safe

boolean

Security flag

Add a part to object parts array(s) (with context check)

add_part( $part,  $type = null) 

Arguments

$part

$type

Check if specified part belongs to the current context

check_context( $part) 

Arguments

$part

Return the first HTML part of this message

first_html_part( &$part = null, boolean $enriched = false) : string

Arguments

$part

$enriched

boolean

Enables checking for text/enriched parts too

Response

string

HTML message part content

Return the first text part of this message.

first_text_part( &$part = null, boolean $strict = false) : string

If there's no text/plain part but $strict=true and text/html part exists, it will be returned in text/plain format.

Arguments

$part

$strict

boolean

Check only text/plain parts

Response

string

Plain text message/part content

Fix attachment name encoding if needed/possible

fix_attachment_name( $name,  $part) 

Arguments

$name

$part

format_flowed

format_flowed( $text,  $length = 72) 
static

Arguments

$text

$length

Format text message part for display

format_part_body(string $body, \rcube_message_part $part, string $default_charset = null) : string
static

Arguments

$body

string

Part body

$part

\rcube_message_part

Part object

$default_charset

string

Fallback charset if part charset is not specified

Response

string

Formatted body

Return a (decoded) message header

get_header(string $name,  $raw = false) : string

Arguments

$name

string

Header name

$raw

Response

string

Header value

Fill a flat array with references to all parts, indexed by part numbers

get_mime_numbers(\rcube_message_part &$part) 

Arguments

$part

\rcube_message_part

Message body structure

In a multipart/encrypted encrypted message, find the encrypted message payload part.

get_multipart_encrypted_part() : \rcube_message_part

Get content of a specific part of this message

get_part_body(string $mime_id, boolean $formatted = false, integer $max_bytes, mixed $mode = null) : string|boolean

Arguments

$mime_id

string

Part ID

$formatted

boolean

Enables formatting of text/* parts bodies

$max_bytes

integer

Only return/read this number of bytes

$mode

mixed

NULL to return a string, -1 to print body or file pointer to save the body into

Response

string|boolean

Part content or operation status

Get content of a specific part of this message

get_part_content(string $mime_id, resource $fp = null, boolean $skip_charset_conv = false, integer $max_bytes, boolean $formatted = true) : string
deprecated

Arguments

$mime_id

string

Part MIME-ID

$fp

resource

File pointer to save the message part

$skip_charset_conv

boolean

Disables charset conversion

$max_bytes

integer

Only read this number of bytes

$formatted

boolean

Enables formatting of text/* parts bodies

Response

string

Part content

Compose a valid URL for getting a message part

get_part_url(string $mime_id, mixed $embed = false) : string

Arguments

$mime_id

string

Part MIME-ID

$embed

mixed

Mimetype class for parts to be embedded

Response

string

URL or false if part does not exist

Determine if the message contains a HTML part. This must to be a real part not an attachment (or its part)

has_html_part(boolean $enriched = false,  &$part = null) : boolean

Arguments

$enriched

boolean

Enables checking for text/enriched parts too

$part

Response

boolean

True if a HTML is available, False if not

Determine if the message contains a text/plain part. This must to be a real part not an attachment (or its part)

has_text_part( &$part = null) : boolean

Arguments

$part

Response

boolean

True if a plain text part is available, False if not

Checks if part of the message is an attachment (or part of it)

is_attachment(\rcube_message_part $part) : boolean

Arguments

$part

\rcube_message_part

Message part

Response

boolean

True if the part is an attachment part

Return message parts in current context

mime_parts() 

Read the message structure returend by the IMAP server and build flat lists of content parts and attachments

parse_structure(\rcube_message_part $structure, boolean $recursive = false) 

Arguments

$structure

\rcube_message_part

Message structure node

$recursive

boolean

True when called recursively

Set is_safe var and session data

set_safe(boolean $safe = true) 

Arguments

$safe

boolean

enable/disable

Decode a Microsoft Outlook TNEF part (winmail.dat)

tnef_decode(\rcube_message_part &$part) : array

Arguments

$part

\rcube_message_part

Message part to decode

Response

array

Deprecated methods (to be removed)

unfold_flowed( $text) 
static

Arguments

$text

Parse message body for UUencoded attachments bodies

uu_decode(\rcube_message_part &$part) : array

Arguments

$part

\rcube_message_part

Message part to decode

Response

array

Constants

BODY_MAX_SIZE

BODY_MAX_SIZE

Properties

Instance of framework class.

app : \rcube
var

Type(s)

\rcube

Instance of storage class

storage : \rcube_storage
var

Type(s)

\rcube_storage

Instance of mime class

mime : \rcube_mime
var

Type(s)

\rcube_mime

opt

opt : 

Type(s)

parse_alternative

parse_alternative : 

Type(s)

uid

uid : 

Type(s)

folder

folder : 

Type(s)

headers

headers : 

Type(s)

sender

sender : 

Type(s)

context

context : 

Type(s)

parts

parts : 

Type(s)

mime_parts

mime_parts : 

Type(s)

inline_parts

inline_parts : 

Type(s)

attachments

attachments : 

Type(s)

subject

subject : 

Type(s)

is_safe

is_safe : 

Type(s)