Fixing Permissions of Valiases

5/5 - (8 votes)

I wrote this script a while back to fix the permissions of alias files in /etc/valiases when users were having trouble creating forwarders. You can also download the script in plaintext here.

# Script to fix permissions of valiases
# Written by: Vanessa Vasile 5/17/10

for domain in `cat /etc/userdomains |awk '{print $1}' | grep -v "*" | cut -d: -f1`
  if ! [ -f /etc/valiases/$domain ]; then
    touch /etc/valiases/$domain
  user=$(egrep "^$domain:" /etc/userdomains |awk '{print $2}');
  chown $user:mail /etc/valiases/$domain
  chown $user:mail /etc/vdomainaliases/$domain
  chmod 644 /etc/valiases/$domain
  chmod 644 /etc/vdomainaliases/$domain

Update: cPanel now has a script to allow you to do this, but there are mixed reports on whether it actually works:


Leave a Reply

Your email address will not be published. Required fields are marked *

Log in