NNTP backend + server password command eval #245

Closed
opened 2023-07-04 21:03:36 +03:00 by r3k2 · 3 comments

hello I am trying to connect to eternalseptember but having issues.

Unrecognised configuration values: {"server_username": "rek2", "server_password": "type = \"command_eval\"\nvalue = \"gopass show -o -f nntp/eternal-september\"\n", "require_auth": "true", "use_tls": "true", "server_port": "563", "server_hostname": "news.eternal-september.org"}

this is my config:

[accounts.nntp]
server_hostname = "news.eternal-september.org"
server_username = "rek2"
server_password = { type = "command_eval", value = "gopass show -o -f nntp/eternal-september" }
require_auth = true
use_tls = true
server_port = 563
root_mailbox = "/home/rek2/meli_eternal-september_nntp"
format = "Maildir"
identity = "rek2@hispagatos.org-not_valid"
composing.send_mail = "server_submission"

will really help if someone can tell me what I have wrong, there was no example on the manual.
Thanks

hello I am trying to connect to eternalseptember but having issues. ``` Unrecognised configuration values: {"server_username": "rek2", "server_password": "type = \"command_eval\"\nvalue = \"gopass show -o -f nntp/eternal-september\"\n", "require_auth": "true", "use_tls": "true", "server_port": "563", "server_hostname": "news.eternal-september.org"} ``` this is my config: ``` [accounts.nntp] server_hostname = "news.eternal-september.org" server_username = "rek2" server_password = { type = "command_eval", value = "gopass show -o -f nntp/eternal-september" } require_auth = true use_tls = true server_port = 563 root_mailbox = "/home/rek2/meli_eternal-september_nntp" format = "Maildir" identity = "rek2@hispagatos.org-not_valid" composing.send_mail = "server_submission" ``` will really help if someone can tell me what I have wrong, there was no example on the manual. Thanks

The issue here is that nntp is implemented as a mail backend, so format should be nntp instead of Maildir: yes that means articles aren't synced locally like other nntp clients. That's because the NNTP backend hasn't been developed much due to lack of interest. You should be able to get read access and be able to send replies with a custom shell command as send_mail or with smtp if the server has an smtp relay.

The issue here is that `nntp` is implemented as a mail backend, so `format` should be `nntp` instead of Maildir: yes that means articles aren't synced locally like other nntp clients. That's because the NNTP backend hasn't been developed much due to lack of interest. You should be able to get read access and be able to send replies with a custom shell command as `send_mail` or with smtp if the server has an smtp relay.

Thanks for the reply @epilys if nntp is not implemented as a mail backend this is fine with me, I am currently using slrn and not using it as mail I post directly etc. I play with rust sometimes for small proyects, come from a C background but I can take a look at the code see if I can improve the nntp support on meli.

so I did change the "format" to "nntp" and now is working but I had to hardcode the password for it to fully work and log in, what is wrong with my password line above? having a password in the config such thing is a bad security practice so will rather be able to use pass/gopass bitwarden-cli etc if possible, if is not implemented what can I do to add it myself? if we already have a server_password_command on IMAP should be very similar to code.

Thanks!
Im working so need to review later your other responses in the other issues :) thanks in advance for those as well.

Thanks for the reply @epilys if nntp is not implemented as a mail backend this is fine with me, I am currently using slrn and not using it as mail I post directly etc. I play with rust sometimes for small proyects, come from a C background but I can take a look at the code see if I can improve the nntp support on meli. so I did change the "format" to "nntp" and now is working but I had to hardcode the password for it to fully work and log in, what is wrong with my password line above? having a password in the config such thing is a bad security practice so will rather be able to use pass/gopass bitwarden-cli etc if possible, if is not implemented what can I do to add it myself? if we already have a server_password_command on IMAP should be very similar to code. Thanks! Im working so need to review later your other responses in the other issues :) thanks in advance for those as well.

@r3k2

having a password in the config such thing is a bad security practice so will rather be able to use pass/gopass bitwarden-cli etc if possible, if is not implemented what can I do to add it myself? if we already have a server_password_command on IMAP should be very similar to code.

Agreed completely.

IMAP uses this melib::AccountSettings method, server_password that evaluates the server_password command:

7998e1e77e/melib/src/conf.rs (L77)

It is used here when the IMAP account is initialized:

7998e1e77e/melib/src/backends/imap.rs (L1261)

The place to put it in the NNTP backend would be here:

7998e1e77e/melib/src/backends/nntp.rs (L598)

And for testing/validity, the code should check that all account settings are valid in fn new and in fn validate_config.

fn validate_config removes all config entries that are valid for this backend (NNTP in this case) so that when it returns, if there are errors or any entries left, the config is invalid.

@r3k2 > having a password in the config such thing is a bad security practice so will rather be able to use pass/gopass bitwarden-cli etc if possible, if is not implemented what can I do to add it myself? if we already have a server_password_command on IMAP should be very similar to code. Agreed completely. IMAP uses this `melib::AccountSettings` method, `server_password` that evaluates the server_password command: https://git.meli.delivery/meli/meli/src/commit/7998e1e77ef057bab28434edefb79d7be6a4de33/melib/src/conf.rs#L77 It is used here when the IMAP account is initialized: https://git.meli.delivery/meli/meli/src/commit/7998e1e77ef057bab28434edefb79d7be6a4de33/melib/src/backends/imap.rs#L1261 The place to put it in the NNTP backend would be here: https://git.meli.delivery/meli/meli/src/commit/7998e1e77ef057bab28434edefb79d7be6a4de33/melib/src/backends/nntp.rs#L598 And for testing/validity, the code should check that all account settings are valid in `fn new` and in `fn validate_config`. `fn validate_config` removes all config entries that are valid for this backend (NNTP in this case) so that when it returns, if there are errors or any entries left, the config is invalid.
Manos Pitsidianakis changed title from Trouble configuring nntp to NNTP backend + server password command eval 2023-07-05 10:03:38 +03:00
Manos Pitsidianakis added the
bug
label 2023-07-05 10:03:52 +03:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#245
There is no content yet.