From e413a1408e53730ca27db3989dbd94158d2c62d4 Mon Sep 17 00:00:00 2001 From: dnsdhrj Date: Thu, 24 Oct 2019 14:40:37 +0900 Subject: [PATCH] getmail: fix port option type mismatch Fixed type mismatch in commit 410f5732267d48d78ff0a1e6f38f512c4aea4808. Added test case to ensure it works well. (cherry picked from commit a177d0282fbb6af0668b63fba3dfb74cb25f3178) --- modules/programs/getmail.nix | 2 +- tests/modules/programs/getmail-expected.conf | 2 +- tests/modules/programs/getmail.nix | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/programs/getmail.nix b/modules/programs/getmail.nix index 04a958d6c..e5f8c4b20 100644 --- a/modules/programs/getmail.nix +++ b/modules/programs/getmail.nix @@ -31,7 +31,7 @@ let [retriever] type = ${retrieverType} server = ${imap.host} - ${optionalString (imap.port != null) "port = ${imap.port}"} + ${optionalString (imap.port != null) "port = ${toString imap.port}"} username = ${userName} password_command = (${passCmd}) mailboxes = ( ${renderedMailboxes} ) diff --git a/tests/modules/programs/getmail-expected.conf b/tests/modules/programs/getmail-expected.conf index a652e7199..90dc963e5 100644 --- a/tests/modules/programs/getmail-expected.conf +++ b/tests/modules/programs/getmail-expected.conf @@ -2,7 +2,7 @@ [retriever] type = SimpleIMAPSSLRetriever server = imap.example.com - +port = 993 username = home.manager password_command = ('password-command') mailboxes = ( 'INBOX', 'Sent', 'Work' ) diff --git a/tests/modules/programs/getmail.nix b/tests/modules/programs/getmail.nix index 12806c256..6b572f15c 100644 --- a/tests/modules/programs/getmail.nix +++ b/tests/modules/programs/getmail.nix @@ -10,11 +10,14 @@ with lib; home.homeDirectory = "/home/hm-user"; accounts.email.accounts = { - "hm@example.com".getmail = { - enable = true; - mailboxes = ["INBOX" "Sent" "Work"]; - destinationCommand = "/bin/maildrop"; - delete = false; + "hm@example.com" = { + getmail = { + enable = true; + mailboxes = ["INBOX" "Sent" "Work"]; + destinationCommand = "/bin/maildrop"; + delete = false; + }; + imap.port = 993; }; };