Mercurial > hgrepos > FreeBSD > ports > sysutils > local-bsdtools
comparison bin/bsmtp2dma @ 121:61df67459e30
Comment
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Wed, 16 Oct 2019 00:08:27 +0200 |
| parents | 5366fb3b222c |
| children | 397bf58e85d2 |
comparison
equal
deleted
inserted
replaced
| 120:5366fb3b222c | 121:61df67459e30 |
|---|---|
| 167 if [ ${_rc} -ne 0 ]; then | 167 if [ ${_rc} -ne 0 ]; then |
| 168 rm -f "${MAILFIFO_STDIN}" | 168 rm -f "${MAILFIFO_STDIN}" |
| 169 return ${_rc} | 169 return ${_rc} |
| 170 fi | 170 fi |
| 171 | 171 |
| 172 # | |
| 173 # Start the mailer **before** opening the pipe; otherwise a | |
| 174 # deadlock occurs | |
| 175 # | |
| 172 "$MAILER" -f "${_sender_addr}" "${_recipient_addr}" <${MAILFIFO_STDIN} >${MAILFIFO_STDOUT} & | 176 "$MAILER" -f "${_sender_addr}" "${_recipient_addr}" <${MAILFIFO_STDIN} >${MAILFIFO_STDOUT} & |
| 173 _pid_mailer=$! | 177 _pid_mailer=$! |
| 174 | 178 |
| 175 exec 3>"${MAILFIFO_STDIN}" | 179 exec 3>"${MAILFIFO_STDIN}" |
| 176 exec 4<"${MAILFIFO_STDOUT}" | 180 exec 4<"${MAILFIFO_STDOUT}" |
| 209 done | 213 done |
| 210 # not all mailer recognize this | 214 # not all mailer recognize this |
| 211 # printf ".\n" >&3 | 215 # printf ".\n" >&3 |
| 212 IFS="$_oifs" | 216 IFS="$_oifs" |
| 213 | 217 |
| 214 # close the fd to the pipe: coproc should get EOF | 218 # close the fd to the pipe: coproc should get EOF and terminate |
| 215 exec 3>&- | 219 exec 3>&- |
| 216 # read eventually remaining stuff from the mailer until EOF | 220 # read eventually remaining stuff from the mailer until EOF |
| 217 IFS='' read _dummy <&4 | 221 IFS='' read _dummy <&4 |
| 218 exec 4<&- | 222 exec 4<&- |
| 219 | 223 |
