aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-01 15:22:08 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-01 15:22:08 +0200
commit578203db95c876f4fe6ec5d096525411dcbd8b42 (patch)
treeb7fde86a7eeebd18e5d07a4ea6fffc588b06ea40
parent1e0e6cb3faa75a80e63df5ef0d4b7274345d2391 (diff)
downloaddovecot-antispam-578203db95c876f4fe6ec5d096525411dcbd8b42.tar.gz
dovecot-antispam-578203db95c876f4fe6ec5d096525411dcbd8b42.tar.xz
dovecot-antispam-578203db95c876f4fe6ec5d096525411dcbd8b42.zip
rename, add install target
Diffstat (limited to '')
-rw-r--r--Makefile9
-rw-r--r--README14
-rw-r--r--antispam-plugin.c6
-rw-r--r--defconfig3
4 files changed, 20 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 74a3406..2b0a1e0 100644
--- a/Makefile
+++ b/Makefile
@@ -39,19 +39,22 @@ CFLAGS += -fPIC -shared -Wall
CC ?= "gcc"
objs += antispam-plugin.o $(BACKEND).o
-ALL = antispam
+ALL = lib90_antispam_plugin.so
all: verify_config $(ALL)
%.o: %.c .config antispam-plugin.h
$(CC) -c $(CFLAGS) -o $@ $<
-antispam: $(objs)
- $(CC) $(CFLAGS) $(objs) -o $@.so $(LDFLAGS)
+%.so: $(objs)
+ $(CC) $(CFLAGS) $(objs) -o $@ $(LDFLAGS)
clean:
rm -f *.so *.o *~
+install: all
+ install -o root -g root -m 0660 lib90_antispam_plugin.so $(INSTALLDIR)/
+
verify_config:
@if [ ! -r .config ]; then \
echo -e "\nBuilding the plugin requires a configuration file"; \
diff --git a/README b/README
index 9f86e45..2b720b6 100644
--- a/README
+++ b/README
@@ -32,12 +32,14 @@ INSTALLATION
First copy the 'defconfig' file to '.config' and edit it as necessary.
You need to have the dovecot headers installed and possibly other things
- depending on the backend you choose. Then simply run 'make'.
-
- Copy the plugin antispam.so to your dovecot imap plugin directory.
- Depending on your installation it could be /usr/lib/dovecot/modules/imap/
- or wherever you have it configured (look for the mail_plugin_dir
- configuration directive.)
+ depending on the backend you choose. Then, assuming you have configured
+ the INSTALLDIR correctly, simply run 'make install'.
+
+ If you do not wish to use the install target, simply copy the plugin
+ (that is, the file lib90_antispam_plugin.so) to your dovecot imap plugin
+ directory; by default this is /usr/lib/dovecot/modules/imap/ or any dir
+ you have configured (look for the mail_plugin_dir configuration
+ directive.)
Open your dovecot configuration file (usually /etc/dovecot/dovecot.conf)
and add the antispam plugin to the imap protocol section:
diff --git a/antispam-plugin.c b/antispam-plugin.c
index 993c8c1..9a84c07 100644
--- a/antispam-plugin.c
+++ b/antispam-plugin.c
@@ -72,7 +72,7 @@ bool mailbox_is_trash(struct mailbox *box)
return mailbox_in_list(box, trash_folders);
}
-void antispam_init(void)
+void antispam_plugin_init(void)
{
char *tmp, **iter;
@@ -112,7 +112,7 @@ void antispam_init(void)
hook_mail_storage_created = antispam_mail_storage_created;
}
-void antispam_deinit(void)
+void antispam_plugin_deinit(void)
{
hook_mail_storage_created = antispam_next_hook_mail_storage_created;
backend_exit();
@@ -120,4 +120,4 @@ void antispam_deinit(void)
}
/* put dovecot version we built against into plugin for checking */
-const char *antispam_version = PACKAGE_VERSION;
+const char *antispam_plugin_version = PACKAGE_VERSION;
diff --git a/defconfig b/defconfig
index e5f9675..b22f5ed 100644
--- a/defconfig
+++ b/defconfig
@@ -28,6 +28,9 @@ DOVECOT_VERSION=1.0
BACKEND=dspam-exec
+# install directory for 'make install'
+INSTALLDIR=/usr/lib/dovecot/modules/imap/
+
# enable debugging to syslog or stderr
#DEBUG=stderr
#DEBUG=syslog