Camel.JunkFilter

g Camel.JunkFilter Camel.JunkFilter GObject.GInterface GObject.GInterface GObject.GInterface->Camel.JunkFilter

Implementations:

None

Methods

classify (message, cancellable)

learn_junk (message, cancellable)

learn_not_junk (message, cancellable)

synchronize (cancellable)

Virtual Methods

do_classify (message, cancellable)

do_learn_junk (message, cancellable)

do_learn_not_junk (message, cancellable)

do_synchronize (cancellable)

Properties

None

Signals

None

Fields

None

Class Details

class Camel.JunkFilter
Bases:

GObject.GInterface

Structure:

Camel.JunkFilterInterface

New in version 3.2.

classify(message, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

the junk status determined by self

Return type:

Camel.JunkStatus

Classifies message as junk, not junk or inconclusive.

If an error occurs, the function sets error and returns Camel.JunkStatus.ERROR.

New in version 3.2.

learn_junk(message, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if message was successfully classified

Return type:

bool

Instructs self to classify message as junk. If using an adaptive junk filtering algorithm, explicitly marking message as junk will influence the classification of future messages.

If an error occurs, the function sets error and returns False.

New in version 3.2.

learn_not_junk(message, cancellable)
Parameters:
Raises:

GLib.Error

Returns:

True if message was successfully classified

Return type:

bool

Instructs self to classify message as not junk. If using an adaptive junk filtering algorithm, explicitly marking message as not junk will influence the classification of future messages.

If an error occurs, the function sets error and returns False.

New in version 3.2.

synchronize(cancellable)
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Raises:

GLib.Error

Returns:

True if self was successfully synchronized

Return type:

bool

Instructs self to flush any in-memory caches to disk, if applicable. When filtering many messages, delaying this step until all messages have been classified can improve performance.

If an error occurs, the function sets error and returns False.

New in version 3.2.

do_classify(message, cancellable) virtual
Parameters:
Returns:

the junk status determined by junk_filter

Return type:

Camel.JunkStatus

Classifies message as junk, not junk or inconclusive.

If an error occurs, the function sets error and returns Camel.JunkStatus.ERROR.

New in version 3.2.

do_learn_junk(message, cancellable) virtual
Parameters:
Returns:

True if message was successfully classified

Return type:

bool

Instructs junk_filter to classify message as junk. If using an adaptive junk filtering algorithm, explicitly marking message as junk will influence the classification of future messages.

If an error occurs, the function sets error and returns False.

New in version 3.2.

do_learn_not_junk(message, cancellable) virtual
Parameters:
Returns:

True if message was successfully classified

Return type:

bool

Instructs junk_filter to classify message as not junk. If using an adaptive junk filtering algorithm, explicitly marking message as not junk will influence the classification of future messages.

If an error occurs, the function sets error and returns False.

New in version 3.2.

do_synchronize(cancellable) virtual
Parameters:

cancellable (Gio.Cancellable or None) – optional Gio.Cancellable object, or None

Returns:

True if junk_filter was successfully synchronized

Return type:

bool

Instructs junk_filter to flush any in-memory caches to disk, if applicable. When filtering many messages, delaying this step until all messages have been classified can improve performance.

If an error occurs, the function sets error and returns False.

New in version 3.2.