Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script

2009-10-19 Thread Jose Luis Marin Perez

Dear Timo 

 Finally and thanks to you, I could install Dovecot 1.2.6 with support for 
userdb checkpassword

How can I configure the script userdb.sh?

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: postmas...@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 in chkpw-wrapper.sh script
> From: t...@iki.fi
> To: jolumape...@hotmail.com
> CC: dovecot@dovecot.org
> Date: Thu, 15 Oct 2009 21:21:02 -0400
> 
> On Thu, 2009-10-15 at 14:32 -0500, Jose Luis Marin Perez wrote:
> > I'm trying to extend the configuration of vchkpw-wrapper.sh script by 
> > adding the expire plugin as follows:
> .. 
> > /usr/local/sbin/dovecot --exec-mail ext 
> > /usr/local/libexec/dovecot/expire-tool --test
> 
> The problem is that vchkpw-wrapper.sh is now run only when user is
> authenticating. expire-tool doesn't authenticate, it only does userdb
> lookup. So you'll need to have the script run for userdb lookups too:
> 
> passdb checkpassword {
>   ..
> }
> userdb prefetch {
> }
> userdb checkpassword {
>   args = /usr/local/bin/userdb.sh
> }
> 
> 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.
  
_
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

Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script

2009-10-16 Thread Timo Sirainen
On Fri, 2009-10-16 at 10:37 -0500, Jose Luis Marin Perez wrote:
> Hi timo,
> 
> This is the error that comes when adding userdb checkpassword 
> 
> dovecot: Oct 16 10:13:53 Fatal: auth(default): Unknown userdb driver 
> 'checkpassword' (typo, or Dovecot was built without support for it? Check 
> with dovecot --build-options)

Oh. userdb checkpassword is only in Dovecot v1.2.



signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script

2009-10-16 Thread Jose Luis Marin Perez

Hi timo,

This is the error that comes when adding userdb checkpassword 

dovecot: Oct 16 10:13:53 Fatal: auth(default): Unknown userdb driver 
'checkpassword' (typo, or Dovecot was built without support for it? Check with 
dovecot --build-options)
dovecot: Oct 16 10:13:53 Fatal: Auth process died too early - shutting down

 Running 

 dovecot - build-options 

 Build options: epoll ioloop = notify = dnotify ipv6 openssl 
 Mail Storage: mbox maildir raw cydir dbox 
 SQL drivers: mysql 
 Passdb: vpopmail sql checkpassword 
 Userdb: vpopmail sql prefetch 

 Checkpassword not compiled for userdb. 

 Excuse the dumb question, with that option adding to compile dovecot userdb 
checkpassword? 

 No information found about this. 

 Thanks

Jose Luis

> From: t...@iki.fi
> To: jolumape...@hotmail.com
> Date: Thu, 15 Oct 2009 21:21:02 -0400
> CC: dovecot@dovecot.org
> Subject: Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script
> 
> On Thu, 2009-10-15 at 14:32 -0500, Jose Luis Marin Perez wrote:
> > I'm trying to extend the configuration of vchkpw-wrapper.sh script by 
> > adding the expire plugin as follows:
> .. 
> > /usr/local/sbin/dovecot --exec-mail ext 
> > /usr/local/libexec/dovecot/expire-tool --test
> 
> The problem is that vchkpw-wrapper.sh is now run only when user is
> authenticating. expire-tool doesn't authenticate, it only does userdb
> lookup. So you'll need to have the script run for userdb lookups too:
> 
> passdb checkpassword {
>   ..
> }
> userdb prefetch {
> }
> userdb checkpassword {
>   args = /usr/local/bin/userdb.sh
> }
> 
> 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.
  
_
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

Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script

2009-10-15 Thread Timo Sirainen
On Thu, 2009-10-15 at 14:32 -0500, Jose Luis Marin Perez wrote:
> I'm trying to extend the configuration of vchkpw-wrapper.sh script by adding 
> the expire plugin as follows:
.. 
> /usr/local/sbin/dovecot --exec-mail ext 
> /usr/local/libexec/dovecot/expire-tool --test

The problem is that vchkpw-wrapper.sh is now run only when user is
authenticating. expire-tool doesn't authenticate, it only does userdb
lookup. So you'll need to have the script run for userdb lookups too:

passdb checkpassword {
  ..
}
userdb prefetch {
}
userdb checkpassword {
  args = /usr/local/bin/userdb.sh
}

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.


signature.asc
Description: This is a digitally signed message part


Re: [Dovecot] Expire plugin in chkpw-wrapper.sh script

2009-10-15 Thread Timo Sirainen
Stop sending the same mail every few hours.

On Thu, 2009-10-15 at 18:14 -0500, Jose Luis Marin Perez wrote:
> Dear Timo, 
>  
> I'm trying to extend the configuration of vchkpw-wrapper.sh script by adding 
> the expire plugin as follows:
>  
> #!/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 $*
>  
> In the database no problem
>  
> mysql> select * from expires;
> +---+--+
> | mailbox   | expire_stamp |
> +---+--+
> | jma...@operaciones.qnet.com.pe/INBOX.Spam |   1255701608 |
> +---+--+
> 1 row in set (0.00 sec)
>  
> But when you run the command
>  
> /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
>  
> That may be happening?
>  
> Thanks
>  
> Jose Luis
> 
> dovecot -n
> 
> # 1.1.16: /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
> auth default:
>   debug: yes
>   passdb:
> driver: checkpassword
> args: /usr/vpopmail/bin/vchkpw /usr/local/bin/vchkpw-wrapper.sh
>   userdb:
> driver: prefetch
> args: uid=89 gid=89 home=/usr/vpopmail/domains/%d/%u
>   userdb:
> driver: vpopmail
>   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
>   expire_dict: proxy::expire
>   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
> 
> 
> _
> Discover the new Windows Vista
> http://search.msn.com/results.aspx?q=windows+vista&mkt=en-US&form=QBRE


signature.asc
Description: This is a digitally signed message part