]> diplodocus.org Git - nmh/blobdiff - uip/mhmail
mhstore(1) now obeys its -noverbose switch.
[nmh] / uip / mhmail
index 916732d8f502c0f5d68fc9e18d5c415fbdb1adaf..92bf2dbb832f5a65499a0f461f0b76837d974e80 100755 (executable)
@@ -84,8 +84,7 @@ fi
 tolist=                     ## To: addresses
 toarg=0                     ## whether currently handling -to
 attacharg=0                 ## whether currently handling -attach
 tolist=                     ## To: addresses
 toarg=0                     ## whether currently handling -to
 attacharg=0                 ## whether currently handling -attach
-attach_send_switch_added=0  ## whether added "-attach Nmh-Attachment" switch
-attachind=Nmh-Attachment    ## attachment indicator
+attachind=Attach            ## attachment indicator
 body=                       ## contents of the message body
 bodyarg=0                   ## whether currently handling -body
 cclist=                     ## Cc: addresses
 body=                       ## contents of the message body
 bodyarg=0                   ## whether currently handling -body
 cclist=                     ## Cc: addresses
@@ -114,11 +113,7 @@ for arg in "$@"; do
        mhmailswitch=1
        attacharg=1
        use_send=1
        mhmailswitch=1
        attacharg=1
        use_send=1
-       if [ $attach_send_switch_added -eq 0 ]; then
-         #### Override any send -attach switch in user's profile.
-         postsendargs="${postsendargs:+$postsendargs }-attach $attachind"
-         attach_send_switch_added=1
-       fi ;;
+       ;;
     -b|-bo|-bod|-body) mhmailswitch=1; bodyarg=1 ;;
     -c|-cc) mhmailswitch=1; ccarg=1 ;;
     -f|-fr|-fro|-from) mhmailswitch=1; fromarg=1 ;;
     -b|-bo|-bod|-body) mhmailswitch=1; bodyarg=1 ;;
     -c|-cc) mhmailswitch=1; ccarg=1 ;;
     -f|-fr|-fro|-from) mhmailswitch=1; fromarg=1 ;;
@@ -209,15 +204,18 @@ if [ "$headerfieldlist" ]; then
   header="$header$headerfieldlist"
 fi
 
   header="$header$headerfieldlist"
 fi
 
-#### Set up a file to supply as a draft to post/send.  And set a
-#### trap to remove it.  send moves the file to a backup, so it will
-#### remove that, too.
+#### Set up a file to supply as a draft to post/send.  And set a trap
+#### to remove it.  send moves the file to a backup and can create a
+#### .orig file, so it will remove them, too.
 umask 077
 umask 077
-tmpdir="${MHTMPDIR:-${TMPDIR:-${TMP:-`$nmhbindir/mhpath +`}}}"
+tmpdir="${MHTMPDIR:-${TMPDIR:-`$nmhbindir/mhpath +`}}"
 tmpfile="$tmpdir/mhmail$$"
 tmpfile="$tmpdir/mhmail$$"
-tmpfilebackup="'$tmpdir'/,mhmail$$ '$tmpdir'/#mhmail$$"
+backup_char=`"$nmhbindir"/mhparam sbackup`
+tmpfilebackup="'$tmpdir'/${backup_char}mhmail$$*"
 tmpfileresent=
 
 tmpfileresent=
 
+trap "rm -f '$tmpfile' $tmpfilebackup ${tmpfileresent:+'$tmpfileresent'}" 0
+
 message_file=
 if [ $resent -eq 0 ]; then
   #### Add blank line after header if not resending.
 message_file=
 if [ $resent -eq 0 ]; then
   #### Add blank line after header if not resending.
@@ -240,8 +238,6 @@ else
   fi
 fi
 
   fi
 fi
 
-trap "rm -f '$tmpfile' $tmpfilebackup ${tmpfileresent:+'$tmpfileresent'}" 0
-
 if [ "$body"x = x ]; then
   #### First put message header in the file.
   printf %s "$header" >"$tmpfile" || exit 2
 if [ "$body"x = x ]; then
   #### First put message header in the file.
   printf %s "$header" >"$tmpfile" || exit 2