Skip to content
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

Merged
merged 1 commit into from Nov 23, 2018
Merged

rss2email module: init #49228

merged 1 commit into from Nov 23, 2018

Conversation

Ekleog
Copy link
Member

@Ekleog Ekleog commented Oct 27, 2018

Also adding system-sendmail package for sharing the code with other
modules 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
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@Ekleog Ekleog mentioned this pull request Oct 27, 2018
9 tasks
@Ekleog
Copy link
Member Author

Ekleog commented Oct 27, 2018

@GrahamcOfBorg test rss2email

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: exit status 1
syncing
server: running command: sync
server: exit status 0
test script finished in 15.85s
cleaning up
killing server (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/2nx6rhcksi6ccc9dyzfsnsjkqcsrqwl2-vm-test-run-opensmtpd

@GrahamcOfBorg
Copy link

Failure on x86_64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: running command: systemctl --no-pager show "rss2email"
server: exit status 0
error: unit ‘rss2email’ is inactive and there are no pending jobs
unit ‘rss2email’ is inactive and there are no pending jobs
cleaning up
killing server (pid 597)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
builder for '/nix/store/kypkz206qi0lgq24x95aavbjbdqmikk1-vm-test-run-opensmtpd.drv' failed with exit code 255
error: build of '/nix/store/kypkz206qi0lgq24x95aavbjbdqmikk1-vm-test-run-opensmtpd.drv' failed

@Ekleog
Copy link
Member Author

Ekleog commented Oct 27, 2018

Looks like my sleep was optimistic despite being pessimistic… let's try again with something hopefully more resilient.

@GrahamcOfBorg test rss2email

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: exit status 1
syncing
server: running command: sync
server: exit status 0
test script finished in 14.75s
cleaning up
killing server (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/wqya4ypjxnxlq8y0mirbx15l79adc50y-vm-test-run-opensmtpd

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: exit status 1
syncing
server: running command: sync
server: exit status 0
test script finished in 19.56s
cleaning up
killing server (pid 597)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/q22xxxa68p9hczzs3q1dmwb0is9g5fjy-vm-test-run-opensmtpd

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: opensmtpd

Partial log (click to expand)

/nix/store/ihdq6cklcsdnkac9x6ly2y5r8bir707a-opensmtpd-6.4.0p1

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: opensmtpd

Partial log (click to expand)

/nix/store/qwd5xz5k043v5v11xm90zjkmpsnphj3v-opensmtpd-6.4.0p1

@Ekleog
Copy link
Member Author

Ekleog commented Oct 28, 2018

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

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: exit status 1
syncing
server: running command: sync
server: exit status 0
test script finished in 26.00s
cleaning up
killing server (pid 631)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/z47369agysjw8n2shahvzr9blq46vhr2-vm-test-run-opensmtpd

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.rss2email

Partial log (click to expand)

server: exit status 1
syncing
server: running command: sync
server: exit status 0
test script finished in 185.39s
cleaning up
killing server (pid 600)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/d8izh96fa61d5qysdx2bqqh0zkg5fgg5-vm-test-run-opensmtpd

nixos/modules/services/mail/rss2email.nix Show resolved Hide resolved
nixos/modules/services/mail/rss2email.nix Outdated Show resolved Hide resolved
nixos/modules/services/mail/rss2email.nix Outdated Show resolved Hide resolved
nixos/modules/services/mail/rss2email.nix Outdated Show resolved Hide resolved

to = mkOption {
type = with types; nullOr str;
default = null;
Copy link
Member

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 the config section of the submodule.

Copy link
Member Author

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 :)

Copy link
Member

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.

Copy link
Member Author

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?

nixos/modules/services/mail/rss2email.nix Outdated Show resolved Hide resolved
pkgs/servers/mail/system-sendmail/default.nix Outdated Show resolved Hide resolved
@Ekleog
Copy link
Member Author

Ekleog commented Oct 29, 2018

@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 :)

@Ekleog
Copy link
Member Author

Ekleog commented Nov 1, 2018

It looks like @bjornfor's comment as well as my answer vanished on the push --force required for handling the merge conflict that arose from another package adding its id to ids.nix.

I reproduce them here for convenience: (source)

(on the if which sendmail > /dev/null 2>&1; then line of system-sendmail)
@bjornfor

If you change which to command -v you remove one implicit dependency. (command -v is part of posix sh, whereas which is an external binary thay may or may not exist on the system.)

@Ekleog

Good point! Actually this mistake of mine hid a bug in the previous system-sendmail: when it's in $PATH then it infinite-looped.

Both issues are fixed in latest push -f (required due to a merge conflict)

imap-port = 143;
imap-ssl = false;
imap-mailbox = "INBOX";
verbose = "warning";
Copy link
Member

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.

Copy link
Member Author

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.

@Ekleog Ekleog force-pushed the rss2email-module branch 2 times, most recently from 6cfb4f9 to 229519b Compare November 10, 2018 03:47
@arianvp arianvp mentioned this pull request Nov 12, 2018
@oxij
Copy link
Member

oxij commented Nov 14, 2018 via email

@Ekleog
Copy link
Member Author

Ekleog commented Nov 14, 2018

@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 passthru.tests to rss2email, as its RFC has been merged since. If there are no remaining concerns would it be possible to merge before the next merge conflict on uid? :)
For DynamicUser, the problem stems from our current nscd/systemd setup that is broken, it looks like it'll be possible to switch to DynamicUser when it'll be fixed: systemd is able to migrate the directory seamlessly when moving from User= to DynamicUser= (but not the other way around, so it'll require a stateVersion barrier).

@oxij
Copy link
Member

oxij commented Nov 14, 2018 via email

@Ekleog
Copy link
Member Author

Ekleog commented Nov 14, 2018 via email

@oxij
Copy link
Member

oxij commented Nov 14, 2018 via email

Also adding `system-sendmail` package for sharing the code with other
modules or packages needing it.
@Ekleog
Copy link
Member Author

Ekleog commented Nov 15, 2018 via email

@oxij
Copy link
Member

oxij commented Nov 15, 2018 via email

@7c6f434c
Copy link
Member

(triage) @infinisil are all your concerns addressed?

@infinisil
Copy link
Member

@7c6f434c Yeah they're addressed. I still don't like the wrapper thing, but I guess if that's the only way then sure.

@7c6f434c
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants