all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* local and remove mail delivery
@ 2024-01-02 14:19 Remco van 't Veer
  2024-01-02 16:52 ` Felix Lechner via
  0 siblings, 1 reply; 5+ messages in thread
From: Remco van 't Veer @ 2024-01-02 14:19 UTC (permalink / raw)
  To: help-guix

Hi,

I am trying to get local (and remote through .forward and aliases, using
fastmail as relay) mail delivery to work on a server for (rottlog etc)
but I am stuck and hoping somebody can share some config.scm snippets to
get it to work.

My journey so far: The found rottlog service expects mailutils to be in
a working state which it isn't out of the box.  When sending mail it
tries to launch /usr/sbin/sendmail which obviously does not exist.  So I
added the opensmtp service:

  (service opensmtpd-service-type
    (opensmtpd-configuration))

and setup a mailrc file with:

  set sendmail=sendmail:/run/current-system/profile/sbin/sendmail

Now using mailutils "mail" command mail gets accepted but never
delivered.

  date | mail -s test me

In maillog I see messages like:

  Jan  2 13:48:26 localhost smtpd[665]: 16e9792116d40b8b mda delivery evpid=8bd03460af848da7 from=<me@localhost> to=<me@localhost> rcpt=<me@localhost> user=me delay=5m result=TempFail stat=Error (terminated; timeout)

And after a while:

  Jan  2 14:59:25 localhost lockspool: /var/mail/me.lock: Permission denied

So I looked at the opensmtpd service definitions and found out
executables are setgid to the smtpq group to gain some privileges so I
chgrp-ed the /var/mail directory to smtpq and did chmod g+rwx on it but
without effect.  Maybe lockspool (which is in libexec) also needs to be
setgid but I have not clue on how to do that since it's in libexec.

I also tried exim briefly, it did not work with the default
configuration and writing exim config is rather off putting.

Anybody solve the above or got mailutils to work (and receive rottlog
mails) via a different route?

Cheers,
Remco


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: local and remove mail delivery
  2024-01-02 14:19 local and remove mail delivery Remco van 't Veer
@ 2024-01-02 16:52 ` Felix Lechner via
  2024-01-02 18:11   ` Remco van 't Veer
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Lechner via @ 2024-01-02 16:52 UTC (permalink / raw)
  To: Remco van 't Veer, help-guix

Hi Remco,

On Tue, Jan 02 2024, Remco van 't Veer wrote:

>   set sendmail=sendmail:/run/current-system/profile/sbin/sendmail

Is the set-gid bit set on that particular sendmail executable? I might
instead try

   set sendmail=/run/setuid-programs/sendmail

Your issue could probably also be solved by adding /run/setuid-programs
to the PATH for system services, which Guix system does not do. (It does
add /run/current-system/profile/sbin). Then you could use the relative
'sendmail' invocation.

I believe the latter part is a bug in Guix System.

Kind regards
Felix


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: local and remove mail delivery
  2024-01-02 16:52 ` Felix Lechner via
@ 2024-01-02 18:11   ` Remco van 't Veer
  2024-01-02 18:21     ` Felix Lechner via
  0 siblings, 1 reply; 5+ messages in thread
From: Remco van 't Veer @ 2024-01-02 18:11 UTC (permalink / raw)
  To: Felix Lechner; +Cc: help-guix

Hi Felix,

Thanks for your reply.

2024/01/02, Felix Lechner:

> On Tue, Jan 02 2024, Remco van 't Veer wrote:
>
>>   set sendmail=sendmail:/run/current-system/profile/sbin/sendmail
>
> Is the set-gid bit set on that particular sendmail executable? I might
> instead try
>
>    set sendmail=/run/setuid-programs/sendmail

Good call, I'm a bit embarrassed I missed that.  Unfortunately it does
not help, I'm still seeing the same behaviour.

I did notice that smtpd does pick up a .forward file and tries to
forward mails outbound.  I'll need to setup smtpd to use authentication
for my mail provider to do that which seems relatively easy to do.  Will
need to figure out how to properly do secrets in config.scm files (just
use a local-file and keep that out of my git repo?) and chmod/chgrp
stuff generated by etc-service (using activation-service?).

Cheers,
Remco


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: local and remove mail delivery
  2024-01-02 18:11   ` Remco van 't Veer
@ 2024-01-02 18:21     ` Felix Lechner via
  2024-01-03 13:37       ` Remco van 't Veer
  0 siblings, 1 reply; 5+ messages in thread
From: Felix Lechner via @ 2024-01-02 18:21 UTC (permalink / raw)
  To: Remco van 't Veer; +Cc: help-guix

Hi Remco,

On Tue, Jan 02 2024, Remco van 't Veer wrote:

> I did notice that smtpd does pick up a .forward file and tries to
> forward mails outbound.

Yes, it does. OpenSMTPd is vigilant about enforcing.forward files.

> I'll need to setup smtpd to use authentication for my mail provider to
> do that which seems relatively easy to do.  Will need to figure out
> how to properly do secrets in config.scm files

Perhaps my config helps you for a simple nullmailer here [1] or for a
fully-featured mail server here. [2]

Kind regards
Felix

[1] https://codeberg.org/lechner/system-config/src/commit/ac36a057f2486b262a5c37593b437fc221c632e1/host/lechner-desktop/operating-system.scm#L224-L237
[2] https://codeberg.org/lechner/system-config/src/commit/ac36a057f2486b262a5c37593b437fc221c632e1/host/wallace-server/operating-system.scm#L1260-L1322


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: local and remove mail delivery
  2024-01-02 18:21     ` Felix Lechner via
@ 2024-01-03 13:37       ` Remco van 't Veer
  0 siblings, 0 replies; 5+ messages in thread
From: Remco van 't Veer @ 2024-01-03 13:37 UTC (permalink / raw)
  To: Felix Lechner; +Cc: help-guix

Hi Felix,

2024/01/02, Felix Lechner:

> Perhaps my config helps you for a simple nullmailer here [1] or for a
> fully-featured mail server here. [2]

Thank you!  That's very helpful!

Cheers,
Remco

> [1] https://codeberg.org/lechner/system-config/src/commit/ac36a057f2486b262a5c37593b437fc221c632e1/host/lechner-desktop/operating-system.scm#L224-L237
> [2] https://codeberg.org/lechner/system-config/src/commit/ac36a057f2486b262a5c37593b437fc221c632e1/host/wallace-server/operating-system.scm#L1260-L1322


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-03 13:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-02 14:19 local and remove mail delivery Remco van 't Veer
2024-01-02 16:52 ` Felix Lechner via
2024-01-02 18:11   ` Remco van 't Veer
2024-01-02 18:21     ` Felix Lechner via
2024-01-03 13:37       ` Remco van 't Veer

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.