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
rss2email module: init #49228
rss2email module: init #49228
Conversation
@GrahamcOfBorg test rss2email |
Success on aarch64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
Failure on x86_64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
9ae447a
to
366f408
Compare
Looks like my @GrahamcOfBorg test rss2email |
Success on aarch64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
366f408
to
b483c03
Compare
Success on aarch64-linux (full log) Attempted: opensmtpd Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: opensmtpd Partial log (click to expand)
|
ec598b2
to
829c58e
Compare
Thanks! I have applied your suggestion and rebased on master (as the opensmtpd update has been merged). This should be ready to merge :) @GrahamcOfBorg test rss2email |
Success on aarch64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
Success on x86_64-linux (full log) Attempted: tests.rss2email Partial log (click to expand)
|
|
||
to = mkOption { | ||
type = with types; nullOr str; | ||
default = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Along with the config
change, you can then make these changes here:
- Change the type to
str
- Remove the default value here
- Set the default by doing
to = mkDefault cfg.to;
in theconfig
section of the submodule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is possible indeed, but it moves the module farther away from upstream configuration, as upstream configuration just doesn't add a to
, and I tried to replicate upstream behavior as well as possible… now you're right, there's little else that could legitimately be done other than using the system-wide to
, so I guess this won't change visible behavior :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I think your current implementation always just defaults to cfg.to
though (line 12). So if you want to replicate upstream behavior, you should probably just not set it there instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think lines 11-12 correctly set url
from feed
and add the to
field iff. cfg.to
is not null
, thanks to the optionalAttrs
(and testing validates this, if I'm not mistaken on the testing process).
I guess you confused with line 9, where I did set to
unconditionally, but in the [DEFAULT]
block?
829c58e
to
fbf1323
Compare
@infinisil Thank you for the review! I've hopefully addressed all your points and pushed an updated version, that I'm going to start trying on my server instead of the old version :) |
29d7b28
to
4bc057c
Compare
It looks like @bjornfor's comment as well as my answer vanished on the I reproduce them here for convenience: (source) (on the
|
imap-port = 143; | ||
imap-ssl = false; | ||
imap-mailbox = "INBOX"; | ||
verbose = "warning"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we don't encode the default in the module anymore, I think this here should be removed as well and potentially link to some upstream default docs if available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, and actually these are in the manpage… or should be, if rss2email had had a release in the last 3 years. Well, with @Profpatsch we now have access to rss2email, so should be able to cleanup and make a release as soon as we get some time :)
I've pointed to the online r2e.1
for the time being.
6cfb4f9
to
229519b
Compare
`system-sendmail` has multiple lines in `meta.description`, I think this is generally frowned upon.
Also, as a side note, I think it would be good if somebody would finally add MDA support to `rss2email`. It is kinda crazy to run the whole of Postfix just to save files to users' maildirs. (I planned to do it 4 years ago...)
|
229519b
to
1447f8e
Compare
1447f8e
to
cb4963d
Compare
@oxij Thank you for the comment! I've put it on one line, as it didn't really deserve multiple lines anyway. As for MDA support, there already is, but there hasn't been a release for a few years and we didn't find time to review enough the changes since last release to trigger one yet. In the meantime, OpenSMTPD makes for something much more lightweight than postfix :) @infinisil I've rebased, fixed @oxij's concern, and added |
Looking at it some more:
- I think
- system-sendmail = callPackage ../servers/mail/system-sendmail { };
+ system-sendmail = lowPrio (callPackage ../servers/mail/system-sendmail { });
and
- platforms = platforms.linux;
+ platforms = platforms.unix;
- Also, about defaulting to `1h`. Would it recheck all feeds every hour or would it respect recheck time supplied by the feeds themselves? It would be unfortunate if the former. In any case, I suggest setting it to at least `12h` by default.
|
cb4963d
to
8cf6236
Compare
Jan Malakhovski <notifications@github.com> writes:
Looking at it some more:
- I think
- system-sendmail = callPackage ../servers/mail/system-sendmail { };
+ system-sendmail = lowPrio (callPackage ../servers/mail/system-sendmail { });
`system-sendmail` will be a dependency of `mdadm` (once
#49229 will be merged), and it's a
script that's literally just writing a file, so I'm not sure it really
deserves being `lowPrio`.
Also, from `rg sendmail pkgs`, there seem to be quite a few packages
that would benefit from using it instead of hardcoding postfix's
security wrapper path… I guess no one ever tried to use them with a
decent smtpd that doesn't rely on setuid when it doesn't need to :p
and
- platforms = platforms.linux;
+ platforms = platforms.unix;
Done
- Also, about defaulting to `1h`. Would it recheck all feeds every hour or would it respect recheck time supplied by the feeds themselves? It would be unfortunate if the former. In any case, I suggest setting it to at least `12h` by default.
Honestly, I have no idea. This should be raised on [1], I guess.
Raising to 12hr sounds good to me, I had literally no idea what to put
in there by default :)
[1] https://github.com/rss2email/rss2email/issues
I've pushed the updated version with the `linux` -> `unix` and
`1h` -> `12h` changes. Thank you for your review!
|
> - system-sendmail = callPackage ../servers/mail/system-sendmail { };
> + system-sendmail = lowPrio (callPackage ../servers/mail/system-sendmail { });
`system-sendmail` will be a dependency of `mdadm` (once
#49229 will be merged), and it's a
script that's literally just writing a file, so I'm not sure it really
deserves being `lowPrio`.
`lowPrio` AFAIU lowers the priority for `buildEnv` and such, i.e. with `lowPrio` it should not override other `sendmail`s if you install several of them into `systemPackages`, which seems like a good idea to me.
Also, from `rg sendmail pkgs`, there seem to be quite a few packages
that would benefit from using it instead of hardcoding postfix's
security wrapper path… I guess no one ever tried to use them with a
decent smtpd that doesn't rely on setuid when it doesn't need to :p
Yes, I agree, I also grepped over `nixos` folder and got a bit discouraged by the amount of `sendmail` hackery there. Looking at the first few I wanted to propose to fix them too, but then it turned out there's a lot stuff to fix there, so I added it to my own low-prio TODO in case I get bored sometime.
> - Also, about defaulting to `1h`. Would it recheck all feeds every hour or would it respect recheck time supplied by the feeds themselves? It would be unfortunate if the former. In any case, I suggest setting it to at least `12h` by default.
Honestly, I have no idea. This should be raised on [1], I guess.
Raising to 12hr sounds good to me, I had literally no idea what to put in there by default :)
I looked at the source and it does the wrong thing. IMHO, ideally, `rss2email` should just run as a daemon and handle all timeouts itself since there's no single timeout that works well for all RSS feeds (added to TODO). But given current state of `rss2email` the `12h` is the sanest thing that can be done for now, IMHO.
|
Also adding `system-sendmail` package for sharing the code with other modules or packages needing it.
8cf6236
to
0483ce0
Compare
Jan Malakhovski <notifications@github.com> writes:
>> - system-sendmail = callPackage ../servers/mail/system-sendmail { };
>> + system-sendmail = lowPrio (callPackage ../servers/mail/system-sendmail { });
>
> `system-sendmail` will be a dependency of `mdadm` (once
> #49229 will be merged), and it's a
> script that's literally just writing a file, so I'm not sure it really
> deserves being `lowPrio`.
`lowPrio` AFAIU lowers the priority for `buildEnv` and such, i.e. with `lowPrio` it should not override other `sendmail`s if you install several of them into `systemPackages`, which seems like a good idea to me.
Oh indeed I'm stupid, was thinking that was for lowering the priority of
the hydra job… which would make no sense. And say I once knew it :( too
many things.
Fixed :)
> Also, from `rg sendmail pkgs`, there seem to be quite a few packages
> that would benefit from using it instead of hardcoding postfix's
> security wrapper path… I guess no one ever tried to use them with a
> decent smtpd that doesn't rely on setuid when it doesn't need to :p
Yes, I agree, I also grepped over `nixos` folder and got a bit discouraged by the amount of `sendmail` hackery there. Looking at the first few I wanted to propose to fix them too, but then it turned out there's a lot stuff to fix there, so I added it to my own low-prio TODO in case I get bored sometime.
Yeah, overall I'm thinking `system-sendmail` will be a good “factored”
hackery to at least make everything agree on the behavior. The issue
overall is that some packages need to depend on `sendmail`, and
`sendmail` is by essence impure, as it depends on the mailer
installed. NixOS could handle this better, but Nixpkgs in itself can't.
And as it can even be provided by things that relay to external mail
servers (eg. `msmtp`), we can't even just rely on a `sendmail` that
pipes the mail to `localhost:25`.
Maybe some hacks could be done with `/nix/var/run/sendmail-pipe` or
similar stuff, but… let's say I'm not sure it'd actually be helpful.
>> - Also, about defaulting to `1h`. Would it recheck all feeds every hour or would it respect recheck time supplied by the feeds themselves? It would be unfortunate if the former. In any case, I suggest setting it to at least `12h` by default.
>
> Honestly, I have no idea. This should be raised on [1], I guess.
>
> Raising to 12hr sounds good to me, I had literally no idea what to put in there by default :)
I looked at the source and it does the wrong thing. IMHO, ideally, `rss2email` should just run as a daemon and handle all timeouts itself since there's no single timeout that works well for all RSS feeds (added to TODO). But given current state of `rss2email` the `12h` is the sanest thing that can be done for now, IMHO.
At that point I'd guess you'd maybe do it better by just writing a
`rss2email` daemon from scratch, I'm not sure you could re-use lots of
current `rss2email` apart from its RSS-parsing library and its
mail-sending library?
Anyway, this is getting kind of off-topic :)
I think all the concerns are now solved, and there appear not to be
merge conflicts currently.
|
LGTM. Thanks!
NixOS could handle this better, but Nixpkgs in itself can't.
We can make everything use `system-sendmail` and make the latter inspect some environment variable that NixOS would then set, though.
|
(triage) @infinisil are all your concerns addressed? |
@7c6f434c Yeah they're addressed. I still don't like the wrapper thing, but I guess if that's the only way then sure. |
I see why you don't like the need for the wrapper, but I also don't see a clean and cheap way around that. |
Also adding
system-sendmail
package for sharing the code with othermodules or packages needing it.
The test for this module depends on #48901 being merged, as the configuration format of OpenSMTPD changed. Hence the fact it's based on the tip of #48901.
cc @Profpatsch
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)