changeset 121:61df67459e30

Comment
author Franz Glasner <fzglas.hg@dom66.de>
date Wed, 16 Oct 2019 00:08:27 +0200
parents 5366fb3b222c
children 00b99c1f039c
files bin/bsmtp2dma
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/bin/bsmtp2dma	Wed Oct 16 00:03:08 2019 +0200
+++ b/bin/bsmtp2dma	Wed Oct 16 00:08:27 2019 +0200
@@ -169,6 +169,10 @@
         return ${_rc}
     fi
 
+    #
+    # Start the mailer **before** opening the pipe; otherwise a
+    # deadlock occurs
+    #
     "$MAILER" -f "${_sender_addr}" "${_recipient_addr}" <${MAILFIFO_STDIN} >${MAILFIFO_STDOUT} &
     _pid_mailer=$!
 
@@ -211,7 +215,7 @@
     # printf ".\n" >&3
     IFS="$_oifs"
 
-    # close the fd to the pipe: coproc should get EOF
+    # close the fd to the pipe: coproc should get EOF and terminate
     exec 3>&-
     # read eventually remaining stuff from the mailer until EOF
     IFS='' read _dummy <&4