./set_permissions.sh email , Not recursive chown & chmod inside folder majordomo

mean

Verified User
Joined
Feb 14, 2007
Messages
108
Dear DA Team

I found a problem about mailing list

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

pipe to |/etc/virtual/majordomo/wrapper resend -C /etc/virtual/xxx.com/majordomo/majordomo.cf -l hod -h xxx.com -f owner-hod [email protected]
generated by [email protected]
local delivery failed

pipe to |/etc/virtual/majordomo/wrapper resend -C /etc/virtual/xxx.com/majordomo/majordomo.cf -l hod -h xxx.com -f owner-hod [email protected]
-bash: pipe: command not found
-bash: /etc/virtual/majordomo/wrapper: Permission denied

"./set_permission.sh email" are not recursive chown & chmod to file in majordomo directory
Code:
email()
{
        log "email";

        VDIR=/etc/virtual
        HN=`hostname`

        find "$VDIR" -type d -exec chmod 750 {} \; -exec chown mail:mail {} \;
        find "$VDIR" -type f -exec chmod 640 {} \; -exec chown mail:mail {} \;

        set_file $VDIR mail mail 755

        set_file $VDIR/domainowners mail mail 640
        set_file $VDIR/domains mail mail 640
        set_file $VDIR/majordomo majordomo daemon 750
....


Correct is
set_file $VDIR/majordomo majordomo daemon 750 -R




function "set_file()"
Code:
set_file()
{
        if [ -e "$1" ] || [ "$6" = "nocheck" ]; then
                log "set $1 $2:$3 $4 flag $5";


                #chown goes first.
                #A 4755 file is set to 755 if chown is called after chmod.

                #if there is an asterisk, no quotes.
                if echo x"$1" | grep '*' > /dev/null; then

                        chown $5 $2:$3 $1
                        chmod $5 $4 $1
                else
                        chown $5 $2:$3 "$1"
                        chmod $5 $4 "$1"
                fi
        fi

}

Incorrect Permission & Owner file ,
currect is [ majordomo:daemon 750 ]

2023-06-11_205836.png


da info
version: 1.650
commit sha: ce51baa892c8b90004807fd1a8610294655d4c35
OS slug: linux_amd64
detected OS slug: debian11_amd64
package: directadmin_ce51baa892c8b90004807fd1a8610294655d4c35_linux_amd64.tar.gz
gettext support: yes
gettext path: /usr/local/directadmin/data/lang
eol timestamp: 1788220800
eol time: Sep 1 00:00 2026
 
Last edited:
Back
Top