My apologize for the PPS, but without the && it also seems to work: [rocketmouse@archlinux ~]$ cat .msmtp.mail/fraud.mail | msmtp -a default ralf.mardorf@rocketmial.com; RETVAL=$?; echo $RETVAL 0 The "0" is displayed with delay, IOW RETVAL=$?; echo $RETVAL has to wait until the sending of the mail finished.