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 8e05a22 commit fbe3e54
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
30 changes: 27 additions & 3 deletions ezmlm-x/checkrecipient-ezmlm.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This is a Pluggable Address Module for qmail-smtpd
# This is a Pluggable Address Verification Module for qmail-smtpd
# recipients extension
# This module reads an address from descriptor 3
# if addr is an address configured in ezmlm/ezmlm-idx
Expand All @@ -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 $?
3 changes: 3 additions & 0 deletions ezmlm-x/doc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
*
Release 1.1 Start 24/07/2023
- 24/07/2023
1. added checkrecipient-ezmlm Pluggable Address Module for qmail-smtpd
recipient extension
- 22/10/2023
2. checkrecipient-ezmlm: fix for ezmlm list addresses

*
Release 1.0 Start 06/10/2018
Expand Down

0 comments on commit fbe3e54

Please sign in to comment.