Skip to content

Commit

Permalink
fix for ezmlm list addresses
Browse files Browse the repository at this point in the history
  • Loading branch information
mbhangui committed Oct 22, 2023
1 parent e2c87bf commit 049fc0f
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions ezmlm-idx-x/checkrecipient-ezmlm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@
# or
# user|LIBEXEC/ezmlm/checkrecipient-ezmlm
#

check_addr()
{
# user=$1
# dir=$2

# check if ezmlm list exists
[ -n "$2" -a -d "$2/$1" ] && return 0
i=1
found=0
cut_str=$i
while true
do
str=$(echo $1 | cut -d- -f"$cut_str")
[ "$str" = "$1" ] && break
# check if ezmlm list exists
[ -d $2/$str ] && return 0
i=$(expr $i + 1)
cut_str=$cut_str",$i"
done
return 1
}

exec 0<&3
read addr

Expand All @@ -23,10 +46,11 @@ else
# check if this is one of our domains
grep $domain SYSCONFDIR/control/rcpthosts >/dev/null 2>&1
[ $? -ne 0 ] && exit 1
user=$(echo $addr | cut -d@ -f1)
user=$(echo $addr | cut -d@ -f1 | sed -e 's{-accept-.*{{' -e 's{-reject-.*{{')
# get the domain directory
dir=$(grep "+""$domain""-" SYSCONFDIR/users/assign | awk -F: '{print $5}' 2>/dev/null)
fi

# check if ezmlm list exists
[ -n "$dir" -a -d "$dir/$user" ] && exit 0 || exit 1
check_addr $user $dir
exit $?

0 comments on commit 049fc0f

Please sign in to comment.