fwd-only flag

This commit is contained in:
Serghey Rodin 2013-11-13 11:40:23 +02:00
commit 3e521cb8a2
11 changed files with 202 additions and 6 deletions

View file

@ -287,6 +287,17 @@ update_object_value() {
$USER_DATA/$1.conf
}
# Add object key
add_object_key() {
row=$(grep -n "$2='$3'" $USER_DATA/$1.conf)
lnr=$(echo $row | cut -f 1 -d ':')
object=$(echo $row | sed "s/^$lnr://")
if [ -z "$(echo $object |grep $4=)" ]; then
eval old="$4"
sed -i "$lnr s/$5='/$4='' $5='/" $USER_DATA/$1.conf
fi
}
# Search objects
search_objects() {
OLD_IFS="$IFS"

View file

@ -435,8 +435,10 @@ rebuild_mail_domain_conf() {
rm -f $HOMEDIR/$user/conf/mail/$domain/antivirus
rm -f $HOMEDIR/$user/conf/mail/$domain/protection
rm -f $HOMEDIR/$user/conf/mail/$domain/passwd
rm -f $HOMEDIR/$user/conf/mail/$domain/fwd_only
touch $HOMEDIR/$user/conf/mail/$domain/aliases
touch $HOMEDIR/$user/conf/mail/$domain/passwd
touch $HOMEDIR/$user/conf/mail/$domain/fwd_only
# Adding antispam protection
if [ "$ANTISPAM" = 'yes' ]; then
@ -519,6 +521,9 @@ rebuild_mail_domain_conf() {
if [ ! -z "$FWD" ]; then
echo "$account@$domain:$FWD" >> $dom_aliases
fi
if [ "$FWD_ONLY" = 'yes' ]; then
echo "$account" >> $HOMEDIR/$user/conf/mail/$domain/fwd_only
fi
done
# Set permissions