0

I would the mail command to use a program other than /usr/sbin/sendmail.
e.g.

$ mail --path=/usr/local/bin/mysendmail someone@somewhere.com

How can I do this?

1 Answers1

1

For bsd-mail (which Debian calls the bsd-mailx package) a sendmail option can be set in the ~/.mailrc file:

set sendmail=/root/alternatemailer

Which could instead be ssmtp or something or a simple shell script to test that this even works as documented.

$ cat /root/alternatemailer
#!/bin/sh
cat >> /root/meh
$ rm /root/meh
$ echo foo | mail -s blah nobody@example.org
$ file /root/meh
meh: ASCII text
$ 
thrig
  • 34,938