1 |
charliebrady |
1.1 |
Summary: Routing messages by user |
2 |
|
|
%define name smeserver-mailrouting |
3 |
|
|
Name: %{name} |
4 |
|
|
%define version 0.0.1 |
5 |
|
|
%define release 0 |
6 |
|
|
Version: %{version} |
7 |
|
|
Release: %{release} |
8 |
|
|
Copyright: GPL |
9 |
|
|
Group: Mail |
10 |
|
|
Source: %{name}-%{version}.tar.gz |
11 |
|
|
Packager: Michael Weinberger <mweinber@neddix.de> |
12 |
|
|
BuildRoot: /var/tmp/%{name}-buildroot/ |
13 |
|
|
BuildArch: noarch |
14 |
|
|
Requires: smeserver-qpsmtpd qmail |
15 |
|
|
AutoReqProv: no |
16 |
|
|
|
17 |
|
|
%changelog |
18 |
|
|
|
19 |
|
|
* Thu Sep 1 2005 Michael Weinberger <mweinber@neddix.de> |
20 |
|
|
- Initial release |
21 |
|
|
|
22 |
|
|
%description |
23 |
|
|
for SME7 only! |
24 |
|
|
Routes mail to another server by the recipient name |
25 |
|
|
Routed recipient don't need a local account. |
26 |
|
|
Mailrouting is disabled, when "internal mail server" (smtproutes) is set. |
27 |
|
|
|
28 |
|
|
How to set up: |
29 |
|
|
/sbin/e-smith/db /home/e-smith/mailrouting set ADDRESS mailrouting MailroutingAddress MAILROUTINGADDRESS |
30 |
|
|
|
31 |
|
|
Example: Route messages for joe.sixpack here (foo.com) to server mail2.foo.com |
32 |
|
|
/sbin/e-smith/db /home/e-smith/mailrouting set joe.sixpack@foo.com mailrouting MailroutingAddress Joe.Sixpack@mail2.foo.com |
33 |
|
|
/etc/rc.d/rc7.d/S85qpsmtpd restart |
34 |
|
|
/etc/rc.d/rc7.d/S85sqpsmtpd restart |
35 |
|
|
/etc/rc.d/rc7.d/S80qmail restart |
36 |
|
|
|
37 |
|
|
Note the lower-case for the key (joe.sixpack@foo.com)! |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
|
|
%prep |
42 |
|
|
%setup |
43 |
|
|
%setup -q -n %{name}-%{version} |
44 |
|
|
|
45 |
|
|
%build |
46 |
|
|
|
47 |
|
|
%install |
48 |
|
|
rm -rf $RPM_BUILD_ROOT |
49 |
|
|
(cd root ; find . -depth -print | cpio -dump $RPM_BUILD_ROOT) |
50 |
|
|
rm -f %{name}-%{version}-filelist |
51 |
|
|
find $RPM_BUILD_ROOT -depth -type f -print |\ |
52 |
|
|
sed -e "s@^$RPM_BUILD_ROOT@@g" \ |
53 |
|
|
-e "s@^/etc/e-smith/templates/@%attr(0644,root,root) &@"\ |
54 |
|
|
-e "s@^/var/qmail/control/@%attr(0644,root,root) &@"\ |
55 |
|
|
-e "s@^/var/qmail/alias/@%attr(0644,alias,qmail) &@"\ |
56 |
|
|
-e "s@^/var/qmail/bin/@%attr(0755,root,qmail) &@"\ |
57 |
|
|
-e "s@^/home/e-smith/qmail/@%attr(0640,root,qmail) &@"\ |
58 |
|
|
>> %{name}-%{version}-filelist |
59 |
|
|
find $RPM_BUILD_ROOT -depth -type l -print |\ |
60 |
|
|
sed "s@^$RPM_BUILD_ROOT@@g" >> %{name}-%{version}-filelist |
61 |
|
|
|
62 |
|
|
%clean |
63 |
|
|
rm -rf $RPM_BUILD_ROOT |
64 |
|
|
|
65 |
|
|
%pre |
66 |
|
|
%preun |
67 |
|
|
%post |
68 |
|
|
|
69 |
|
|
touch -a /home/e-smith/mailrouting |
70 |
|
|
chown root.admin /home/e-smith/mailrouting |
71 |
|
|
chmod 644 /home/e-smith/mailrouting |
72 |
|
|
|
73 |
|
|
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
74 |
|
|
/sbin/e-smith/signal-event email-update |
75 |
|
|
/etc/rc.d/rc7.d/S85qpsmtpd restart |
76 |
|
|
/etc/rc.d/rc7.d/S85sqpsmtpd restart |
77 |
|
|
/etc/rc.d/rc7.d/S80qmail restart |
78 |
|
|
fi |
79 |
|
|
%postun |
80 |
|
|
if [ "x`/bin/cat /proc/1/cmdline`" = "xinit [7]" ] ; then |
81 |
|
|
if [ $1 = 0 ] ; then # uninstall |
82 |
|
|
/sbin/e-smith/signal-event email-update |
83 |
|
|
/etc/rc.d/rc7.d/S85qpsmtpd restart |
84 |
|
|
/etc/rc.d/rc7.d/S85sqpsmtpd restart |
85 |
|
|
/etc/rc.d/rc7.d/S80qmail restart |
86 |
|
|
fi |
87 |
|
|
fi |
88 |
|
|
|
89 |
|
|
%files -f %{name}-%{version}-filelist |
90 |
|
|
%defattr(-,root,root) |