Optware / Optware-ng

279 stars 52 forks source link

sendmail installation errors #70

Closed gits68 closed 8 years ago

gits68 commented 8 years ago

arch i686

$ ipkg install -force-reinstall sendmail Installing sendmail (8.14.2-3) to root... Downloading http://optware-ng.zyxmon.org/buildroot-i686/sendmail_8.14.2-3_i686.ipk Configuring sendmail smmsp group already present. chown: /opt/var/spool/clientmqueue: No such file or directory chown: /opt/sbin/sendmail: No such file or directory chmod: /opt/sbin/sendmail: No such file or directory //opt/lib/ipkg/info/sendmail.postinst: line 25: /opt/bin/newaliases: not found sendmail will run as a daemon now. Alternatively, execute: echo 'smtp stream tcp nowait root /opt/sbin/sendmail -bs' >> /etc/inetd.conf echo '0-59/15 * * * * root /opt/sbin/sendmail -q & > /dev/null 2>&1' >> /etc/crontab Successfully terminated.

$ sort /opt/lib/ipkg/info/sendmail.list /opt/bin/vacation /opt/etc/init.d/S69sendmail /opt/etc/mail/aliases /opt/etc/mail/helpfile /opt/etc/mail/local-host-names /opt/etc/mail/relay-domains /opt/etc/mail/sendmail.cf /opt/etc/mail/statistics /opt/sbin/editmap /opt/sbin/mailstats /opt/sbin/makemap /opt/sbin/praliases /opt/sbin/smrsh /opt/share/man/man1/vacation.1 /opt/share/man/man8/editmap.8 /opt/share/man/man8/mailstats.8 /opt/share/man/man8/makemap.8 /opt/share/man/man8/praliases.8 /opt/share/man/man8/smrsh.8

also, binaries are linked against /lib/ld-linux.so.2 instead of /opt/lib/ld-linux.so.2

alllexx88 commented 8 years ago

Hi, should be fixed by: 57c9c9d344f9ada425908166778e185be4d346d9 ad7d9137cd0be89551e9363852ed263f4b5da025

gits68 commented 8 years ago

Configuring sendmail smmsp group already present. /opt/etc/mail/sendmail.cf: line 73: fileclass: cannot open '/opt/etc/mail/local-host-names': Group writable directory WARNING: local host name (synology) is not qualified; see cf/README: WHO AM I? WARNING: Group writable directory /opt/var sendmail will run as a daemon now. Alternatively, execute: echo 'smtp stream tcp nowait root /opt/sbin/sendmail -bs' >> /etc/inetd.conf echo '0-59/15 * * * * root /opt/sbin/sendmail -q & > /dev/null 2>&1' >> /etc/crontab

add chmod og-w /opt/etc to postinst

IMHO, sendmail-8.14.2/cf should be distributed as /opt/share/sendmail/cf or something like that, it's far more simple to edit a .mc than a .cf :)

sendmail-8.14.2/cf/cf/Makefile needed changes : CF=generic-linux MAILDIR=%OPTWARE_TARGET_PREFIX%/etc/mail INSTALL=%OPTWARE_TARGET_PREFIX%/bin/install add the following line before the all: target default: install-sendmail-cf

PS : why don't you provide submit.cf ?

gits68 commented 8 years ago

cf/cf/Makefile

--- cf/cf/Makefile.orig
+++ cf/cf/Makefile
@@ -12,11 +12,11 @@
 #

 # name of source for sendmail.cf (without extension)
-CF=    sendmail
+CF=    optware-sendmail
 # name of source for submit.cf (without extension)
-SUBMIT=        submit
+SUBMIT=        optware-submit
 # directory for .cf files
-MAILDIR=/etc/mail
+MAILDIR=/opt/etc/mail
 M4=    m4
 CFDIR= ..
 SED=  sed
@@ -25,11 +25,14 @@
 ROMODE=        444
 RM=    rm -f
 # use our own install program; should be really confINSTALL
-INSTALL=../../devtools/bin/install.sh
+INSTALL=/opt/bin/install
 # CF file ownership/permissions
 CFOWN=root
-CFGRP=bin
+CFGRP=root
 CFMODE=0444
+
+DEFAULT= $(SUBMIT).cf $(CF).cf
+default: $(DEFAULT)

 .SUFFIXES:  .mc .cf

cf/cf/optware-sendmail.mc

divert(-1)
#
# Copyright (c) 1998, 1999 Sendmail, Inc. and its suppliers.
#       All rights reserved.
# Copyright (c) 1983 Eric P. Allman.  All rights reserved.
# Copyright (c) 1988, 1993
#       The Regents of the University of California.  All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
#  This is a generic configuration file for Linux.
#  It has support for local and SMTP mail only.  If you want to
#  customize it, copy it to a name appropriate for your environment
#  and do the modifications there.
#

divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
define(`confOPTWARE',`/opt')dnl
define(`LOCAL_MAILER_PATH',confOPTWARE`/bin/procmail')dnl
define(`MAIL_SETTINGS_DIR',confOPTWARE`/etc/mail/')dnl
define(`QUEUE_DIR',confOPTWARE`/var/spool/mqueue')dnl
define(`confDEAD_LETTER_DROP',confOPTWARE`/var/tmp/dead.letter')dnl
define(`confCONTROL_SOCKET_NAME',QUEUE_DIR`/.control')dnl
define(`confPID_FILE',confOPTWARE`/var/run/sendmail.pid')dnl
MAILER(local)dnl
MAILER(smtp)dnl

cf/cf/optware-submit.mc

divert(-1)
#
# Copyright (c) 2001-2003 Sendmail, Inc. and its suppliers.
#       All rights reserved.
#
# By using this file, you agree to the terms and conditions set
# forth in the LICENSE file which can be found at the top level of
# the sendmail distribution.
#
#

#
#  This is the prototype file for a set-group-ID sm-msp sendmail that
#  acts as a initial mail submission program.
#

divert(0)dnl
VERSIONID(`$Id: submit.mc,v 8.14 2006/04/05 05:54:41 ca Exp $')
define(`confCF_VERSION', `Submit')dnl
define(`__OSTYPE__',`')dnl dirty hack to keep proto.m4 from complaining
define(`_USE_DECNET_SYNTAX_', `1')dnl support DECnet
define(`confTIME_ZONE', `USE_TZ')dnl
define(`confDONT_INIT_GROUPS', `True')dnl
dnl
dnl If you use IPv6 only, change [127.0.0.1] to [IPv6:::1]
FEATURE(`msp', `[127.0.0.1]')dnl
define(`confOPTWARE',`/opt')dnl
define(`LOCAL_MAILER_PATH',confOPTWARE`/bin/procmail')dnl
define(`MAIL_SETTINGS_DIR',confOPTWARE`/etc/mail/')dnl
define(`QUEUE_DIR',confOPTWARE`/var/spool/mqueue')dnl
define(`STATUS_FILE',confOPTWARE`/var/spool/clientmqueue/sm-client.st')dnl
define(`confDEAD_LETTER_DROP',confOPTWARE`/var/tmp/dead.letter')dnl
define(`confCONTROL_SOCKET_NAME',QUEUE_DIR`/.control')dnl
define(`confPID_FILE',confOPTWARE`/var/spool/clientmqueue/sm-client.pid')dnl

which allow the user to modify optware-*.mc as neded, then make, make install

alllexx88 commented 8 years ago

Is that what you meant? :-)

gits68 commented 8 years ago

hi,

%OPTWARE_TARGET_PREFIX%/etc/mail is a directory...

in postinst chmod 644 %OPTWARE_TARGET_PREFIX%/etc/mail should be chmod 755 %OPTWARE_TARGET_PREFIX%/etc/mail

also, add chmod og-w /opt/etc

Regards

alllexx88 commented 8 years ago

%OPTWARE_TARGET_PREFIX%/etc/mail is a directory...

So what? I only see that fileclass complains about /opt/etc/mail being group writable. chmod 644 makes it rw-r--r-- -- not group writable. Why would you want to make it rwxr-xr-x? /opt/etc/mail doesn't contain scripts.

chmod og-w /opt/etc

No need for that, likewise

gits68 commented 8 years ago

well, directories usually have the x byte for traversal.

root@synology /opt/etc# ls -ld mail drwxr-xr-x 2 root root 4096 2016-02-23 00:24 mail root@synology /opt/etc# chmod 644 mail root@synology /opt/etc# ls -ld mail drw-r--r-- 2 root root 4096 2016-02-23 00:24 mail root@synology /opt/etc# su - Cyrille BusyBox v1.16.1 (2015-11-12 18:00:37 CST) built-in shell (ash) Enter 'help' for a list of built-in commands. synology> id uid=1027(Cyrille) gid=100(users) groups=100(users) synology> cd /opt/etc/mail -sh: cd: can't cd to /opt/etc/mail synology> root@synology /opt/etc# chmod 755 mail root@synology /opt/etc# su - Cyrille BusyBox v1.16.1 (2015-11-12 18:00:37 CST) built-in shell (ash) Enter 'help' for a list of built-in commands. synology> cd /opt/etc/mail synology> ls aliases local-host-names sendmail.cf submit.cf helpfile relay-domains statistics

alllexx88 commented 8 years ago

Ah, I see what you mean. Didn't think you'd want to browse /opt/etc/mail as non-root. There's no real point for that in embedded, I think. Changed it to 755, since it costs nothing anyway :-)