msmtp icon indicating copy to clipboard operation
msmtp copied to clipboard

msmtpq: ping uses linux-only -w for timeout

Open dbaynard opened this issue 2 years ago • 2 comments

BSD (and therefore macos) ping uses the -t flag for timeouts, not the -w for the linux tool (or the -w/--timeout for the GNU inetutils variant).

I’ve submitted NixOS/nixpkgs#195532 to fix this in the distribution I’m using (they patch msmtpq paths anyway) but it would be good to have a fix considered here. I’m not sure of the best option, but it would be very good to avoid this redirection of stderr to /dev/null, as this concealed the issue.

https://github.com/marlam/msmtp-mirror/blob/7e5e2345c3052e1b9aaa3c57ddd821b33c1d382f/scripts/msmtpq/msmtpq#L208

dbaynard avatar Oct 11 '22 14:10 dbaynard

This script does not have a maintainer currently. Can you propose a patch that ideally does not introduce problems on other systems?

marlam avatar Jan 23 '23 19:01 marlam

Since Linux also supports -t, it is not clear how to check by the ping command itself which option is intended if one does not want to parse its documentation. Therefore, better to check if it is run on a Mac by "$(uname)" = "Darwin" ?

Konfekt avatar May 07 '24 13:05 Konfekt