From 30ad5fbf9da82a598dd69529b4fbdc599c0bc47c Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 15 Jul 2025 09:07:40 +0200 Subject: [PATCH 1/2] msmtp: migrate to by-name --- .../ms}/msmtp/msmtpq-remove-binary-check.patch | 0 .../ms}/msmtp/msmtpq-systemd-logging.patch | 0 .../msmtp/default.nix => by-name/ms/msmtp/package.nix} | 4 ++-- pkgs/top-level/all-packages.nix | 4 ---- 4 files changed, 2 insertions(+), 6 deletions(-) rename pkgs/{applications/networking => by-name/ms}/msmtp/msmtpq-remove-binary-check.patch (100%) rename pkgs/{applications/networking => by-name/ms}/msmtp/msmtpq-systemd-logging.patch (100%) rename pkgs/{applications/networking/msmtp/default.nix => by-name/ms/msmtp/package.nix} (98%) diff --git a/pkgs/applications/networking/msmtp/msmtpq-remove-binary-check.patch b/pkgs/by-name/ms/msmtp/msmtpq-remove-binary-check.patch similarity index 100% rename from pkgs/applications/networking/msmtp/msmtpq-remove-binary-check.patch rename to pkgs/by-name/ms/msmtp/msmtpq-remove-binary-check.patch diff --git a/pkgs/applications/networking/msmtp/msmtpq-systemd-logging.patch b/pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch similarity index 100% rename from pkgs/applications/networking/msmtp/msmtpq-systemd-logging.patch rename to pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch diff --git a/pkgs/applications/networking/msmtp/default.nix b/pkgs/by-name/ms/msmtp/package.nix similarity index 98% rename from pkgs/applications/networking/msmtp/default.nix rename to pkgs/by-name/ms/msmtp/package.nix index 60946106d0dd..e2de1f2fe68d 100644 --- a/pkgs/applications/networking/msmtp/default.nix +++ b/pkgs/by-name/ms/msmtp/package.nix @@ -4,7 +4,7 @@ symlinkJoin, lib, fetchFromGitHub, - autoreconfHook, + autoreconfHook269, pkg-config, bash, coreutils, @@ -62,7 +62,7 @@ let ] ++ optionals withKeyring [ libsecret ]; nativeBuildInputs = [ - autoreconfHook + autoreconfHook269 pkg-config texinfo ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1f6cde488533..2d89e07134d2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13308,10 +13308,6 @@ with pkgs; taxi-cli = with python3Packages; toPythonApplication taxi; - msmtp = callPackage ../applications/networking/msmtp { - autoreconfHook = buildPackages.autoreconfHook269; - }; - imapfilter = callPackage ../applications/networking/mailreaders/imapfilter.nix { lua = lua5; }; From f1dffb0363c6867fe1982eab3579b0b5e3b8f25c Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Tue, 15 Jul 2025 09:10:09 +0200 Subject: [PATCH 2/2] msmtp: 1.8.26 -> 1.8.30 Upgrade msmtp from 1.8.26 to 1.8.30. The update requires a couple of additional changes: - msmtp has gained a dependency on libnotify via notify-send. - msmtp has gained a dependency on GNU sed. - msmtp does not configure anymore with autoreconf 2.69. This is fixed by unpinning the version. - The patch for improved logging via systemd does not apply anymore and has been update. --- .../ms/msmtp/msmtpq-systemd-logging.patch | 20 +++++----- pkgs/by-name/ms/msmtp/package.nix | 37 +++++++++++++------ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch b/pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch index a9db3e645808..55f386bb3190 100644 --- a/pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch +++ b/pkgs/by-name/ms/msmtp/msmtpq-systemd-logging.patch @@ -1,17 +1,17 @@ diff --git a/scripts/msmtpq/msmtpq b/scripts/msmtpq/msmtpq -index bcb384e..dbaf1b5 100755 +index 28d0754..3eaac58 100755 --- a/scripts/msmtpq/msmtpq +++ b/scripts/msmtpq/msmtpq -@@ -92,6 +92,8 @@ if [ ! -v MSMTPQ_LOG ] ; then - fi +@@ -182,6 +182,8 @@ if [ -n "$MSMTPQ_LOG" ] ; then + unset msmptq_log_dir fi - [ -d "$(dirname "$MSMTPQ_LOG")" ] || mkdir -p "$(dirname "$MSMTPQ_LOG")" -+ -+JOURNAL=@journal@ - ## ====================================================================================== - ## msmtpq can use the following environment variables : -@@ -144,6 +146,7 @@ on_exit() { # unlock the queue on exit if the lock was ++JOURNAL=@journal@ ++ + umask 077 # set secure permissions on created directories and files + + declare -i CNT # a count of mail(s) currently in the queue +@@ -214,6 +216,7 @@ on_exit() { # unlock the queue on exit if the lock was ## display msg to user, as well ## log() { @@ -19,7 +19,7 @@ index bcb384e..dbaf1b5 100755 local ARG RC PFX PFX="$('date' +'%Y %d %b %H:%M:%S')" # time stamp prefix - "2008 13 Mar 03:59:45 " -@@ -161,10 +164,19 @@ log() { +@@ -233,10 +236,19 @@ log() { done fi diff --git a/pkgs/by-name/ms/msmtp/package.nix b/pkgs/by-name/ms/msmtp/package.nix index e2de1f2fe68d..c801fa83ee9b 100644 --- a/pkgs/by-name/ms/msmtp/package.nix +++ b/pkgs/by-name/ms/msmtp/package.nix @@ -4,11 +4,12 @@ symlinkJoin, lib, fetchFromGitHub, - autoreconfHook269, + autoreconfHook, pkg-config, bash, coreutils, gnugrep, + gnused, gnutls, gsasl, libidn2, @@ -20,6 +21,8 @@ withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd, withScripts ? true, + withLibnotify ? true, + libnotify, gitUpdater, binlore, msmtp, @@ -28,13 +31,13 @@ let inherit (lib) getBin getExe optionals; - version = "1.8.26"; + version = "1.8.30"; src = fetchFromGitHub { owner = "marlam"; repo = "msmtp"; rev = "msmtp-${version}"; - hash = "sha256-MV3fzjjyr7qZw/BbKgsSObX+cxDDivI+0ZlulrPFiWM="; + hash = "sha256-aM2qId08zvT9LbncCQYHsklbvHVtcZJgr91JTjwpQ/0="; }; meta = with lib; { @@ -62,7 +65,7 @@ let ] ++ optionals withKeyring [ libsecret ]; nativeBuildInputs = [ - autoreconfHook269 + autoreconfHook pkg-config texinfo ]; @@ -112,13 +115,17 @@ let msmtpq = { scripts = [ "bin/msmtpq" ]; interpreter = getExe bash; - inputs = [ - binaries - coreutils - gnugrep - netcat-gnu - which - ] ++ optionals withSystemd [ systemd ]; + inputs = + [ + binaries + coreutils + gnugrep + gnused + netcat-gnu + which + ] + ++ optionals withSystemd [ systemd ] + ++ optionals withLibnotify [ libnotify ]; execer = [ "cannot:${getBin binaries}/bin/msmtp" @@ -126,9 +133,15 @@ let ] ++ optionals withSystemd [ "cannot:${getBin systemd}/bin/systemd-cat" + ] + ++ optionals withLibnotify [ + "cannot:${getBin libnotify}/bin/notify-send" ]; fix."$MSMTP" = [ "msmtp" ]; - fake.external = [ "ping" ] ++ optionals (!withSystemd) [ "systemd-cat" ]; + fake.external = + [ "ping" ] + ++ optionals (!withSystemd) [ "systemd-cat" ] + ++ optionals (!withLibnotify) [ "notify-send" ]; keep.source = [ "~/.msmtpqrc" ]; };