summaryrefslogtreecommitdiff
path: root/smtp-gated.spec
blob: 1e47875cf40d75fa3fbaba0688a2a00ede28da41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
%define		_rc	rc1
Summary:	Spam/malware transparent SMTP proxy blocker
Summary(pl):	Transparentne proxy SMTP blokujące spam/wirusy
Name:		smtp-gated
Version:	1.4.14
Release:	1.%{_rc}.1
License:	GPL v2
Group:		Applications/Networking
Source0:	http://smtp-proxy.klolik.org/%{name}-%{version}-%{_rc}.tar.gz
# Source0-md5:	accd612edce0907d9884407a7802cb1a
Source1:	%{name}.init
Source2:	%{name}.conf
URL:		http://smtp-proxy.klolik.org/
BuildRequires:	autoconf
BuildRequires:	automake
Requires(post,preun):	/sbin/chkconfig
Requires(postun):	/usr/sbin/userdel
Requires(pre):	/bin/id
Requires(pre):	/usr/sbin/useradd
Requires:	clamav
#Requires:	kernel(netfilter)
Provides:	user(smtpgw)
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
This software block SMTP sessions used by e-mail worms and viruses on
the NA(P)T router. It depends on netfilter framework of Linux.

It acts like proxy, intercepting outgoing SMTP connections and
scanning session data on-the-fly. When messages is infected, the SMTP
session is terminated. It's to be used (mostly) by ISPs, so they can
eliminate infected hosts from their network, and (preferably) educate
their users.

It's similar to clamsmtp and assp.

%description -l pl
To oprogramowanie blokuje sesje SMTP używane przez robaki i wirusy na
poziomie routerów z NA(P)T. Jest zależne od warstwy netfiltra
linuksowego kernela.

Działa jak proxy, przechwytując wychodzący ruch SMTP i skanując dane w
locie. Gdy wiadomość jest zainfekowana, sesja zostaje przerwana.
Oprogramowanie jest przeznaczone dla ISP, mogą nim wyeliminować
zainfekowane komputery ze swoich sieci.

Pełni podobną funkcję co clamsmtp i assp.

%prep
%setup -q -n %{name}-%{version}-%{_rc}

%build
%{__aclocal}
%{__autoconf}
%{__autoheader}
%{__automake}
%configure \
	--with-lang=pl \
	%{?debug:--enable-debugger}
%{__make}

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{_sbindir},%{_mandir}/man{5,8},/etc/{rc.d/init.d,sysconfig}}
install -d $RPM_BUILD_ROOT{%{_examplesdir}/%{name},/var/spool/%{name}/{lock,msg}}
install -d $RPM_BUILD_ROOT/var/run/%{name}

install src/smtp-gated $RPM_BUILD_ROOT%{_sbindir}
install doc/smtp-gated.8 $RPM_BUILD_ROOT%{_mandir}/man8
install doc/smtp-gated.conf.5 $RPM_BUILD_ROOT%{_mandir}/man5

install lib/{fixed.conf,nat.conf} $RPM_BUILD_ROOT%{_examplesdir}/%{name}

install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/smtp-gated
install %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}.conf
:> $RPM_BUILD_ROOT/etc/sysconfig/%{name}

%clean
rm -rf $RPM_BUILD_ROOT

%pre
%useradd -u 147 -r -d %{_var}/spool/%{name} -s /bin/false -c "SMTP gateway" -g clamav smtpgw

%postun
if [ "$1" = "0" ]; then
	%userremove smtpgw
fi

%post
/sbin/chkconfig --add %{name}
if [ -f /var/lock/subsys/%{name} ]; then
	/etc/rc.d/init.d/%{name} restart >&2
else
	echo "Type \"/etc/rc.d/init.d/%{name} start\" to start %{name} server"
fi

%preun
if [ "$1" = "0" ]; then
	if [ -f /var/lock/subsys/%{name} ]; then
		/etc/rc.d/init.d/%{name} stop >&2
	fi
	/sbin/chkconfig --del %{name}
fi

%files
%defattr(644,root,root,755)
%doc AUTHORS ChangeLog README doc/manual*.txt
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/sysconfig/%{name}
%attr(640,root,clamav) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/%{name}.conf
%attr(754,root,root) /etc/rc.d/init.d/%{name}
%attr(755,root,root) %{_sbindir}/smtp-gated
%{_mandir}/man5/*
%{_mandir}/man8/*
%{_examplesdir}/%{name}/*
%attr(750,smtpgw,clamav) /var/run/%{name}
%attr(750,smtpgw,clamav) /var/spool/%{name}