#!/bin/bash # simple wrapper that copies the file recieved by mutt to a temporary directory and open it in the background set -euo pipefail command=$1 file=$2 tmpdir=$(mktemp -p /tmp -d 'mutt-open.XXXXXXXXX') filename="${file##*/}" cp "$file" "$tmpdir/$filename" systemd-cat "$command" "$tmpdir/$filename" & disown