## CamelJunkFilter CamelJunkFilter |

## Functions

CamelJunkStatus | camel_junk_filter_classify ()
gboolean | camel_junk_filter_learn_junk ()
gboolean | camel_junk_filter_learn_not_junk ()
gboolean | camel_junk_filter_synchronize ()

## Types and Values

| CamelJunkFilter
enum | CamelJunkStatus

## Object Hierarchy

        GInterface
        ╰── CamelJunkFilter

## Prerequisites

CamelJunkFilter requires GObject.

## Description

## Functions

### camel_junk_filter_classify ()

    CamelJunkStatus
    camel_junk_filter_classify (CamelJunkFilter *junk_filter,
                                CamelMimeMessage *message,
                                GCancellable *cancellable,
                                GError **error);

Classifies `message` as junk, not junk or inconclusive.

If an error occurs, the function sets `error` and returns `CAMEL_JUNK_STATUS_ERROR`.

#### Parameters

junk_filter | a CamelJunkFilter |
message | a CamelMimeMessage |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

the junk status determined by `junk_filter`

Since 3.2

### camel_junk_filter_learn_junk ()

    gboolean
    camel_junk_filter_learn_junk (CamelJunkFilter *junk_filter,
                                  CamelMimeMessage *message,
                                  GCancellable *cancellable,
                                  GError **error);

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`.

#### Parameters

junk_filter | a CamelJunkFilter |
message | a CamelMimeMessage |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if `message` was successfully classified

Since 3.2

### camel_junk_filter_learn_not_junk ()

    gboolean
    camel_junk_filter_learn_not_junk (CamelJunkFilter *junk_filter,
                                      CamelMimeMessage *message,
                                      GCancellable *cancellable,
                                      GError **error);

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`.

#### Parameters

junk_filter | a CamelJunkFilter |
message | a CamelMimeMessage |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if `message` was successfully classified

Since 3.2

### camel_junk_filter_synchronize ()

    gboolean
    camel_junk_filter_synchronize (CamelJunkFilter *junk_filter,
                                   GCancellable *cancellable,
                                   GError **error);

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`.

#### Parameters

junk_filter | a CamelJunkFilter |
cancellable | optional GCancellable object, or `NULL` |
error | return location for a GError, or `NULL` |

#### Returns

`TRUE` if `junk_filter` was successfully synchronized

Since 3.2

## Types and Values

### CamelJunkFilter

    typedef struct _CamelJunkFilter CamelJunkFilter;

Since 3.2

### enum CamelJunkStatus

These are result codes used when passing messages through a junk filter.

#### Members

CAMEL_JUNK_STATUS_ERROR | An error occurred while invoking the junk filter. |
CAMEL_JUNK_STATUS_INCONCLUSIVE | The junk filter could not determine whether the message is junk. |
CAMEL_JUNK_STATUS_MESSAGE_IS_JUNK | The junk filter believes the message is junk. |
CAMEL_JUNK_STATUS_MESSAGE_IS_NOT_JUNK | The junk filter believes the message is not junk. |