MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Bugs and Requests => Topic started by: KloxoLittleFish on 2016-03-07, 16:52:34

Title: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 16:52:34
Since last update, mails not work. In maillog always:
 
Quote
send: delivery 648: deferral: not_allowed_to_perform_deliveries_as_root./

sh /script/sysinfo;
Quote
A. Control Panel:
   - Kloxo-MR: 7.0.0.b-2016030202
   - Web: hiawatha-10.1.0-f.6.mr.el6.x86_64
   - PHP: php54s-5.4.40-1.ius.el6 (fpm mode)
B. Plateform:
   - OS: CentOS release 6.7 (Final) x86_64
   - Hostname: skobox.kobox.org
C. Services:
   1. MySQL: MariaDB-server-10.0.24-1.el6.x86_64
   2. PHP:
      - Branch: php54-cli-5.4.45-1.ius.el6.x86_64
      - Multiple:
        * php52m-5.2.17-102.mr.el6
        * php53m-5.3.29-1.ius.el6
        * php54m-5.4.40-1.ius.el6
        * php55m-5.5.24-1.ius.el6
        * php56m-5.6.8-1.ius.el6
      - Used: --Use PHP Branch--
   3. Web Used: apache
     - Hiawatha: --unused--
     - Lighttpd: --uninstalled--
     - Nginx: --uninstalled--
     - Httpd: httpd-2.2.31-1.mr.el6.x86_64
       - PHP Type: php-fpm_event
   4. WebCache: none
     - ATS: --uninstalled--
     - Squid: --uninstalled--
     - Varnish: --uninstalled--
   5. Dns: bind
     - Bind: bind-9.9.7-1.mr.el6.x86_64
     - DJBDns: --uninstalled--
     - NSD: --uninstalled--
     - PowerDNS: --uninstalled--
     - Yadifa: --uninstalled--
   6. Mail: qmail-toaster-1.03-1.3.55.mr.el6.x86_64
      - pop3/imap4: courier-imap-toaster-4.1.2-1.3.18.mr.el6.x86_64
      - spam: spamassassin


/home/vpopmail/bin/vdominfo

Quote
domain: mydomain1.com
uid:    0
gid:    0
dir:

users:  2147483646

domain: mydomain2.com
uid:    0
gid:    0
dir:

users:  0

domain: mydomain3.com
uid:    7801
gid:    7801
dir:    /home/lxadmin/mail/domains/mydomain3.com
users:  0

domain: mydomain4.com
uid:    7801
gid:    7801
dir:    /home/lxadmin/mail/domains/mydomain4.com
users:  0

 :'(
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 17:21:22
mydomain1.com and mydomain2.com use uid/gid = 0 that mean root. That's why found error 'not_allowed_to_perform_deliveries_as_root'
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 17:36:19
Quote
sh /script/cleanup; sh /script/fixmail-all; reboot;


... And still does not work ...

why do it use root? where/how fixe-it? Before update it worked fine. What has changed?





Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 17:42:48
Check ownership of /home/<user>/mydomain1.com and /home/<user>/mydomain2.com
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 17:56:58
Check ownership of /home/<user>/mydomain1.com and /home/<user>/mydomain2.com

they are ok:

Quote
drwxr-x--x  userdomain1 apache
drwxr-x--x  userdomain2 apache

where did /home/vpopmail/bin/vdominfo get the info?
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 18:02:12
Inform here 'id  userdomain1; id  userdomain2'.
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 18:04:45
uid=7799(userdomain1) gid=7799(userdomain1) grupos=7799(userdomain1)
uid=7800(userdomain2) gid=7800(userdomain2) grupos=7800(userdomain2)
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 18:20:04
Inform from 'id <user>' not match to 'vdominfo'.

Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 18:29:08
I know ... but ... why? ... from where did 'vdominfo' get the uid-info?

in ls -l /home/lxadmin/mail/domains/
Quote
*
drwx------ userdomain2 userdomain2   mydomain2.com
*


in ls -l /home/lxadmin/mail/domains/mydomain2.com
Quote
*
drwx------ vpopmail vchkpw postmaster
*
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 18:32:22
From 'vpopmail' database.
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 18:49:19
pw_uid and pw_gid  are 0 in vpopmail table emails (in all emails)
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 18:52:59
Search domain like 'dom_1234' in dir_control where 1234 is uid of client
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 19:16:14
Are: dom_7800, dom_7801 and dom_89. Not dom_7799
All have equal values but different cur_users.

What can I do?
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 19:17:49
The problem is 'dom_89'. Try rename to 'dom_7799'
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 19:28:11
89 is the vpopmail user, i insert dom_7799, sh /script/fixmail-all, reboot, but not work.

I can send emails but not read. In log show:

Quote
send: delivery 811: deferral: Not_allowed_to_perform_deliveries_as_root./
*
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: MRatWork on 2016-03-07, 19:32:48
You are missing iud 7799 and 89 (less then 500) act like 'root'.
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 19:59:04
renamed 89 to 7799 .. but not work
Title: Re: maillog: deferral: Not_allowed_to_perform_deliveries_as_root
Post by: KloxoLittleFish on 2016-03-07, 21:44:21
I researched ... "/home/vpopmail/bin/vdominfo" info is in "/var/qmail/users/assign" file ...

I see here a bad format string:
Quote
+mydomain.com-:mydomain.com:::/home/lxadmin/mail/domains//home/vpopmail/domains/mydomain.com:-::

good format string (7800 is my userdomain):
Quote
+mydomain.com-:mydomain.com:7800:7800:/home/lxadmin/mail/domains/mydomain.com:-::

... then i go ... "../bin/fix/fix-qmail-assign.php" and in resetQmailAssign function i read ...

Quote
   $mpath = "/home/lxadmin/mail/domains";

and

Quote
$con->select_db("vpopmail");
   $result = $con->query("SELECT pw_name, pw_domain, pw_dir FROM vpopmail");
   if (!isset($result)) { return; }
   $n = array();

while ($row = $result->fetch_array(MYSQLI_ASSOC)) {
      // MR -- need this team to fix issue where prefix account as the same as prefix domain
      //       like your@yourdomain.com (the same 'your')
      $temp = str_replace($mpath . "/", '', $row['pw_dir']);
      $n[$row['pw_domain']] = $mpath . "/" . str_replace("/" . $row['pw_name'], '', $temp);
   }


but in my "vpopmail" database ... old domains have: "pw_dir"=> /home/vpopmail/domains/mydomain.com/Postmaster ...

To resolve it, I have updated the "pw_dir" field  in "vpopmail" database:

Quote
update vpopmail set pw_dir=replace(pw_dir, '/home/vpopmail/domains/','/home/lxadmin/mail/domains/')  where pw_dir like '/home/vpopmail/domains/%'

Then:
Quote
sh /script/fixmail-all; sh /script/restart-mail;