Open fuzy112 opened 3 months ago
I think I understand what you are saying, but could you provide the generated outputs for both mbsync and imapnotify, please? That way we can compare both output strings.
Karl H @.***> writes:
I think I understand what you are saying, but could you provide the generated outputs for both mbsync and imapnotify, please? That way we can compare both output strings.
Sure.
I set my passwordCommand to
cat ${config.age.secrets."mailpassword".path}
and enabled mbsync and
imapnotify. The outputs are as follows.
Resulted .mbsyncrc
:
PassCmd "cat $XDG_RUNTIME_DIR/agenix/mailpassword"
Resulted imapnotify-*-config.json
:
{
"passwordCmd": "'cat' '$XDG_RUNTIME_DIR/agenix/mailpassword'",
"port": 993,
"tls": true,
"tlsOptions": {
"starttls": false
},
}
Unrelated parts are omitted from the output.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.
I set my passwordCommand to
cat ${config.age.secrets."mailpassword".path}
and enabled mbsync and imapnotify. The outputs are as follows.
A possible workaround is to write command to a file:
passwordCommand =
let
passScript = pkgs.writeText "pass-script.sh" ''
${pkgs.coreutils}/bin/cat "${config.age.secrets."mailpassword".path}"
'';
in
"${pkgs.runtimeShell} ${passScript}";
{
"passwordCmd": "'cat' '$XDG_RUNTIME_DIR/agenix/mailpassword'",
"port": 993,
"tls": true,
"tlsOptions": {
"starttls": false
},
}
This seems like imapnotify expecting something different than mbsync. To be fair, I think imapnotify may have different goals than mbsync.
When I re-wrote the mbsync module, I was attempting to get it into a state usable for myself. I upstreamed it because it seemed useful (and closed an open issue about mbsync). I'm not 100% sure which style should be preferred (spaces enclosed in quotes, so a single string is a whole command) or if imapnotify's method is preferable. I would appreciate people who use/wrote imapnotify to weigh in and see which method is preferable.
Thank you for your contribution! I marked this issue as stale due to inactivity. Please be considerate of people watching this issue and receiving notifications before commenting 'I have this issue too'. We welcome additional information that will help resolve this issue. Please read the relevant sections below before commenting.
* If this is resolved, please consider closing it so that the maintainers know not to focus on this. * If this might still be an issue, but you are not interested in promoting its resolution, please consider closing it while encouraging others to take over and reopen an issue if they care enough. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
* If you are also experiencing this issue, please add details of your situation to help with the debugging process. * If you know how to solve the issue, please consider submitting a Pull Request that addresses this issue.
Don't be afraid to manually close an issue, even if it holds valuable information. Closed issues stay in the system for people to search, read, cross-reference, or even reopen – nothing is lost! Closing obsolete issues is an important way to help maintainers focus their time and effort.
Are you following the right branch?
Is there an existing issue for this?
Issue description
I need to set my passwordCommand to something like
${pkgs.coreutils}/bin/cat \${XDG_RUNTIME_DIR}/agenix/mailpassword
.However, I cannot find a way to let both mbsync and imapnotify works, because the value is in different ways:
mbsync just concatenates the strings together and it works well with the command above,
while imapnotify escapes the strings and as a result the environment variable is not evaluated.
Maintainer CC
@NickHu @KarlJoad
System information