Skip to content
Snippets Groups Projects
Commit a56cf623 authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Cleaned up LDA Sieve plugin.

parent c4123b21
No related branches found
No related tags found
No related merge requests found
......@@ -13,12 +13,41 @@
#include <stdlib.h>
#include <sys/stat.h>
/*
* Configuration
*/
#define SIEVE_SCRIPT_PATH "~/.dovecot.sieve"
#define LDA_SIEVE_MAX_ERRORS 10
/*
* Global variables
*/
static deliver_mail_func_t *next_deliver_mail;
/*
* Mail transmission
*/
static void *lda_sieve_smtp_open(const char *destination,
const char *return_path, FILE **file_r)
{
return (void *) smtp_client_open(destination, return_path, file_r);
}
static bool lda_sieve_smtp_close(void *handle)
{
struct smtp_client *smtp_client = (struct smtp_client *) handle;
return ( smtp_client_close(smtp_client) >= 0 );
}
/*
* Plugin implementation
*/
static const char *lda_sieve_get_path(void)
{
const char *script_path, *home;
......@@ -66,19 +95,6 @@ static const char *lda_sieve_get_path(void)
return script_path;
}
static void *lda_sieve_smtp_open(const char *destination,
const char *return_path, FILE **file_r)
{
return (void *) smtp_client_open(destination, return_path, file_r);
}
static bool lda_sieve_smtp_close(void *handle)
{
struct smtp_client *smtp_client = (struct smtp_client *) handle;
return ( smtp_client_close(smtp_client) >= 0 );
}
static int lda_sieve_run
(struct mail_namespace *namespaces, struct mail *mail, const char *script_path,
const char *destaddr, const char *username, const char *mailbox)
......@@ -233,6 +249,10 @@ static int lda_sieve_deliver_mail
return ( ret >= 0 ? 1 : -1 );
}
/*
* Plugin interface
*/
void sieve_plugin_init(void)
{
/* Initialize Sieve engine */
......
/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file
*/
#ifndef __LDA_SIEVE_PLUGIN_H
#define __LDA_SIEVE_PLUGIN_H
/*
* Plugin interface
*/
void sieve_plugin_init(void);
void sieve_plugin_deinit(void);
#endif
#endif /* __LDA_SIEVE_PLUGIN_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.