Re: Symbolic link to mhmail
Thomas Dupond wrote in <7c469bc6-ad63-48c0-9afb-0d6c06d5d...@dupond.eu>: ... |Wow thanks for this fix! Being able to use nmh as a mailx replacement \ |in Debian will be very useful to me. Sheer unbelievable. New version up in summer, will be called "Mountains O' Things". And has! (More than three years of development.) --steffen | |Der Kragenbaer,The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt)
Re: Symbolic link to mhmail
Le 4 avril 2024 03:43:56 GMT+02:00, David Levine a écrit : >I wrote: > >> Thomas wrote: >> >> > For the reason given above I don't think this would solve it. I think >> > these results might be even more explicit: >> > >> > $ echo $PATH >> > /usr/bin/mh:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin >> > $ cp /usr/bin/mh/mhmail ./test >> > $ ./test >> > ./test: 1: /home/thomas/mhparam: not found >> > ./test: 95: exec: /home/thomas/inc: not found >> >> The root cause of the problem is that mhmail uses, in effect, `dirname $0` >> to find the location of the nmh executables. >> >> Because /usr/bin/mh is on your PATH, it could instead use `mhparam bindir`. > >I just committed that fix to mhmail and sendfiles. > >Thank you, Thomas, for reporting this. Starting with the current HEAD, you >can symlink mhmail. > >David Wow thanks for this fix! Being able to use nmh as a mailx replacement in Debian will be very useful to me. Thank you again, have a nice day. -- Thomas
Re: Symbolic link to mhmail
I wrote: > Thomas wrote: > > > For the reason given above I don't think this would solve it. I think > > these results might be even more explicit: > > > > $ echo $PATH > > /usr/bin/mh:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin > > $ cp /usr/bin/mh/mhmail ./test > > $ ./test > > ./test: 1: /home/thomas/mhparam: not found > > ./test: 95: exec: /home/thomas/inc: not found > > The root cause of the problem is that mhmail uses, in effect, `dirname $0` > to find the location of the nmh executables. > > Because /usr/bin/mh is on your PATH, it could instead use `mhparam bindir`. I just committed that fix to mhmail and sendfiles. Thank you, Thomas, for reporting this. Starting with the current HEAD, you can symlink mhmail. David
Re: Symbolic link to mhmail
Thomas wrote: > For the reason given above I don't think this would solve it. I think > these results might be even more explicit: > > $ echo $PATH > /usr/bin/mh:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin > $ cp /usr/bin/mh/mhmail ./test > $ ./test > ./test: 1: /home/thomas/mhparam: not found > ./test: 95: exec: /home/thomas/inc: not found The root cause of the problem is that mhmail uses, in effect, `dirname $0` to find the location of the nmh executables. Because /usr/bin/mh is on your PATH, it could instead use `mhparam bindir`. Or instead of trying to find the location at runtime, configure could be used to at build time to insert the path into the mhmail script. And the same could be done with etc/sendfiles. Thoughts? David
Re: Symbolic link to mhmail
HEllo, Thank you Robert and Ralph for your quick answers. Le 2024-03-27 à 14:39, Ralph Corderoy a écrit : Hello Thomas, kre has given a good answer and I'd do what he suggested, but... This issue comes from the fact that I wanted to use the unattended-upgrades package on Debian which uses mailx to send reports. Since only nmh is detected as providing a compatible mailx program, mailx redirects to /usr/bin/mh/mhmail. Are you saying that Debian puts in the symlink from /usr/bin/mhmail to /usr/bin/mh/mhmail when selecting nmh as one of the alternative packages to provide a virtual package which unattended-upgrades depends upon? Yes. To be extra clear, /usr/bin/mailx is a symlink to /etc/alternatives/mailx which itself is a symlink to /usr/bin/mh/mhmail. That sounds flawed for the reason you gave. Does Debian have a central place to manipulate PATH to append /usr/bin/mh for unattended-upgrades? unattended-upgrade(8) is configured via /etc/apt/apt.conf.d/50unattended-upgrades. In this file it is noted that to send email reports, mailx is used: // Send email to this address for problems or packages upgrades // If empty or unset then no email is sent, make sure that you // have a working mail setup on your system. A package that provides // 'mailx' must be installed. E.g. "u...@example.com" Unattended-Upgrade::Mail "root"; I discovered the mailx issue while trying to use mailx with my user account which does have /usr/bin/mh in its PATH. apt-file(1) here suggests there's a /lib/systemd/system/unattended-upgrades.service so perhaps a local file to override its PATH? For the reason given above I don't think this would solve it. I think these results might be even more explicit: $ echo $PATH /usr/bin/mh:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/snap/bin $ cp /usr/bin/mh/mhmail ./test $ ./test ./test: 1: /home/thomas/mhparam: not found ./test: 95: exec: /home/thomas/inc: not found Which version of Debian is this? ‘lsb_release -a’ shows this. $ uname -a; lsb_release -a Linux nuage 6.1.0-18-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux No LSB modules are available. Distributor ID: Debian Description:Debian GNU/Linux 12 (bookworm) Release:12 Codename: bookworm Thank you for your help, -- Thomas
Re: Symbolic link to mhmail
Hello Thomas, kre has given a good answer and I'd do what he suggested, but... > This issue comes from the fact that I wanted to use the > unattended-upgrades package on Debian which uses mailx to send > reports. Since only nmh is detected as providing a compatible mailx > program, mailx redirects to /usr/bin/mh/mhmail. Are you saying that Debian puts in the symlink from /usr/bin/mhmail to /usr/bin/mh/mhmail when selecting nmh as one of the alternative packages to provide a virtual package which unattended-upgrades depends upon? That sounds flawed for the reason you gave. Does Debian have a central place to manipulate PATH to append /usr/bin/mh for unattended-upgrades? apt-file(1) here suggests there's a /lib/systemd/system/unattended-upgrades.service so perhaps a local file to override its PATH? Which version of Debian is this? ‘lsb_release -a’ shows this. -- Cheers, Ralph.
Re: Symbolic link to mhmail
Date:Tue, 26 Mar 2024 15:59:35 +0100 From:Thomas Dupond Message-ID: <5130a4e4-b808-4d19-9a45-4e35b25bc...@dupond.eu> | I wanted to know how could I make a symbolic link to mhmail from | /usr/bin/mailx. Try not doing that. Instead make mailx into a script (with just one meaninful line): #! /bin/sh exec /usr/bin/mh/mhmail "$@" Of course, turn on 'x' permission. kre
Symbolic link to mhmail
Hello all, I wanted to know how could I make a symbolic link to mhmail from /usr/bin/mailx. Right now doing this gives me the following errors: /usr/bin/mailx: 1: /usr/bin/mhparam: not found /usr/bin/mailx: 95: exec: /usr/bin/inc: not found Because of course mhmail is not in /usr/bin but in /usr/bin/mh so it cannot find mhparam which is also in /usr/bin/mh. This issue comes from the fact that I wanted to use the unattended-upgrades package on Debian which uses mailx to send reports. Since only nmh is detected as providing a compatible mailx program, mailx redirects to /usr/bin/mh/mhmail. I have not found anything related to this on the mailing list, sorry if this issue has been raised before. Best regards, -- Thomas