Initial commit

tags/smeserver-altqmail-0.1.1-1
Daniel Berteaud 11 years ago
commit b8397f3095
  1. 29
      createlinks
  2. 1
      root/etc/e-smith/db/configuration/defaults/altqmail-smtpd/TCPPort
  3. 1
      root/etc/e-smith/db/configuration/defaults/altqmail-smtpd/access
  4. 1
      root/etc/e-smith/db/configuration/defaults/altqmail-smtpd/status
  5. 1
      root/etc/e-smith/db/configuration/defaults/altqmail-smtpd/type
  6. 1
      root/etc/e-smith/db/configuration/defaults/altqmail/status
  7. 1
      root/etc/e-smith/db/configuration/defaults/altqmail/type
  8. 9
      root/etc/e-smith/templates/var/qmail/control/smtproutes/15AltQmail
  9. 1
      root/etc/e-smith/templates/var/service/altqmail/root/var/qmail/control/bouncehost/10all
  10. 1
      root/etc/e-smith/templates/var/service/altqmail/root/var/qmail/control/concurrencyremote/10all
  11. 1
      root/etc/e-smith/templates/var/service/altqmail/root/var/qmail/control/me/10all
  12. 18
      root/etc/e-smith/templates/var/service/altqmail/root/var/qmail/control/smtproutes/10localdomains
  13. 9
      root/var/service/altqmail-smtpd/log/run
  14. 9
      root/var/service/altqmail-smtpd/run
  15. 5
      root/var/service/altqmail/finish
  16. 9
      root/var/service/altqmail/log/run
  17. 33
      root/var/service/altqmail/run
  18. 209
      smeserver-altqmail.spec

@ -0,0 +1,29 @@
#!/usr/bin/perl -w
use esmith::Build::CreateLinks qw(:all);
service_link_enhanced("altqmail", "S80", "7");
service_link_enhanced("altqmail", "K60", "6");
service_link_enhanced("altqmail", "K60", "0");
service_link_enhanced("altqmail", "K60", "1");
service_link_enhanced("altqmail-smtpd", "S80", "7");
service_link_enhanced("altqmail-smtpd", "K60", "6");
service_link_enhanced("altqmail-smtpd", "K60", "0");
service_link_enhanced("altqmail-smtpd", "K60", "1");
safe_touch("root/var/service/altqmail/down");
safe_touch("root/var/service/altqmail-smtpd/down");
safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/altqmail');
safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/altqmail-smtpd');
safe_symlink("/var/service/altqmail" , 'root/service/altqmail');
safe_symlink("/var/service/altqmail-smtpd" , 'root/service/altqmail-smtpd');
safe_symlink("sighup", "root/etc/e-smith/events/email-update/services2adjust/altqmail");
safe_symlink("sighup", "root/etc/e-smith/events/email-update/services2adjust/altqmail-smtpd");
foreach my $f (qw(me bouncehost smtproutes concurrencyremote)){
safe_touch("root/etc/e-smith/templates/var/service/altqmail/root/var/qmail/control/$f/template-begin");
templates2events("/var/service/altqmail/root/var/qmail/control/$f", qw(email-update bootstrap-console-save));
}

@ -0,0 +1,9 @@
{
$OUT = '';
foreach my $domain (split /[,;]/, ($altqmail{'Domains'} || '')){
$OUT .= "$domain:127.0.0.1:" . (${'altqmail-smtpd'}{'TCPPort'} || '27') . "\n";
}
}

@ -0,0 +1 @@
{ $DB->get('altqmail')->prop('ConcurrencyRemote') || "5"; }

@ -0,0 +1,18 @@
{
$OUT = '';
use esmith::DomainsDB;
my $domainsdb = esmith::DomainsDB->open_ro();
for my $domain ($domainsdb->domains)
{
my $mail_server = $domain->prop('MailServer')
|| $DelegateMailServer
|| 'localhost';
next if ( $mail_server ne 'localhost' );
$emaildomain = $domain->key;
$OUT .= "$emaildomain:127.0.0.1\n";
}
}

@ -0,0 +1,9 @@
#!/bin/sh
NUM=$(/sbin/e-smith/db configuration getprop altqmail-smtpd KeepLogFiles)
exec \
/usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t s5000000 \
n${NUM:-10} \
/var/log/altqmail-smtpd

@ -0,0 +1,9 @@
#!/bin/sh
PORT=$(/sbin/e-smith/db configuration getprop altqmail-smtpd TCPPort)
exec \
/usr/bin/env - PATH="/var/qmail/bin:/bin:/usr/bin:/usr/local/bin" \
tcpsvd -vv 127.0.0.1 ${PORT:-27} \
chpst -u qmails -/ ../altqmail/root /var/qmail/bin/qmail-smtpd \
2>&1

@ -0,0 +1,5 @@
#!/bin/sh
umount /var/service/altqmail/root/var/qmail/bin
rm -rf root/etc
rm -rf root/lib

@ -0,0 +1,9 @@
#!/bin/sh
NUM=$(/sbin/e-smith/db configuration getprop altqmail KeepLogFiles)
exec \
/usr/local/bin/setuidgid qmaill \
/usr/local/bin/multilog t s5000000 \
n${NUM:-10} \
/var/log/altqmail

@ -0,0 +1,33 @@
#! /bin/sh
exec 2>&1
mount --bind /var/qmail/bin/ root/var/qmail/bin
if [ ! -d root/etc ]; then
mkdir root/etc
cp -a /etc/resolv.conf root/etc
cp -a /etc/services root/etc
cp -a /etc/passwd root/etc
cp -a /etc/group root/etc
fi
if [ ! -d root/lib ]; then
mkdir root/lib
cp -a /lib/libc-2.5.so root/lib
ln -s libc-2.5.so root/lib/libc.so.6
cp -a /lib/ld-2.5.so root/lib/
ln -s ld-2.5.so root/lib/ld-linux.so.2
cp -a /lib/libnss_files-2.5.so root/lib
ln -s libnss_files-2.5.so root/lib/libnss_files.so.2
cp -a /lib/libresolv-2.5.so root/lib
ln -s libresolv-2.5.so root/lib/libresolv.so.2
fi
chown qmails:qmail root/var/qmail/queue/lock/trigger
chmod 622 root/var/qmail/queue/lock/trigger
exec \
/usr/bin/env - PATH="/var/qmail/bin:/bin:/usr/bin:/usr/local/bin" \
/usr/sbin/chroot root /var/qmail/bin/qmail-start \
./Maildir/

@ -0,0 +1,209 @@
%define version 0.1.0
%define release 1
%define name smeserver-altqmail
Summary: Second qmail instance
Name: %{name}
Version: %{version}
Release: %{release}%{?dist}
License: GPL
Group: Networking/Daemons
Source: %{name}-%{version}.tar.gz
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-buildroot
BuildArchitectures: noarch
BuildRequires: e-smith-devtools
Requires: e-smith-base >= 5.2.0
Requires: qmail
%description
Provides a second qmail instance, with its own configuration
Usefull if you want to reduce the ConcurrencyRemote option
only for some domains
%changelog
* Wed May 7 2014 Daniel Berteaud <daniel@firewall-services.com> - 0.1.0-1.sme
- Initial release
%prep
%setup -q -n %{name}-%{version}
%build
%{__mkdir_p} root/var/log/{altqmail,altqmail-smtpd}
perl createlinks
mkdir -p root/var/service/altqmail/root/var/qmail/{queue,control,bin}
# Create the chrooted qmail queue
pushd root/var/service/altqmail/root/var/qmail/queue
mkdir pid
mkdir mess
mkdir todo
mkdir bounce
for i in `seq 0 22`; do
mkdir -p mess/$i
done
cp -r mess info
cp -r mess intd
cp -r mess local
cp -r mess remote
mkdir lock
dd bs=1024 count=1 if=/dev/zero of=lock/tcpto
mkfifo lock/trigger
touch lock/sendmutex
popd
%install
/bin/rm -rf $RPM_BUILD_ROOT
(cd root ; /usr/bin/find . -depth -print | /bin/cpio -dump $RPM_BUILD_ROOT)
/bin/rm -f %{name}-%{version}-filelist
/sbin/e-smith/genfilelist $RPM_BUILD_ROOT \
--file /var/service/altqmail/run 'attr(0755,root,root)' \
--file /var/service/altqmail/finish 'attr(0755,root,root)' \
--file /var/service/altqmail/log/run 'attr(0755,root,root)' \
--file /var/service/altqmail-smtpd/run 'attr(0755,root,root)' \
--file /var/service/altqmail-smtpd/log/run 'attr(0755,root,root)' \
--dir /var/log/altqmail 'attr(0750,qmaill,root)' \
--dir /var/log/altqmail-smtpd 'attr(0750,qmaill,root)' \
--dir /var/service/altqmail/root/var/qmail/queue 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/bounce 'attr(0755,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/lock 'attr(0750,qmailq,qmail)' \
--file /var/service/altqmail/root/var/qmail/queue/lock/tcpto 'attr(0644,qmailr,qmail)' \
--file /var/service/altqmail/root/var/qmail/queue/lock/sendmutex 'attr(0600,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/0 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/1 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/2 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/3 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/4 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/5 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/6 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/7 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/8 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/9 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/10 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/11 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/12 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/13 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/14 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/15 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/16 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/17 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/18 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/19 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/20 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/21 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/intd/22 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/0 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/1 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/2 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/3 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/4 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/5 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/6 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/7 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/8 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/9 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/10 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/11 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/12 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/13 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/14 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/15 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/16 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/17 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/18 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/29 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/20 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/21 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/local/22 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/0 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/1 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/2 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/3 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/4 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/5 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/6 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/7 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/8 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/9 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/10 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/11 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/12 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/13 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/14 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/15 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/16 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/17 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/18 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/29 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/20 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/21 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/info/22 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/pid 'attr(0700,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/0 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/1 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/2 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/3 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/4 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/5 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/6 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/7 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/8 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/9 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/10 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/11 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/12 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/13 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/14 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/15 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/16 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/17 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/18 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/29 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/20 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/21 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/remote/22 'attr(0700,qmails,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/0 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/1 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/2 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/3 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/4 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/5 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/6 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/7 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/8 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/9 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/10 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/11 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/12 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/13 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/14 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/15 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/16 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/17 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/18 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/19 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/20 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/21 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/mess/22 'attr(0750,qmailq,qmail)' \
--dir /var/service/altqmail/root/var/qmail/queue/todo 'attr(0750,qmailq,qmail)' \
> %{name}-%{version}-filelist
%files -f %{name}-%{version}-filelist
%defattr(-,root,root)
%clean
rm -rf $RPM_BUILD_ROOT
%pre
%post
%preun
Loading…
Cancel
Save