CamelFilterDriver

## CamelFilterDriver CamelFilterDriver |

## Synopsis

                        CamelFilterDriver;
    CamelFolder *       (*CamelFilterGetFolderFunc)         (CamelFilterDriver *driver,
                                                             const gchar *uri,
                                                             gpointer data,
                                                             GError **error);
    CamelFilterDriver * camel_filter_driver_new             (struct _CamelSession *Param1);
    void                camel_filter_driver_set_logfile     (CamelFilterDriver *d,
                                                             FILE *logfile);
    void                camel_filter_driver_set_status_func (CamelFilterDriver *d,
                                                             CamelFilterStatusFunc *func,
                                                             gpointer data);
    void                camel_filter_driver_set_shell_func  (CamelFilterDriver *d,
                                                             CamelFilterShellFunc *func,
                                                             gpointer data);
    void                camel_filter_driver_set_play_sound_func
                                                            (CamelFilterDriver *d,
                                                             CamelFilterPlaySoundFunc *func,
                                                             gpointer data);
    void                camel_filter_driver_set_system_beep_func
                                                            (CamelFilterDriver *d,
                                                             CamelFilterSystemBeepFunc *func,
                                                             gpointer data);
    void                camel_filter_driver_set_folder_func (CamelFilterDriver *d,
                                                             CamelFilterGetFolderFunc fetcher,
                                                             gpointer data);
    void                camel_filter_driver_set_default_folder
                                                            (CamelFilterDriver *d,
                                                             CamelFolder *def);
    void                camel_filter_driver_add_rule        (CamelFilterDriver *d,
                                                             const gchar *name,
                                                             const gchar *match,
                                                             const gchar *action);
    gint                camel_filter_driver_remove_rule_by_name
                                                            (CamelFilterDriver *d,
                                                             const gchar *name);
    void                camel_filter_driver_flush           (CamelFilterDriver *driver,
                                                             GError **error);
    gint                camel_filter_driver_filter_message  (CamelFilterDriver *driver,
                                                             CamelMimeMessage *message,
                                                             CamelMessageInfo *info,
                                                             const gchar *uid,
                                                             CamelFolder *source,
                                                             const gchar *source_url,
                                                             const gchar *original_source_url,
                                                             GError **error);
    gint                camel_filter_driver_filter_mbox     (CamelFilterDriver *driver,
                                                             const gchar *mbox,
                                                             const gchar *original_source_url,
                                                             GError **error);
    gint                camel_filter_driver_filter_folder   (CamelFilterDriver *driver,
                                                             CamelFolder *folder,
                                                             CamelUIDCache *cache,
                                                             GPtrArray *uids,
                                                             gboolean remove,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----CamelObject
             +----CamelFilterDriver

## Description

## Details

### CamelFilterDriver

    typedef struct _CamelFilterDriver CamelFilterDriver;

### CamelFilterGetFolderFunc ()

    CamelFolder *       (*CamelFilterGetFolderFunc)         (CamelFilterDriver *driver,
                                                             const gchar *uri,
                                                             gpointer data,
                                                             GError **error);

`driver` : |
`uri` : |
`data` : |
`error` : |
Returns : |

### camel_filter_driver_new ()

    CamelFilterDriver * camel_filter_driver_new             (struct _CamelSession *Param1);

`Param1` : |
Returns : | A new CamelFilterDriver object

### camel_filter_driver_set_logfile ()

    void                camel_filter_driver_set_logfile     (CamelFilterDriver *d,
                                                             FILE *logfile);

`d` : |
`logfile` : |

### camel_filter_driver_set_status_func ()

    void                camel_filter_driver_set_status_func (CamelFilterDriver *d,
                                                             CamelFilterStatusFunc *func,
                                                             gpointer data);

`d` : |
`func` : |
`data` : |

### camel_filter_driver_set_shell_func ()

    void                camel_filter_driver_set_shell_func  (CamelFilterDriver *d,
                                                             CamelFilterShellFunc *func,
                                                             gpointer data);

`d` : |
`func` : |
`data` : |

### camel_filter_driver_set_play_sound_func ()

    void                camel_filter_driver_set_play_sound_func
                                                            (CamelFilterDriver *d,
                                                             CamelFilterPlaySoundFunc *func,
                                                             gpointer data);

`d` : |
`func` : |
`data` : |

### camel_filter_driver_set_system_beep_func ()

    void                camel_filter_driver_set_system_beep_func
                                                            (CamelFilterDriver *d,
                                                             CamelFilterSystemBeepFunc *func,
                                                             gpointer data);

`d` : |
`func` : |
`data` : |

### camel_filter_driver_set_folder_func ()

    void                camel_filter_driver_set_folder_func (CamelFilterDriver *d,
                                                             CamelFilterGetFolderFunc fetcher,
                                                             gpointer data);

`d` : |
`fetcher` : |
`data` : |

### camel_filter_driver_set_default_folder ()

    void                camel_filter_driver_set_default_folder
                                                            (CamelFilterDriver *d,
                                                             CamelFolder *def);

`d` : |
`def` : |

### camel_filter_driver_add_rule ()

    void                camel_filter_driver_add_rule        (CamelFilterDriver *d,
                                                             const gchar *name,
                                                             const gchar *match,
                                                             const gchar *action);

`d` : |
`name` : |
`match` : |
`action` : |

### camel_filter_driver_remove_rule_by_name ()

    gint                camel_filter_driver_remove_rule_by_name
                                                            (CamelFilterDriver *d,
                                                             const gchar *name);

`d` : |
`name` : |
Returns : |

### camel_filter_driver_flush ()

    void                camel_filter_driver_flush           (CamelFilterDriver *driver,
                                                             GError **error);

Flush all of the only-once filter actions.

`error` : | return location for a GError, or `NULL`

### camel_filter_driver_filter_message ()

    gint                camel_filter_driver_filter_message  (CamelFilterDriver *driver,
                                                             CamelMimeMessage *message,
                                                             CamelMessageInfo *info,
                                                             const gchar *uid,
                                                             CamelFolder *source,
                                                             const gchar *source_url,
                                                             const gchar *original_source_url,
                                                             GError **error);

Filters a message based on rules defined in the FilterDriver object. If the source folder (`source`) and the uid (`uid`) are provided, the filter will operate on the CamelFolder (which in certain cases is more efficient than using the default `camel_folder_append_message()` function).

`driver` : | CamelFilterDriver
`message` : | message to filter or NULL
`info` : | message info or NULL
`uid` : | message uid or NULL
`source` : | source folder or NULL
`source_url` : | url of source folder or NULL
`original_source_url` : | url of original source folder (pre-movemail) or NULL
`error` : | return location for a GError, or `NULL`
Returns : | -1 if errors were encountered during filtering, otherwise returns 0.

### camel_filter_driver_filter_mbox ()

    gint                camel_filter_driver_filter_mbox     (CamelFilterDriver *driver,
                                                             const gchar *mbox,
                                                             const gchar *original_source_url,
                                                             GError **error);

Filters an mbox file based on rules defined in the FilterDriver object. Is more efficient as it doesn't need to open the folder through Camel directly.

`driver` : | CamelFilterDriver
`mbox` : | mbox filename to be filtered
`error` : | return location for a GError, or `NULL`
Returns : | -1 if errors were encountered during filtering, otherwise returns 0.

### camel_filter_driver_filter_folder ()

    gint                camel_filter_driver_filter_folder   (CamelFilterDriver *driver,
                                                             CamelFolder *folder,
                                                             CamelUIDCache *cache,
                                                             GPtrArray *uids,
                                                             gboolean remove,
                                                             GError **error);

Filters a folder based on rules defined in the FilterDriver object.

`driver` : | CamelFilterDriver
`folder` : | CamelFolder to be filtered
`cache` : | UID cache (needed for POP folders)
`uids` : | message uids to be filtered or NULL (as a shortcut to filter all messages)
`remove` : | TRUE to mark filtered messages as deleted
`error` : | return location for a GError, or `NULL`
Returns : | -1 if errors were encountered during filtering, otherwise returns 0.