[Dovecot] Autocreate plugin for some domains
Jose Luis Marin Perez
jolumape_al at hotmail.com
Thu Oct 15 00:33:21 EEST 2009
Hi Timo,
This is the content of /tmp/Environment:
[root at ml110c ~]# more environment
ANONYMOUS_USERNAME=anonymous
AUTH_1_MASTER=/usr/local/var/run/dovecot/auth-master
AUTH_1_MASTER_GROUP=vchkpw
AUTH_1_MASTER_MODE=600
AUTH_1_MASTER_USER=vpopmail
AUTH_NAME=default
AUTH_WORKER_MAX_COUNT=30
AUTH_WORKER_MAX_REQUEST_COUNT=0
AUTH_WORKER_PATH=/usr/local/var/run/dovecot/auth-worker.13415
BASH=/bin/bash
BASH_ARGC=([0]="1")
BASH_ARGV=([0]="/usr/local/libexec/dovecot/checkpassword-reply")
BASH_LINENO=([0]="0")
BASH_SOURCE=([0]="/usr/local/bin/vchkpw-wrapper.sh")
BASH_VERSINFO=([0]="3" [1]="00" [2]="15" [3]="1" [4]="release" [5]="i686-redhat-linux-gnu")
BASH_VERSION='3.00.15(1)-release'
CACHE_NEGATIVE_TTL=3600
CACHE_SIZE=0
CACHE_TTL=3600
DEFAULT_REALM=
DIRSTACK=()
DOMAIN=jmarin
DOVECOT_MASTER=1
DOVECOT_VERSION=1.1.16
EUID=89
FAILURE_DELAY=2
GROUPS=()
HOME=/usr/vpopmail/domains/operaciones.qnet.com.pe/jmarin
HOSTNAME=ml110c.qnet.com.pe
HOSTTYPE=i686
IFS=$' \t\n'
LOCAL_IP=127.0.0.1
LOG_TO_MASTER=1
MACHTYPE=i686-redhat-linux-gnu
MASTER_USER_SEPARATOR=
MECHANISMS=plain
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PASSDB_1_ARGS='/usr/vpopmail/bin/vchkpw /usr/local/bin/vchkpw-wrapper.sh'
PASSDB_1_DRIVER=checkpassword
PATH=/usr/local/bin:/bin:/usr/bin
PIPESTATUS=([0]="0")
PPID=13415
PROTO=TCP
PS4='+ '
PWD=/usr/vpopmail/domains/operaciones.qnet.com.pe/jmarin
REALMS=
REMOTE_IP=127.0.0.1
RESTRICT_CHROOT=
RESTRICT_GID_FIRST=
RESTRICT_GID_LAST=
RESTRICT_SETEXTRAGROUPS=
RESTRICT_SETGID=
RESTRICT_SETGID_PRIV=
RESTRICT_SETUID=
RESTRICT_USER=
SERVICE=imap
SHELL=NOLOGIN
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=1
SYSLOG_FACILITY=16
TCPLOCALIP=127.0.0.1
TCPLOCALPORT=10143
TCPREMOTEIP=127.0.0.1
TCPREMOTEPORT=38229
TERM=dumb
UID=89
USER=jmarin
USERDB_1_ARGS='uid=89 gid=89 home=/usr/vpopmail/domains/%d/%u'
USERDB_1_DRIVER=prefetch
USERDB_2_DRIVER=vpopmail
USERNAME_CHARS=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
USERNAME_FORMAT=
USERNAME_TRANSLATION=
VERBOSE_DEBUG=1
VPOPUSER=jmarin at operaciones.qnet.com.pe
WINBIND_HELPER_PATH=/usr/bin/ntlm_auth
_=jmarin
and I noticed that where the mail account is in the variable VPOPUSER so I modified the script to:
#!/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.spam1
export USERDB_AUTOCREATE2=INBOX.spam2
export EXTRA="USERDB_AUTOCREATE USERDB_AUTOCREATE2"
fi
unset USER
exec $*
working correctly, just wanted to ask if I use the variable VPOPUSER not bring trouble?
Thanks
Jose Luis
> From: tss at iki.fi
> To: jolumape_al at hotmail.com
> Date: Wed, 14 Oct 2009 12:39:10 -0400
> CC: dovecot at dovecot.org
> Subject: Re: [Dovecot] Autocreate plugin for some domains
>
> On Wed, 2009-10-14 at 11:37 -0500, Jose Luis Marin Perez wrote:
> > These are the results:
> >
> > more /tmp/autocreate
> > jmarin
> > jmarin
>
> Oh, right, that's because of vchkpw that drops the @domain out of $USER.
> What if you simply comment out:
>
> > DOMAIN=`echo $USER|sed s/^.*@//`
>
> Maybe it sets $DOMAIN internally? If not, find out where the domain is:
>
> set > /tmp/environment
>
_________________________________________________________________
Connect to the next generation of MSN Messenger
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
More information about the dovecot
mailing list