-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
msmtp: msmtpq broken on darwin (ping) #195532
Comments
This should be fixed upstream, but in the mean-time we can fake it on linux (since we need the suid wrapper) or otherwise use ping from inetutils on darwin. Do you feel like doing a PR? I don't have any readily available machine running mac for testing. |
Happy to make the PR, though I didn't quite understand your first sentence. Which option would you prefer? I've been wrapping { makeWrapper, msmtp, runCommandLocal }:
runCommandLocal "wrap-msmtmp"
{
buildInputs = [ makeWrapper ];
} ''
mkdir -p "$out/bin"
makeWrapper "${msmtp}/bin/msmtpq" "$out/bin/msmtpq" \
--argv0 msmtpq \
--set EMAIL_CONN_TEST n
'' I could adjust the derivation (probably by patching in |
Sorry about the lack of clarity. Your workaround works of course, but it removes functionality on darwin, so I'd rather we do something like what is done in the referenced PR. |
And to answer your question, ping is excluded because on nixos we have to pick up the impure version in |
Describe the bug
The msmtp sendmail wrapper script, msmtp, checks that there's a network connection before attempting to send emails. The default uses
ping
, which results in a (silenced) error on darwin. Looks like #185343 is relevant — I don’t understand whyping
is excluded (and this can be fixed without changingfake.external
).`connect_test`, from `msmtpq`, as patched by nixpkgs
The
ping
call uses an option that is unavailable on macos ping.The nixpkgs version of ping (
inetutils
) works.A workaround is to call
msmtpq
withEMAIL_CONN_TEST
set tox
,n
ors
, for no testing, netcat testing (nix-provided netcat) or bash socket testing, respectively.I think the bug is upstream, in that
msmtpq
assumes a linux-only ping implementation — it could identify whether to callping
with-w
(linux) or-t/--timeout
(bsd) for the timeout. Oh, and because theping
call diverts errors to/dev/null
there’s no way to observe what’s happening.This could (and perhaps should) be fixed in nixpkgs, though, by substituting the default
ping
for theping
provided byinetutils
(the only one that seems to work on darwin) or settingEMAIL_CONN_TEST
ton
ors
(I’ve only triedn
). I suspect settingEMAIL_CONN_TEST
ton
in the derivation is the best option, and then there’s no messing withping
.Steps To Reproduce
Steps to reproduce the behavior:
Expected behavior
This is the success message.
Screenshots
Additional context
Notify maintainers
@peterhoeg
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: