# qmailadmin problem

## flow666

Hi,

Ive installed a new mailserver with te howto in Documentation, Tips and Tricks (https://forums.gentoo.org/viewtopic.php?t=171499)

I want to access the qmailadmin frontend now, but it always says "Invalid Login".

I looked into the Apache error_log and it states the following there:

[Sat Sep 18 11:32:01 2004] [error] [client 10.100.0.7] vmysql: can't read settings from /var/vpopmail/etc/vpopmail.mysql, referer: http://10.100.0.108/cgi-bin/qmailadmin

I thought, the problem could be a wrong permission of that file, so i changed that to world readable for testing, but it didn't help. I found out that this file was a symbolic link to /etc/vpopmail.conf so i set that file world readable too. It didn't help either. 

Google & the forum search didn't know an answer either.

Has anybody an idea?

Thanks,

flow

----------

## Jabbas

Hi!

You have wrong rights for qmailadmin binary in cgi-bin...

reemerge it or change it to that:

```
limper cgi-bin # ls -l /var/www/localhost/cgi-bin/qmailadmin

-rwsr-sr-x  1 vpopmail vpopmail 149512 pa¼ 25 00:35 /var/www/localhost/cgi-bin/qmailadmin

```

Suids for user, group and chown to vpopmail user and group.

----------

## enek

I have the same problem:

```
vmysql: can't read settings from /var/vpopmail/etc/vpopmail.mysql, referer: http://10.100.0.108/cgi-bin/qmailadmin 
```

/cgi-bin/qmailadmin 

is owned by vpopmail:vpopmail and my permissions are correct.

I also tried to emerge but that didn't help either.  Does anyone else know what the problem could be?

----------

## enek

Here is one possible solution that works:

 *Quote:*   

> QUICK NOTE : In order to use vpopmail or qmailadmin Apache must run as user vpopmail:vpopmail. You will need to edit your /etc/apache2/conf/commonapache.conf file to read
> 
> > User vpopmail
> 
> > Group vpopmail
> ...

 

Personally I don't think this is a very good solution and would like to figure out why it isn't working correctly in the first place.  I tried making all files readable by apache user but still couldn't get it to work without making apache start as vpopmail:vpopmail.

----------

## drJeckyll

nano -w /etc/group

find vpopmail:x:89:

and change it to 

vpopmail:x:89:vpopmail,apache

restart apache then ... and whoala ...

----------

## mephcpp

hi! same problem here, the above I tried and not working, permissions are fine and I set up apache to be in vpopmail group and still it's not letting me in!

----------

## kreep69

Check the permissions and ownership of /etc/vpopmail.conf

The file should be --

chmod 640 /etc/vpopmail.conf

chown root:vpopmail /etc/vpopmail.conf

That should fix it for you, if it does not also check /var/vpopmail/bin/vchkpw as that program should be --

-rws--x--x root:vpopmail vchkpw

----------

## cowgod

i am having this same problem.  help please!

here's all my relevant settings:

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

-rwx--x--x 1 vpopmail vpopmail 145752 Jan 27 14:25 qmailadmin

# ls -l /etc/vpopmail.conf

-rw-r----- 1 root vpopmail 635 Jan 31  2008 /etc/vpopmail.conf

# ls -l /var/vpopmail/bin/vchkpw

-rws--x--x 1 root vpopmail 83368 Jan 31  2008 /var/vpopmail/bin/vchkpw

# cat /etc/group | grep vpopmail

vpopmail:x:89:vpopmail,apache

```

apache vhost config:

```
<VirtualHost *:80>

  ServerName mydomain.com

  DocumentRoot "/var/www/localhost/htdocs"

  ScriptAlias /cgi-bin/ /var/www/localhost/cgi-bin/

  <Directory "/var/www/localhost/htdocs">

    Options Indexes FollowSymLinks

    AllowOverride All

    Order allow,deny

    Allow from all

  </Directory>

  <Directory "/var/www/localhost/cgi-bin">

    Options +ExecCGI

    AllowOverride All

    Order allow,deny

    Allow from all

  </Directory>

</VirtualHost>
```

when i try to login, i get the following in the apache error_log:

```
[Sun Jan 27 17:14:42 2008] [error] [client x.x.x.x] mod_mime_magic: can't read `/var/www/localhost/cgi-bin/qmailadmin'

[Sun Jan 27 17:14:51 2008] [error] [client x.x.x.x] mod_mime_magic: can't read `/var/www/localhost/cgi-bin/qmailadmin', referer: http://mydomain.com/cgi-bin/qmailadmin
```

----------

## cowgod

i cannot this thing to work right.  i simply do not understand how qmailadmin could possibly work straight out of the box.

if i change the "User" to "vpopmail" in my httpd.conf, everything works properly.  however, i certainly don't want to run my whole web server as the vpopmail user.

instead, i have installed suexec and created a different virtual host specifically for qmailadmin.  i set that virtual host to run as user/group vpopmail.  i changed the vpopmail uid/gid to 9999 so that it can run without giving an error about having too low of an id.  after all of this, i'm back at square one with an "Invalid Login" whenever i try to login.

why isn't this working?  am i totally missing something obvious?

----------

## Crymson

I just wanted to say thanks for this thread - somehow my permissions got all screwed on my qmailadmin.  Changing the owner to vpopmail:vpopmail and chmod 4755 on the qmailadmin file fixed the problems.

So, thanks to the submitters above!

----------

## dmittner

Ressurrecting something of an old thread but THANK YOU.

I was tweaking permissions, resetting passwords a dozen times, restarting every service I could think might matter.... except Apache. Restarted that and now it's working. The insanity can finally end...

----------

## ycUygB1

Honestly, this is just way too hard.  There are no useful error messages and guidance about what could be wrong.  By randomly making changes to my system, all of which are clearly wrong, I am just introducing tons of security holes.

All of the features of qmailadmin are available at the command line from the directory /var/vpopmail/bin.  Just execute the relevant commands there.

----------

