################
# ezmlm-return #
################

  prompt "ezmlm-return:         "

  SENDER="${BNC}@$HOST"
  LOCAL="$LIST-return-1-$BNC=$HOST"
  DEFAULT="1-$BNC=$HOST"
# we use 'du' because bounce handling is different in 0.31x and >=0.32
  BSIZE1=`du "${DIR}/bounce"` || \
	{ echo "du doesn't work"; exit 99; } 
  make_message | ${EZBIN}/ezmlm-return "$DIR" || \
    [ "$?" -eq "99" ] || \
	fatal "failed to process normal bounce from non-sub"
  BSIZE2=`du "${DIR}/bounce"`
  if [ "$BSIZE1" != "$BSIZE2" ]; then
	fatal "failed to ignore non-subscriber bounce"
  fi
  ${EZBIN}/ezmlm-sub "$DIR" "${BNC}@$HOST"
  make_message | ${EZBIN}/ezmlm-return "$DIR" || \
    [ "$?" -eq "99" ] || \
	fatal "failed to process normal bounce from sub"
  BSIZE1=`du "${DIR}/bounce"`
  if [ "$BSIZE1" = "$BSIZE2" ]; then
	fatal "failed to note subscriber bounce"
  fi
  LOCAL="$LIST-digest-return-1-$BNC=$HOST"
  DEFAULT="1-$BNC=$HOST"
  BSIZE1=`du "${DIR}/digest/bounce"`
  make_message | ${EZBIN}/ezmlm-return -d "$DIR" || \
    [ "$?" -eq "99" ] || \
	fatal "failed to process normal digest non-sub bounce"
  BSIZE2=`du "${DIR}/digest/bounce"`
  if [ "$BSIZE1" != "$BSIZE2" ]; then
	fatal "failed to ignore non-digest-subscriber bounce"
  fi
  ${EZBIN}/ezmlm-unsub "$DIR" "${BNC}@$HOST"
  ${EZBIN}/ezmlm-sub "$DIR" digest "${BNC}@$HOST"
  make_message | ${EZBIN}/ezmlm-return -d "$DIR" || \
    [ "$?" -eq "99" ] || \
	fatal "failed to proc. nl digest-subscriber bounce"
  BSIZE1=`du "${DIR}/digest/bounce"`
  if [ "$BSIZE1" = "$BSIZE2" ]; then
	fatal "failed to note digest-subscriber bounce"
  fi
  ${EZBIN}/ezmlm-sub "$DIR" "${BNC}@$HOST"

  echo "OK"

# as we exit, the bounce address is subscribed to both list and digest-list
# and is the SENDER
