Discussion:
auto create dir for spam email
f***@vista-paradiso.com.hk
2004-03-04 09:06:19 UTC
Permalink
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?

Regards,

Frankie
Andreas Wiesmann
2004-03-04 09:45:34 UTC
Permalink
hi
I tried to run an extension of the filter possibilities of sqwebmail
taking into account the .qmail in the user home created by qmailadmin
using the maildrop filter below. However I run into trouble if there
is a forward address entry in the qmailadmin .qmail file
(&***@adddress.com).

Everything works fine if I dont have &***@adddress.com in the .qmail
file, files are delivered, vacancy message works etc. if I have a
forward address set in .qmail the e-mail is not forwarded. There is
no error visible in the logs, the e-mail simply disappears. If I
select the forward and local store in qmailadmin, the e-mail is
stored locally but not forwarded. If I have no .qmail file everything
works fine. Is that a known problem? Is it already solved in newer
versions of vpopmail (I use 5.3.24)?

thanks
andrej


# mailfilter written by ***@swordlord.org to
# work with qmail, vpopmail, sqwebmail, qmailadmin
# 1. check if .Spam maildir exists and deliver if its spam
# 2. check if .qmail in virtual home and proceed with vdelivermail
# 3. check if mailfilters from sqwebmail in virtual home and include them
# 4. standard mail delivery with vdelivermail

# PREREQUISITS
# needs program to check if file exists /usr/bin/test
# file in ./Maildir or /usr/local/share/sqwebmail called maildirfilterconfig
# with
# MAILDIRFILTER=../.mailfilter
# MAILDIR=$VHOME/Maildir

# this filter is called by .qmail-default
# | maildrop mailfilter

SENDMAIL="/var/qmail/bin/sendmail"
VPOP="| /mailboxen/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
#VPOP="| /mailboxen/vpopmail/bin/vdelivermail ''
/var/qmail/popboxes/vpopmail/domains/sfgb-b.ch/0/d.stettler

# virtual user home
VHOME=`/mailboxen/vpopmail/bin/vuserinfo -d $EXT@$HOST`
HOME=$VHOME

#logfile $VHOME/log
logfile "/var/log/maildrop"

log "VPOP: $VPOP"
log "VHOME: $VHOME"
log "SENDMAIL: $SENDMAIL"

`/usr/bin/test -d $VHOME`
if( $RETURNCODE != 0 )
{
echo 'Sorry, no mailbox here by that name. vpopmail (#5.1.1)'
EXITCODE=100
log "bouncing"
exit
}


#log $SENDMAIL

# spam directory for automatic spam filtering
SPAMDIR="$VHOME/Maildir/.Spam"
`/usr/bin/test -d $SPAMDIR`
SPAMDIRF="$RETURNCODE"
log "SPAMDIR: $SPAMDIR SPAMDIRF: $SPAMDIRF"


# dotqmail
DOTQMAIL="$VHOME/.qmail"
`/usr/bin/test -f $DOTQMAIL`
DOTQMAILF="$RETURNCODE"
log "DOTQMAIL: $DOTQMAIL DOTQMAILF: $DOTQMAILF"

# further maildrop filters (configured via sqwebmail)
SQMAILF="$VHOME/.mailfilter"
`/usr/bin/test -f $SQMAILF`
SQMAILFF="$RETURNCODE"
log "SQMAILF: $SQMAILF SQMAILFF: $SQMAILFF"




if ($SPAMDIRF == 0)
{
if (/^X-Spam-Flag: *YES/)
{
log "xspam yes and spamdir exists"
exception {
# to Spamfolder
to "$SPAMDIR"
}
}
}

if ($DOTQMAILF == 0)
{
exception {
# proceed with .qmail
log ".qmail exists"
to "$VPOP"
}
}

if ($SQMAILFF == 0)
{
exception {
# proceed with maildrop filters
log "include filters"
include $VHOME/.mailfilter
}
exception {
# proceed
log "standard delivery after filter inclusion"
to "$VPOP"
}

}
else
{
exception {
# proceed
log "standard delivery"
to "$VPOP"
}
}

log "end"
Tom Collins
2004-03-04 15:59:53 UTC
Permalink
Is that a known problem? Is it already solved in newer versions of
vpopmail (I use 5.3.24)?
We made a lot of changes between 5.3.24 and the final 5.4.0 release.

Please go to http://vpopmail.sf.net/ and upgrade to 5.4.0 and then
report back if you're still having problems. 5.4.0 is the "stable"
culmination of the 5.3.x development series, and everyone running 5.3.x
should upgrade.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Andreas Wiesmann
2004-03-06 11:45:18 UTC
Permalink
Please go to http://vpopmail.sf.net/ and upgrade to 5.4.0 and then report back
hello tom,
i did the upgrade to 5.4.0 and unfortunately it did not help. If I
use the maildrop script and have a .qmail file with a forward
mailaddress the e-mail disappears. See logs and my original posting
below.

cheers
andrej

qmail log:
2004-03-06 12:28:33.470223500 info msg 3287085: bytes 788 from
<***@z.com> qp 9789 uid 506
2004-03-06 12:28:33.472087500 starting delivery 31703: msg 3287085 to
local q.com-***@q.com
2004-03-06 12:28:33.472096500 status: local 1/10 remote 0/20
2004-03-06 12:28:33.541194500 delivery 31703: success: did_0+0+1/
2004-03-06 12:28:33.541201500 status: local 0/10 remote 0/20
2004-03-06 12:28:33.541203500 end msg 3287085

maildrop log (using the script in my previous posting)
SENDMAIL: /var/qmail/bin/sendmail
SPAMDIR: /mailboxen/vpopmail/domains/q.com/0/test/Maildir/.Spam SPAMDIRF: 0
DOTQMAIL: /mailboxen/vpopmail/domains/q.com/0/test/.qmail DOTQMAILF: 0
SQMAILF: /mailboxen/vpopmail/domains/q.com/0/test/.mailfilter SQMAILFF: 0
.qmail exists
Date: Sat Mar 6 12:28:33 2004
From: ***@z.com
Subj: test 2
File: | /mailboxen/vpopmail/bin/vdelivermail '' bounce-no-mailbox (788)


hi
I tried to run an extension of the filter possibilities of sqwebmail
taking into account the .qmail in the user home created by qmailadmin
using the maildrop filter below. However I run into trouble if there
is a forward address entry in the qmailadmin .qmail file
(&***@adddress.com).

Everything works fine if I dont have &***@adddress.com in the .qmail
file, files are delivered, vacancy message works etc. if I have a
forward address set in .qmail the e-mail is not forwarded. There is
no error visible in the logs, the e-mail simply disappears. If I
select the forward and local store in qmailadmin, the e-mail is
stored locally but not forwarded. If I have no .qmail file everything
works fine. Is that a known problem? Is it already solved in newer
versions of vpopmail (I use 5.3.24)?

thanks
andrej


# mailfilter written by ***@swordlord.org to
# work with qmail, vpopmail, sqwebmail, qmailadmin
# 1. check if .Spam maildir exists and deliver if its spam
# 2. check if .qmail in virtual home and proceed with vdelivermail
# 3. check if mailfilters from sqwebmail in virtual home and include them
# 4. standard mail delivery with vdelivermail

# PREREQUISITS
# needs program to check if file exists /usr/bin/test
# file in ./Maildir or /usr/local/share/sqwebmail called maildirfilterconfig
# with
# MAILDIRFILTER=../.mailfilter
# MAILDIR=$VHOME/Maildir

# this filter is called by .qmail-default
# | maildrop mailfilter

SENDMAIL="/var/qmail/bin/sendmail"
VPOP="| /mailboxen/vpopmail/bin/vdelivermail '' bounce-no-mailbox"
#VPOP="| /mailboxen/vpopmail/bin/vdelivermail ''
/var/qmail/popboxes/vpopmail/domains/sfgb-b.ch/0/d.stettler

# virtual user home
VHOME=`/mailboxen/vpopmail/bin/vuserinfo -d $EXT@$HOST`
HOME=$VHOME

#logfile $VHOME/log
logfile "/var/log/maildrop"

log "VPOP: $VPOP"
log "VHOME: $VHOME"
log "SENDMAIL: $SENDMAIL"

`/usr/bin/test -d $VHOME`
if( $RETURNCODE != 0 )
{
echo 'Sorry, no mailbox here by that name. vpopmail (#5.1.1)'
EXITCODE=100
log "bouncing"
exit
}


#log $SENDMAIL

# spam directory for automatic spam filtering
SPAMDIR="$VHOME/Maildir/.Spam"
`/usr/bin/test -d $SPAMDIR`
SPAMDIRF="$RETURNCODE"
log "SPAMDIR: $SPAMDIR SPAMDIRF: $SPAMDIRF"


# dotqmail
DOTQMAIL="$VHOME/.qmail"
`/usr/bin/test -f $DOTQMAIL`
DOTQMAILF="$RETURNCODE"
log "DOTQMAIL: $DOTQMAIL DOTQMAILF: $DOTQMAILF"

# further maildrop filters (configured via sqwebmail)
SQMAILF="$VHOME/.mailfilter"
`/usr/bin/test -f $SQMAILF`
SQMAILFF="$RETURNCODE"
log "SQMAILF: $SQMAILF SQMAILFF: $SQMAILFF"




if ($SPAMDIRF == 0)
{
if (/^X-Spam-Flag: *YES/)
{
log "xspam yes and spamdir exists"
exception {
# to Spamfolder
to "$SPAMDIR"
}
}
}

if ($DOTQMAILF == 0)
{
exception {
# proceed with .qmail
log ".qmail exists"
to "$VPOP"
}
}

if ($SQMAILFF == 0)
{
exception {
# proceed with maildrop filters
log "include filters"
include $VHOME/.mailfilter
}
exception {
# proceed
log "standard delivery after filter inclusion"
to "$VPOP"
}

}
else
{
exception {
# proceed
log "standard delivery"
to "$VPOP"
}
}

log "end"
Tom Collins
2004-03-06 16:56:44 UTC
Permalink
i did the upgrade to 5.4.0 and unfortunately it did not help. If I use
the maildrop script and have a .qmail file with a forward mailaddress
the e-mail disappears. See logs and my original posting below.
Does it work properly without maildrop? I don't use or know much about
maildrop, but I do know that vdelivermail should work in its native
configuration.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Andreas Wiesmann
2004-03-06 18:42:19 UTC
Permalink
Post by Tom Collins
Post by Andreas Wiesmann
i did the upgrade to 5.4.0 and unfortunately it did not help. If I
use the maildrop script and have a .qmail file with a forward
mailaddress the e-mail disappears. See logs and my original posting
below.
Does it work properly without maildrop? I don't use or know much
about maildrop, but I do know that vdelivermail should work in its
native configuration.
thanks for your help tom!

yes it works if | /mailboxen/vpopmail/bin/vdelivermail ''
bounce-no-mailbox" is in the .qmail-default. that is what I dont
understand. The interesting thing is that it really parses the .qmail
file if called from within maildrop but fails to send the message. I
was wondering if there is a restriction of some kind if I call
velivermail from maildrop instead of .qmail-default... if it turns
out to be an interaction thing between maildrop and vpopmail it could
turn out tricky to find help and an answer ;). I dont know if many
people from the sqwebmail (uses maildrop for its filtering) or
maildrop community read this list or maybe I should give it a try
there.

andrej
Barry Solof
2004-03-04 15:18:15 UTC
Permalink
Hi,

qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.

Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.

I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.

If you want my script file let me know.

Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Frankie Wong
2004-03-04 19:03:23 UTC
Permalink
I will be pleased if you can send me your script in order to let me have a better reference for my own script design.

Regards,

Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Barry Solof
2004-03-04 19:21:35 UTC
Permalink
Hi,

Here's my scripts. There is probably a better way to do this but it
works on our system.

.qmailadmin-hooks:
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--

make_dirs.sh:
--snip--
#!/bin/bash

NEWFOLDER=".Sent"

# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4

THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--

Good luck!

Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me have a better reference for my own script design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Frankie Wong
2004-03-05 02:54:45 UTC
Permalink
Hi,

It doesn't work in my system even all script and file location exactly matching to your example.

Any suggestions or hightlight ?

Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me have a better reference for my own script design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Barry Solof
2004-03-05 14:52:16 UTC
Permalink
Hmmm. Since all the file locations are the same it is probably a rights
issue.

Make sure that .qmailadmin-hooks and make_dirs.sh are owned by the
correct user and group. In many cases that would be owner vpopmail and
group vchkpw.

Also, my http server is not running under user "apache" but as user
"vpopmail". This was necessary in order to run the vmailadmin plugin in
the Squirrelmail webmail client. It may be the reason it runs easily on
my server.

Barry
Post by Frankie Wong
Hi,
It doesn't work in my system even all script and file location exactly matching to your example.
Any suggestions or hightlight ?
Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me have a better reference for my own script design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Frankie Wong
2004-03-06 09:18:30 UTC
Permalink
Yes, sure both .qmailadmin-hooks and make_dirs.sh are owned by vpopmail:vchkpw and mode of make_dirs.sh is 755.

.qmailadmin-hooks seems not work and not execute make_dirs.sh even I insert something into make_dirs.sh like this:

touch /tmp/test

but nothing is created in /tmp.

Since I direct use qmailadmin, not the plugin to squirrelmail, I think apache user is not related to this issue, right
? How can I know or Is there any way to create a log for me to inspect such kind of error ?

Best Regards,

Frankie
Post by Barry Solof
Hmmm. Since all the file locations are the same it is probably a rights
issue.
Make sure that .qmailadmin-hooks and make_dirs.sh are owned by the
correct user and group. In many cases that would be oner vpopmail and
group vchkpw.
Also, my http server is not running under user "apache" but as user
"vpopmail". This was necessary in order to run the vmailadmin plugin in
the Squirrelmail webmail client. It may be the reason it runs easily on
my server.
Barry
Post by Frankie Wong
Hi,
It doesn't work in my system even all script and file location exactly matching to your example.
Any suggestions or hightlight ?
Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me have a better reference for my own script
design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create
directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Barry Solof
2004-03-06 15:13:56 UTC
Permalink
If you have .qmailadmain-hooks in either the /home/vpopmail/etc or
/home/vpopmail/domains/domain_name/ directories and the ownerships are
right then it should be working.

Unfortunately I don't know a good way to debug this.

Is there anyone else on the list who works with the hooks who can help?

Thanks,
Barry
Post by Frankie Wong
Yes, sure both .qmailadmin-hooks and make_dirs.sh are owned by
vpopmail:vchkpw and mode of make_dirs.sh is 755.
.qmailadmin-hooks seems not work and not execute make_dirs.sh even I
touch /tmp/test
but nothing is created in /tmp.
Since I direct use qmailadmin, not the plugin to squirrelmail, I think
apache user is not related to this issue, right
? How can I know or Is there any way to create a log for me to inspect such kind of error ?
Best Regards,
Frankie
Post by Barry Solof
Hmmm. Since all the file locations are the same it is probably a rights
issue.
Make sure that .qmailadmin-hooks and make_dirs.sh are owned by the
correct user and group. In many cases that would be oner vpopmail and
group vchkpw.
Also, my http server is not running under user "apache" but as user
"vpopmail". This was necessary in order to run the vmailadmin plugin in
the Squirrelmail webmail client. It may be the reason it runs easily on
my server.
Barry
Post by Frankie Wong
Hi,
It doesn't work in my system even all script and file location exactly
matching to your example.
Any suggestions or hightlight ?
Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me
have a better reference for my own script
design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file.
Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to
alter vpopmail.c in order to create
directory
for spam email automatically. However, it is only for version
5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Tom Collins
2004-03-06 17:05:47 UTC
Permalink
Post by Barry Solof
If you have .qmailadmain-hooks in either the /home/vpopmail/etc or
/home/vpopmail/domains/domain_name/ directories and the ownerships are
right then it should be working.
Unfortunately I don't know a good way to debug this.
Make sure you're running QmailAdmin 1.2.0 or later, as hooks were
broken in previous versions.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-07 03:23:19 UTC
Permalink
It works after I change the apache user from apache:apache to vpopmail:vchkpw.

Regards,

Frankie
Post by Barry Solof
If you have .qmailadmain-hooks in either the /home/vpopmail/etc or
/home/vpopmail/domains/domain_name/ directories and the ownerships are
right then it should be working.
Unfortunately I don't know a good way to debug this.
Is there anyone else on the list who works with the hooks who can help?
Thanks,
Barry
Post by Frankie Wong
Yes, sure both .qmailadmin-hooks and make_dirs.sh are owned by
vpopmail:vchkpw and mode of make_dirs.sh is 755.
.qmailadmin-hooks seems not work and not execute make_dirs.sh even I
touch /tmp/test
but nothing is created in /tmp.
Since I direct use qmailadmin, not the plugin to squirrelmail, I think
apache user is not related to this issue, right
? How can I know or Is there any way to create a log for me to inspect
such kind of error ?
Best Regards,
Frankie
Post by Barry Solof
Hmmm. Since all the file locations are the same it is probably a rights
issue.
Make sure that .qmailadmin-hooks and make_dirs.sh are owned by the
correct user and group. In many cases that would be oner vpopmail and
group vchkpw.
Also, my http server is not running under user "apache" but as user
"vpopmail". This was necessary in order to run the vmailadmin plugin in
the Squirrelmail webmail client. It may be the reason it runs easily on
my server.
Barry
Post by Frankie Wong
Hi,
It doesn't work in my system even all script and file location exactly
matching to your example.
Any suggestions or hightlight ?
Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me
have a better reference for my own script
design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file.
Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to
alter vpopmail.c in order to create
directory
for spam email automatically. However, it is only for version
5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Frankie Wong
2004-03-07 12:04:39 UTC
Permalink
After I success to set automatically add spam directory by qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
in qmailadmin when del user:

Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm

My setting of qmailadmin-hooks are as follows:

.qmailadmin-hooks:

adduser /home/vpopmail/bin/addspamdir.sh
deluser /home/vpopmail/bin/deletedata.sh

/home/vpopmail/bin/deletedata.sh:

#!/bin/bash
USERNAME=$1
DOMAIN=$2

if [ -e /var/www/data/$USERNAME@$DOMAIN.pref ]; then

/bin/bash -c "/bin/rm -rf /var/www/data/$USERNAME@$DOMAIN.pref"
fi

The problem seems not come from the script because it still appear even if I
remark all in deletedata.sh

Any suggestions ?

Regards,

Frankie
Post by Frankie Wong
It works after I change the apache user from apache:apache to vpopmail:vchkpw.
Regards,
Frankie
Post by Barry Solof
If you have .qmailadmain-hooks in either the /home/vpopmail/etc or
/home/vpopmail/domains/domain_name/ directories and the ownerships are
right then it should be working.
Unfortunately I don't know a good way to debug this.
Is there anyone else on the list who works with the hooks who can help?
Thanks,
Barry
Post by Frankie Wong
Yes, sure both .qmailadmin-hooks and make_dirs.sh are owned by
vpopmail:vchkpw and mode of make_dirs.sh is 755.
.qmailadmin-hooks seems not work and not execute make_dirs.sh even I
touch /tmp/test
but nothing is created in /tmp.
Since I direct use qmailadmin, not the plugin to squirrelmail, I think
apache user is not related to this issue, right
? How can I know or Is there any way to create a log for me to inspect
such kind of error ?
Best Regards,
Frankie
Post by Barry Solof
Hmmm. Since all the file locations are the same it is probably a rights
issue.
Make sure that .qmailadmin-hooks and make_dirs.sh are owned by the
correct user and group. In many cases that would be oner vpopmail and
group vchkpw.
Also, my http server is not running under user "apache" but as user
"vpopmail". This was necessary in order to run the vmailadmin plugin in
the Squirrelmail webmail client. It may be the reason it runs easily on
my server.
Barry
Post by Frankie Wong
Hi,
It doesn't work in my system even all script and file location exactly
matching to your example.
Any suggestions or hightlight ?
Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me
have a better reference for my own script
design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file.
Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to
alter vpopmail.c in order to create
directory
for spam email automatically. However, it is only for version
5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Tom Collins
2004-03-07 16:45:12 UTC
Permalink
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
Upgrade to qmailadmin 1.2.0 or later, as mentioned in a previous email.
<http://qmailadmin.sf.net/>

Hooks were majorly broken until 1.2.0-pre1. That error message was
removed in the cleanup, so you're running old code.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-07 17:03:28 UTC
Permalink
My version is the updated one (1.2.1). Is there any setting I should highlight ?

Regards,

Frankie
Post by Tom Collins
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
Upgrade to qmailadmin 1.2.0 or later, as mentioned in a previous email.
<http://qmailadmin.sf.net/>
Hooks were majorly broken until 1.2.0-pre1. That error message was
removed in the cleanup, so you're running old code.
--
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-07 17:25:42 UTC
Permalink
qmailadmin-1.2.1 was download from shupp.org. Should I turn back to version 1.2.0 ?

Regards,

Frankie
Post by Frankie Wong
My version is the updated one (1.2.1). Is there any setting I should highlight ?
Regards,
Frankie
Post by Tom Collins
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
Upgrade to qmailadmin 1.2.0 or later, as mentioned in a previous email.
<http://qmailadmin.sf.net/>
Hooks were majorly broken until 1.2.0-pre1. That error message was
removed in the cleanup, so you're running old code.
--
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Tom Collins
2004-03-07 23:15:42 UTC
Permalink
Post by Frankie Wong
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
My version is the updated one (1.2.1). Is there any setting I should highlight ?
Regards,
Frankie
If you get that error message, then you aren't running 1.2.1.

Find your qmailadmin binary (in the cgi-bin directory) and delete it.
In your web browser, go to the qmailadmin URL and make sure you get a
"page not found" error.

Now, make and install 1.2.1. That error string was removed during the
1.2.0 pre-releases.

And yes, you can use 1.2.1 instead of 1.2.0.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-08 09:35:20 UTC
Permalink
The error message still exist after I installed qmailadmin-1.2.1 that download from http://qmailadmin.sf.net.

I am sure that it is not caused by the cache of my brower.

Will it caused by some special default setting of Mandrake ?

Regards,

Frankie
Post by Tom Collins
Post by Frankie Wong
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
My version is the updated one (1.2.1). Is there any setting I should highlight ?
Regards,
Frankie
If you get that error message, then you aren't running 1.2.1.
Find your qmailadmin binary (in the cgi-bin directory) and delete it.
In your web browser, go to the qmailadmin URL and make sure you get a
"page not found" error.
Now, make and install 1.2.1. That error string was removed during the
1.2.0 pre-releases.
And yes, you can use 1.2.1 instead of 1.2.0.
--
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-08 10:59:08 UTC
Permalink
Sorry, it is caused by a blank line at the beginning of script file.

Best Regards,

Frankie
Post by Frankie Wong
The error message still exist after I installed qmailadmin-1.2.1 that download from http://qmailadmin.sf.net.
I am sure that it is not caused by the cache of my brower.
Will it caused by some special default setting of Mandrake ?
Regards,
Frankie
Post by Tom Collins
Post by Frankie Wong
Post by Frankie Wong
After I success to set automatically add spam directory by
qmailadmin-hooks,
I try to set automatically delete any user.pref file in the data directory
of squirrelmail when del user in qmailadmin. However , error message appears
Error 8 Where the parameters are: "/home/vpopmail/bin/deletedata.sh",
deluser, test, test.com.hk, , Content-Type: text/htm
My version is the updated one (1.2.1). Is there any setting I should highlight ?
Regards,
Frankie
If you get that error message, then you aren't running 1.2.1.
Find your qmailadmin binary (in the cgi-bin directory) and delete it.
In your web browser, go to the qmailadmin URL and make sure you get a
"page not found" error.
Now, make and install 1.2.1. That error string was removed during the
1.2.0 pre-releases.
And yes, you can use 1.2.1 instead of 1.2.0.
--
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Tom Collins
2004-03-07 16:46:59 UTC
Permalink
Post by Frankie Wong
It works after I change the apache user from apache:apache to
vpopmail:vchkpw.
That should be unnecessary, as qmailadmin is a suid binary and will run
as user vpopmail:vchkpw on a properly configured system.

If you can authenticate with qmailadmin, and list/add/delete users,
then there should be no need to set apache to run as vpopmail:vchkpw.

Please see my other email about upgrading qmailadmin to v1.2.0 or later.

--
Tom Collins - ***@tomlogic.com
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Frankie Wong
2004-03-07 17:08:53 UTC
Permalink
I tried it many times but it really works only after I change apache user to vpopmail:vchkpw under Mandrake 9.2.

Regards,

Frankie
Post by Tom Collins
Post by Frankie Wong
It works after I change the apache user from apache:apache to
vpopmail:vchkpw.
That should be unnecessary, as qmailadmin is a suid binary and will run
as user vpopmail:vchkpw on a properly configured system.
If you can authenticate with qmailadmin, and list/add/delete users,
then there should be no need to set apache to run as vpopmail:vchkpw.
Please see my other email about upgrading qmailadmin to v1.2.0 or later.
--
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
Jeremy Kitchen
2004-03-08 04:48:13 UTC
Permalink
Loading Image... <-- please, think of the kittens!
Post by Frankie Wong
I tried it many times but it really works only after I change apache
user to vpopmail:vchkpw under Mandrake 9.2.
mandrake has a daemon that likes to change permissions under your feet.
I believe it's called 'msec' either configure it properly, or disable
it. It's probably removing the setuid flag on the qmailadmin binary.
There should be no reason to have to run apache as the vpopmail user.

-Jeremy
--
Jeremy Kitchen
Systems Administrator
***@inter7.com
Kitchen @ #qmail on EFNet - Join the party!
.....................
Inter7 Internet Technologies, Inc.
www.inter7.com
866.528.3530 toll free
847.492.0470 int'l
847.492.0632 fax
GNUPG key ID: 93BDD6CE
Frankie Wong
2004-03-05 05:06:32 UTC
Permalink
I have tried the follows but it can't work

.qmailadmin-hooks:

/adduser /home/vpopmail/domains/mkspamdirs.sh

mkspamdirs.sh:

USERNAME=$1
DOMAIN=$2
SPAMFOLDER=".Spam"
THEDIR=`/home/vpopmail/domains/$DOMAIN/$USERNAME`

exec /usr/local/bin/maildirmake `$THEDIR/Maildir/$SPAMFOLDER`

Please point out what error in my script because I am newbie to shell script.

Regards,

Frankie
Post by Barry Solof
Hi,
Here's my scripts. There is probably a better way to do this but it
works on our system.
--snip--
adduser /home/vpopmail/domains/make_dirs.sh
--snip--
--snip--
#!/bin/bash
NEWFOLDER=".Sent"
# From qmailadmin hooks
USERNAME=$1
DOMAIN=$2
PASSWORD=$3
FULLNAME=$4
THEDIR=`cat /home/vpopmail/domains/$DOMAIN/vpasswd | grep $USERNAME |
awk -F":" '{print $6}'`
mkdir $THEDIR/Maildir/$NEWFOLDER >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/new >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/cur >&/dev/null
mkdir $THEDIR/Maildir/$NEWFOLDER/tmp >&/dev/null
echo INBOX$NEWFOLDER >> $THEDIR/Maildir/courierimapsubscribed
chown -R vpopmail.vchkpw $THEDIR/Maildir/ #only needed if script not run
by vpopmail
chmod -R 700 $THEDIR/Maildir/$NEWFOLDER #only needed if script not run
by vpopmail
--snip--
Good luck!
Barry
Post by Frankie Wong
I will be pleased if you can send me your script in order to let me have a better reference for my own script design.
Regards,
Frankie
Post by Barry Solof
Hi,
qmailadmin has "hooks" that will allow you to send info to other places
when you add, delete or modify a user. Read the document
/var/src/qmailadmin-xxxxx/README.hooks for details.
Basically, it'll tell you to create a .qmailadmin-hooks file, what to
put in it and the various places you may want to place the file. Make
sure that .qmailadmin-hooks has the correct user and group ownership, too.
I use it to call a bash script. It could probably also call
/usr/lib/courier-imap/bin/maildirmake.
If you want my script file let me know.
Barry
Post by f***@vista-paradiso.com.hk
http://www.jerfu.com/toaster/FullToaster_1.0.6.html show me a way to alter vpopmail.c in order to create directory
for spam email automatically. However, it is only for version 5.3.11. Is there any link that can show
me related information about vpopmail 5.4.1 ?
Regards,
Frankie
Loading...