# [SOLVED] qmailadmin can't add/edit user but delete them

## doom4

Hi,

i cant add a user with qmailadmin. i can login i can delete a user but i cant edit or add. when i try to add a user i get a message saying cant add a user

 *Quote:*   

> POP Account test1234@ (test1234) can't be added

 

(see behind @ is no domain given why?)

 and then qmailadmin goes back to the overview where normally all mail users r shown. but then the list is empty and when i click somewhere i am redirected to the login screen with a message "cant change directory".

 *Quote:*   

> Error: Can't change into the directory.

 

(the error messages r translated from german so perhaps in english thats not exactly what u expect)

any idear?

thxLast edited by doom4 on Fri Jun 23, 2006 12:35 pm; edited 1 time in total

----------

## stripe

I have the same issue, what helped me is chowning the /var/www/localhost/cgi-bin/qmailadmin to root:root. But this I personaly do not like - it is not a best thing you can do with security of that file...

On another server I have the same permissions of qmailadmin as is set in the ebuild (vpopmail:vpopmail) and it performs just fine. I am about to write some bugreport about it.

EDIT: Bug 135564

Stripe

----------

## doom4

that doesent helped for me. the mailinglist of qmailadmin isnt so active so i think i will never get the right answer :/

----------

## stripe

probably you're missing ezmlm-idx package installed before qmailadmin... but this is anything else

----------

## doom4

very funny error because i had never problems with qmailadmin before

hope somebody can tell me a solution

----------

## Kermit_CPub

Here it might be:  :Wink:  - but be warned its rather q&d ...

I had the same problem like you and it hunted me for days.

QMail changed its directory structure from .../domain/.../Maildir/... to .../domain/.../.maildir/...

As already a custom-script for qmail had to be adapted I grabbed a tarball from sourceforge and changed Line 27 (qmailadmin 1.2.9) from qmailadmin.h

from: #define MAILDIR "Maildir"

to: #define MAILDIR ".maildir"

... the result was a working QMailadmin.

The installation can be done using the quick-install, except the ./configure complaines about some missing informations. Therefore I copied & pasted the parameters from the output of  "emerge qmailadmin".

----------

## stripe

yeah, but in the ebuild you can see maildir patch which do this job. The issue is imho really about directory acls -) qmailadmin works when owned by root:root permission....

----------

## Kermit_CPub

As I followed this thread, I also tried root:root, but it did not work for me. 

My config uses vpopmail as owner of of the qmailadmin-cgi, which works fine.

----------

## stripe

hmm, this seems to be black magic   :Shocked: 

----------

## Kermit_CPub

Do you have a fresh install (like me) or did you update from an older gentoo-version?

----------

## stripe

some are updated systems and one is fresh install -) my first post in the thread helped on it...

----------

## biatch0

Got the same problem here, clean install, new machine. Manually adding users via vadduser works, but qmailadmin barfs. The chown suggestion didn't work for me, ended up not being able to login whatsoever.

Tried unmerge/emerge... ends up exactly the same.

----------

## stripe

please post

```

ls -l /var/vpopmail

ls -l /var/www/localhost/cgi-bin

```

----------

## biatch0

```
drwxr-xr-x  2 root     root     4096 Jun  9 00:53 bin

lrwxrwxrwx  1 root     root       31 Jun  9 00:53 doc -> /usr/share/doc/vpopmail-5.4.16/

drwxr-xr-x  4 vpopmail vpopmail 4096 Jun  9 03:12 domains

drwxr-xr-x  2 root     root     4096 Jun  9 00:53 etc

drwxr-xr-x  2 root     root     4096 Jun  9 00:53 include

drwxr-xr-x  2 vpopmail vpopmail 4096 Jun  9 00:53 lib

```

```
drwxr-xr-x  2 root     root       4096 Jun  9 01:46 dcc

-rw-r--r--  1 root     root        268 Jun  8 22:49 printenv

-rws--s--x  1 vpopmail vpopmail 152128 Jun  9 03:52 qmailadmin

-rw-r--r--  1 root     root        757 Jun  8 22:49 test-cgi

```

----------

## stripe

the directory /var/vpopmail must be recursively owned by vpopmail:vpopmail...

the root:root should have only file /var/www/localhost/cgi-bin/qmailadmin

so changed it and try it this way again

----------

## Kermit_CPub

Hmmm......

For me the solution was definitely manually changing to ".maildir", because this was the final change bevor qmailadmin started to work again.

But before I also changed apache ACLs and moved qmailadmin to another place:

snipset from /etc/apache2/vhosts.d

```
<VirtualHost ....

   DocumentRoot "/var/vpopmail/www"

  ....

   ScriptAlias /cgi-bin /var/vpopmail/www/cgi-bin

<Directory /var/vpopmail/www/cgi-bin>

    Options ExecCGI

    SetHandler cgi-script

    AllowOverride None

    Order allow,deny

    Allow from all

</Directory>

</VirtualHost>

    <Directory /var/vpopmail/domains>

        AllowOverride FileInfo AuthConfig Limit Indexes

        Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

       Allow from all

    </Directory>

```

btw. I had a fresh install

----------

## stripe

I have the default location within the -D default_vhost active apache module.

permissions after some small time of hacking on qmailadmin are

```

-rwsr-sr-x 1 vpopmail vpopmail 188472 Jun  8 21:56 /var/www/localhost/cgi-bin/qmailadmin

```

numericaly it is 6755 (UID,GID on execution is needed to work properly)

manual patching of qmailadmin.h is imho useless, look to the ebuild of qmailadmin 1.2.1-r1 and 1.2.9

----------

## Kermit_CPub

 *stripe wrote:*   

> manual patching of qmailadmin.h is imho useless, look to the ebuild of qmailadmin 1.2.1-r1 and 1.2.9

 

From todays point of view it really seems useless.

Just for couriosty i tried: 

 *Quote:*   

>  emerge /usr/portage/net-mail/qmailadmin/qmailadmin-1.2.9.ebuild

 

... the result was a working qmailadmin  without changing anything else  :Shocked: 

But meanwhile a did update quite a a bunch of packages ...

----------

## biatch0

 *stripe wrote:*   

> the directory /var/vpopmail must be recursively owned by vpopmail:vpopmail...
> 
> the root:root should have only file /var/www/localhost/cgi-bin/qmailadmin
> 
> so changed it and try it this way again

 Tried this already, changing ownership of /var/vpopmail makes no difference... while changing ownership of /var/www/localhost/cgi-bin/qmailadmin to root:root results in not being able to login to qmailadmin whatsoever.

I just emerged the 1.2.9 ebuild, and am now having no problems whatsoever.

----------

## doom4

I installed the vers. 1.2.9 too and its working excellent for me. so i think we can finish this threat!

THX!

----------

