[Dovecot] Expire plugin per domain
Dear Timo thank you for the help your giving me these.
I want to set expire plugin only for some domains in the same way I set autocreate plugin.
vchkpw-wrapper.sh
#!/bin/bash
DOMAIN=echo $VPOPUSER|sed s/^.*@//
echo $USER > /tmp/autocreate echo $DOMAIN >> /tmp/autocreate
if [ "$DOMAIN" = "operaciones.qnet.com.pe" ]; then export USERDB_AUTOCREATE=INBOX.Spam export USERDB_AUTOSUBSCRIBE=INBOX.Spam export USERDB_EXPIRE="INBOX.Spam 1 INBOX.Spam.* 1" export USERDB_EXPIRE_DICT="proxy::expire" export EXTRA="USERDB_AUTOCREATE USERDB_AUTOSUBSCRIBE USERDB_EXPIRE USERDB_EXPIRE_DICT" set > /tmp/environment fi
unset USER exec $*
Record the right information in the database but when you run /usr/local/sbin/dovecot --exec-mail ext /usr/local/libexec/dovecot/expire-tool --test
Displays the following message
Fatal: expire and expire_altmove settings not set
You told me it was to migrate to Dovecot 1.2.6 with support for userdb chkpassword to use the following configuration:
userdb: driver: prefetch userdb: driver: checkpassword args: /usr/local/bin/userdb.sh
My problem is that I have no idea how to create the userdb.sh
Please could help in the creation of this script?
Thanks
Jose Luis
Explore the seven wonders of the world http://search.msn.com/results.aspx?q=7+wonders+world&mkt=en-US&form=QBRE
On Tue, 2009-10-20 at 10:00 -0500, Jose Luis Marin Perez wrote:
My problem is that I have no idea how to create the userdb.sh
From my previous mail:
Then create /usr/local/bin/userdb.sh which does more or less what the vchkpw-wrapper.sh does, except since it doesn't call vchkpw itself, it'll need to get the username from $USER instead of $VPOPUSER.
http://wiki.dovecot.org/AuthDatabase/CheckPassword#Checkpassword_as_userdb explains this extension.
So start with copy&pasting your vchkpw-wrapper.sh.
Hi Timo,
I copied vchkpw-wrapper.sh as userdb.sh, being as follows:
userdb.sh
#!/bin/bash
DOMAIN=echo $VPOPUSER|sed s/^.*@//
if [ "$DOMAIN" = "operaciones.qnet.com.pe" ]; then export USERDB_AUTOCREATE=INBOX.Spam export USERDB_AUTOSUBSCRIBE=INBOX.Spam export USERDB_EXPIRE="INBOX.Spam 1 INBOX.Spam.* 1" export USERDB_EXPIRE_DICT="proxy::expire" export EXTRA="USERDB_AUTOCREATE USERDB_AUTOSUBSCRIBE USERDB_EXPIRE USERDB_EXPIRE_DICT" fi
unset USER exec $*
When I run the command /usr/local/sbin/dovecot --exec-mail ext /usr/local/bin/expire-tool.sh --test
I get the same error message
Fatal: expire and expire_altmove settings not set
expire-tool.sh
#!/bin/bash MAIL_PLUGINS=${MAIL_PLUGINS//imap_quota/} MAIL_PLUGINS=${MAIL_PLUGINS//mail_log/} /usr/local/libexec/dovecot/expire-tool $1
dovecot --build-options Build options: ioloop=epoll notify=dnotify ipv6 openssl Mail storages: cydir dbox maildir mbox raw shared SQL drivers: mysql Passdb: checkpassword pam passwd passwd-file shadow sql Userdb: nss passwd passwd-file prefetch sql static
What's wrong?
Thanks
Jose Luis
dovecot -n
# 1.2.6: /usr/local/etc/dovecot.conf # OS: Linux 2.6.9-67.0.15.plus.c4smp i686 CentOS release 4.6 (Final) log_path: /var/log/dovecot.log listen: *:10143 ssl_listen: *:10943 disable_plaintext_auth: no login_dir: /usr/local/var/run/dovecot/login login_executable: /usr/local/libexec/dovecot/imap-login first_valid_uid: 89 last_valid_uid: 89 first_valid_gid: 89 last_valid_gid: 89 mail_uid: 89 mail_gid: 89 mail_location: maildir:~/Maildir mail_debug: yes mail_plugins: quota imap_quota expire mail_log autocreate namespace: type: private separator: . prefix: INBOX. inbox: yes list: yes subscriptions: yes lda: postmaster_address: postmaster@example.com auth default: debug: yes passdb: driver: checkpassword args: /usr/vpopmail/bin/vchkpw /usr/local/bin/vchkpw-wrapper.sh userdb: driver: prefetch userdb: driver: checkpassword args: /usr/local/bin/userdb.sh socket: type: listen master: path: /usr/local/var/run/dovecot/auth-master mode: 384 user: vpopmail group: vchkpw plugin: quota: maildir quota_rule: ?:storage=0 quota_rule2: Trash:ignore mail_log_events: delete undelete expunge copy mailbox_delete mail_log_group_events: mail_log_fields: uid box msgid size dict: expire: mysql:/usr/local/etc/dovecot-dict-expire.conf
Subject: Re: [Dovecot] Expire plugin per domain From: tss@iki.fi To: jolumape_al@hotmail.com CC: dovecot@dovecot.org Date: Tue, 20 Oct 2009 16:25:29 -0400
On Tue, 2009-10-20 at 10:00 -0500, Jose Luis Marin Perez wrote:
My problem is that I have no idea how to create the userdb.sh
From my previous mail:
Then create /usr/local/bin/userdb.sh which does more or less what the vchkpw-wrapper.sh does, except since it doesn't call vchkpw itself, it'll need to get the username from $USER instead of $VPOPUSER.
http://wiki.dovecot.org/AuthDatabase/CheckPassword#Checkpassword_as_userdb explains this extension.
So start with copy&pasting your vchkpw-wrapper.sh.
Connect to the next generation of MSN Messenger http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
On Tue, 2009-10-20 at 15:43 -0500, Jose Luis Marin Perez wrote:
DOMAIN=
echo $VPOPUSER|sed s/^.*@//
..vchkpw-wrapper.sh does, except since it doesn't call vchkpw itself, it'll need to get the username from $USER instead of $VPOPUSER.
The above explains the first problem...
Sorry, but I've spent already way too much time answering your questions. My previous email+wiki contains all the information necessary to write the script. If you can't do it yourself, find/pay someone else who isn't as busy as me.
Thanks Timo
From: tss@iki.fi To: jolumape_al@hotmail.com Date: Tue, 20 Oct 2009 16:46:52 -0400 CC: dovecot@dovecot.org Subject: Re: [Dovecot] Expire plugin per domain
On Tue, 2009-10-20 at 15:43 -0500, Jose Luis Marin Perez wrote:
DOMAIN=
echo $VPOPUSER|sed s/^.*@//
..vchkpw-wrapper.sh does, except since it doesn't call vchkpw itself, it'll need to get the username from $USER instead of $VPOPUSER.
The above explains the first problem...
Sorry, but I've spent already way too much time answering your questions. My previous email+wiki contains all the information necessary to write the script. If you can't do it yourself, find/pay someone else who isn't as busy as me.
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
participants (2)
-
Jose Luis Marin Perez
-
Timo Sirainen