FS#49517 - [opensmtpd] sendmail / man page but no executable
Attached to Project:
Community Packages
Opened by Arne Wörner (riddicc) - Monday, 30 May 2016, 19:12 GMT
Last edited by Lukas Fleischer (lfleischer) - Saturday, 02 July 2016, 07:11 GMT
Opened by Arne Wörner (riddicc) - Monday, 30 May 2016, 19:12 GMT
Last edited by Lukas Fleischer (lfleischer) - Saturday, 02 July 2016, 07:11 GMT
|
Details
Description:
opensmtpd used to have /usr/bin/sendmail up to 5.7.3p2-3. Since 5.9.2p1-1 there is only the man page left and cronie and mail refuse to send mails... Additional info: * 5.9.2p1-1 * pretty much out of the box Steps to reproduce: 1. pacman -Syu 2. try to send a mail with `# mail`... (results in: «Cannot start "/usr/sbin/sendmail": executable not found (adjust *sendmail* variable)») |
This task depends upon
Closed by Lukas Fleischer (lfleischer)
Saturday, 02 July 2016, 07:11 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 5.9.2p1-3.
Saturday, 02 July 2016, 07:11 GMT
Reason for closing: Fixed
Additional comments about closing: Fixed in 5.9.2p1-3.
1. pacman -Syu
2. ln -s smtpctl /usr/bin/sendmail
:)
-arne
There must have been some other changes in the package as after update the opensmtpd required to change ownership and permissions of some directories to start successfully:
chown root:smtpq /var/spool/smtpd/offline/
chmod 770 /var/spool/smtpd/offline/
chmod 700 /var/spool/smtpd/purge/
Next time after updating smtpd I will remember to send test email.
You should also provide symlinks for /usr/bin/newaliases and /usr/bin/makemap on the same schema, for scripts and users used to these standard sendmail utils.
> [...] I assume this is meant to be the correct way. [...]
>
i c.
but why the man page if there shall be no such command?
You might say that they're the next endangered files - man pages. :)
-arne (who likes Twelve Monkeys)
But the man page says:
> SYNOPSIS
> sendmail [-tv] [-F name] [-f from] to ...
while sendmail doesn't exist by default...
so it is just a workaround...
The bug is still in opensmtpd, because it advertises non-existent commands...
maybe s/o should report it upstream?
-arne
why not
ln smtpctl "$pkgdir/usr/bin/sendmail"
?
-arne
ln: failed to access 'smtpctl': No such file or directory
ln -s smtpctl "$pkgdir/usr/bin/sendmail"
a symlink... :)
-arne
* I cannot see a need to expose the fact that smtpctl and sendmail are the same file
* It is possible to get rid of the sendmail functionality by deleting sendmail and vice versa,
A symlink requires more care to do that.
* And last but not least, a symlink wastes an inode.
furthermore symlinks feel better than hardlinks IMO... :)
btw: mailq needs 2 b linked 2 smtpctl 2
-arne
do u want to use "ln -s" in ur patch now?
I mean: now u use my bad command from T09:59...
makemap and newaliases need a link to smtpctl, 2...
-arne
Linked all __prognames except "send-mail" since no other mta installs send-mail according to "pkgfile send-mail"
I made myself clear what I think about hardlink vs. symlink. If you want a symlink you have to change the patch yourself.
Take a look at sendmail_compat() at line 1994: http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.sbin/smtpd/smtpctl.c?rev=1.149&content-type=text/plain
Fedora does it: http://pkgs.fedoraproject.org/cgit/rpms/opensmtpd.git/tree/opensmtpd.spec#n132
Gentoo does it: https://gitweb.gentoo.org/repo/gentoo.git/tree/mail-mta/opensmtpd/opensmtpd-5.9.2_p1.ebuild#n73
I suggest taking a look at other packages and seeing how it's done there, and then try and follow what's customary in Arch. I trust Lukas Fleicher to have control of these matters.
The important part is that certain functionality is missing from opensmtpd now because of a lack of links; at least "sendmail", "makemap" and "newaliases".
sendmail -> /build/opensmtpd/pkg/opensmtpd/usr/bin/smtpctl
In the end, sendmail, makemap and newaliases are links to this mailwrapper, which, in turn, looks at a configuration file (/etc/mailer.conf) that deals with the actual redirection:
sendmail /usr/sbin/smtpctl
send-mail /usr/sbin/smtpctl
mailq /usr/sbin/smtpctl
makemap /usr/libexec/smtpd/makemap
newaliases /usr/libexec/smtpd/makemap
I agree the packaging of opensmtpd is lacking. I don't think arch need to implement a mailwrapper a la OpenBSD. Simple symlinks are more than enough. And really, modern filesystems shouldn't run out of inodes, unless you are creating huge amount of files, and even then, it would be hard to hit the limit. This whole discussion of symlink vs. hardlink or should we do it or not is moot. The fact is, we need a mailer on arch when we install opensmtpd. If it will be smtpctl itself (it should) or if it will be pulled in as a dependency doesn't matter.
in PKGBUILD lines 52-55, the links most be corrected and remove $pkgdir from target address ($pkgdir/usr/bin/smtpctl).