Initial selinux policy support

This commit is contained in:
Stuart Gathman
2013-06-26 18:28:49 +00:00
parent af49a7a45e
commit 8770262622
2 changed files with 8 additions and 1 deletions
+3
View File
@@ -71,6 +71,9 @@ class myMilter(Milter.Base):
self.fromparms = Milter.dictfromlist(str) # ESMTP parms
self.user = self.getsymval('{auth_authen}') # authenticated user
self.log("mail from:", mailfrom, *str)
# NOTE: self.fp is only an *internal* copy of message data. You
# must use addheader, chgheader, replacebody to change the message
# on the MTA.
self.fp = StringIO.StringIO()
self.canon_from = '@'.join(parse_addr(mailfrom))
self.fp.write('From %s %s\n' % (self.canon_from,time.ctime()))
+5 -1
View File
@@ -7,8 +7,9 @@
Summary: Python interface to sendmail milter API
Name: %{pythonbase}-pymilter
Version: 0.9.8
Release: 1%{dist}
Release: 2%{dist}
Source: http://downloads.sourceforge.net/pymilter/pymilter-%{version}.tar.gz
Source1: pymilter.te
License: GPLv2+
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
@@ -19,6 +20,7 @@ Requires: %{pythonbase} >= 2.6.5, sendmail >= 8.13
Requires: %{pythonbase}-pydns
# Needed for callbacks, not a core function but highly useful for milters
BuildRequires: ed, %{pythonbase}-devel, sendmail-devel >= 8.13
BuildRequires: policycoreutils
%description
This is a python extension module to enable python scripts to
@@ -31,6 +33,8 @@ DSNs, and doing CBV.
%build
env CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
checkmodule -m -M -o pymilter.mod %{SOURCE1}
semodule_package -o pymilter.pp -m pymilter.mod
%install
rm -rf $RPM_BUILD_ROOT