Accepting request 21172 from server:mail
Copy from server:mail/postfix based on submit request 21172 from user varkoly OBS-URL: https://build.opensuse.org/request/show/21172 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/postfix?expand=0&rev=37
This commit is contained in:
parent
8f38b6a1f2
commit
f0ff8ace09
File diff suppressed because it is too large
Load Diff
42
postfix-2.2.9-main.cf.patch
Normal file
42
postfix-2.2.9-main.cf.patch
Normal file
@ -0,0 +1,42 @@
|
||||
diff -ruN postfix-2.2.9-orig/conf/main.cf postfix-2.2.9/conf/main.cf
|
||||
--- postfix-2.2.9-orig/conf/main.cf 2005-03-04 17:48:25.000000000 +0000
|
||||
+++ postfix-2.2.9/conf/main.cf 2008-08-04 19:08:01.086201423 +0000
|
||||
@@ -405,7 +405,7 @@
|
||||
# "Maildir/" for qmail-style delivery (the / is required).
|
||||
#
|
||||
#home_mailbox = Mailbox
|
||||
-#home_mailbox = Maildir/
|
||||
+home_mailbox = Maildir/
|
||||
|
||||
# The mail_spool_directory parameter specifies the directory where
|
||||
# UNIX-style mailboxes are kept. The default setting depends on the
|
||||
@@ -642,3 +642,29 @@
|
||||
# readme_directory: The location of the Postfix README files.
|
||||
#
|
||||
readme_directory =
|
||||
+
|
||||
+
|
||||
+############################################################
|
||||
+# Start MySQL from postfixwiki.org
|
||||
+############################################################
|
||||
+virtual_alias_maps = hash:/etc/postfix/virtual
|
||||
+#virtual_uid_maps = static:303
|
||||
+#virtual_gid_maps = static:303
|
||||
+#virtual_minimum_uid = 303
|
||||
+#virtual_mailbox_base = /srv/maildirs
|
||||
+#virtual_mailbox_domains = mysql:/etc/postfix/mysql_virtual_domains_maps.cf
|
||||
+#virtual_mailbox_limit = 0
|
||||
+#virtual_mailbox_maps = mysql:/etc/postfix/mysql_virtual_mailbox_maps.cf
|
||||
+#virtual_transport = virtual
|
||||
+## Additional for quota support
|
||||
+#virtual_create_maildirsize = yes
|
||||
+#virtual_mailbox_extended = yes
|
||||
+#virtual_mailbox_limit_maps = mysql:/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
|
||||
+#virtual_mailbox_limit_override = yes
|
||||
+#virtual_maildir_limit_message = Sorry, the user's maildir has overdrawn his diskspace quota, please try again later.
|
||||
+#virtual_overquota_bounce = yes
|
||||
+relay_domains = $mydestination, hash:/etc/postfix/relay
|
||||
+############################################################
|
||||
+# End MySQL from postfixwiki.org
|
||||
+############################################################
|
||||
+
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:59d810fde87c73dc50d309051e726a1ad25f5ea081aa1d0fe00dc9d6aa4405f1
|
||||
size 2304976
|
225
postfix-2.6.1-vda-ng-64bit.patch
Normal file
225
postfix-2.6.1-vda-ng-64bit.patch
Normal file
@ -0,0 +1,225 @@
|
||||
diff -uNr postfix-2.5.6-vda-ng.orig/src/util/vbuf_print.c postfix-2.5.6/src/util/vbuf_print.c
|
||||
--- postfix-2.5.6-vda-ng.orig/src/util/vbuf_print.c 2006-12-10 18:13:07.000000000 +0100
|
||||
+++ postfix-2.5.6/src/util/vbuf_print.c 2008-08-25 12:20:41.032890016 +0200
|
||||
@@ -193,8 +193,13 @@
|
||||
msg_warn("%s: bad precision %d in %.50s", myname, prec, format);
|
||||
prec = 0;
|
||||
}
|
||||
- if ((long_flag = (*cp == 'l')) != 0)/* long whatever */
|
||||
+ if ((long_flag = (*cp == 'l')) != 0) { /* long whatever */
|
||||
VSTRING_ADDCH(fmt, *cp++);
|
||||
+ if (*cp == 'l') { /* we have long long param */
|
||||
+ long_flag = 2;
|
||||
+ VSTRING_ADDCH(fmt, *cp++);
|
||||
+ }
|
||||
+ }
|
||||
if (*cp == 0) /* premature end, punt */
|
||||
break;
|
||||
VSTRING_ADDCH(fmt, *cp); /* type (checked below) */
|
||||
@@ -226,8 +231,10 @@
|
||||
case 'X':
|
||||
if (VBUF_SPACE(bp, (width > prec ? width : prec) + INT_SPACE))
|
||||
return (bp);
|
||||
- if (long_flag)
|
||||
+ if (long_flag == 1)
|
||||
sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long));
|
||||
+ else if (long_flag == 2)
|
||||
+ sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long long));
|
||||
else
|
||||
sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, int));
|
||||
VBUF_SKIP(bp);
|
||||
diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/mailbox.c postfix-2.5.6/src/virtual/mailbox.c
|
||||
--- postfix-2.5.6-vda-ng.orig/src/virtual/mailbox.c 2008-08-25 11:57:48.000000000 +0200
|
||||
+++ postfix-2.5.6/src/virtual/mailbox.c 2008-08-25 12:20:41.032890016 +0200
|
||||
@@ -120,7 +120,6 @@
|
||||
myname, usr_attr.mailbox, OFF_T_MAX);
|
||||
}
|
||||
else {
|
||||
- /* Invalid limit size (negative). Use default virtual_mailbox_limit. */
|
||||
set_file_limit(var_virt_mailbox_limit);
|
||||
status = NO;
|
||||
}
|
||||
diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/maildir.c postfix-2.5.6/src/virtual/maildir.c
|
||||
--- postfix-2.5.6-vda-ng.orig/src/virtual/maildir.c 2008-08-25 11:57:48.000000000 +0200
|
||||
+++ postfix-2.5.6/src/virtual/maildir.c 2008-08-25 12:20:41.033889864 +0200
|
||||
@@ -65,6 +65,8 @@
|
||||
|
||||
/* Patch library. */
|
||||
|
||||
+#include <syslog.h>
|
||||
+#include <stdint.h>
|
||||
#include <sys/types.h> /* opendir(3), stat(2) */
|
||||
#include <sys/stat.h> /* stat(2) */
|
||||
#include <dirent.h> /* opendir(3) */
|
||||
@@ -98,14 +100,14 @@
|
||||
* Returns the size of all mails as read from maildirsize,
|
||||
* zero if it couldn't read the file.
|
||||
*/
|
||||
-static long read_maildirsize(char *dirname, long *countptr)
|
||||
+static uint64_t read_maildirsize(char *dirname, uint64_t *countptr)
|
||||
{
|
||||
struct stat statbuf;
|
||||
VSTRING *sizefilename = vstring_alloc(1024);
|
||||
VSTREAM *sizefile;
|
||||
char *p;
|
||||
int len, first;
|
||||
- long sum = 0, count = 0;
|
||||
+ uint64_t sum = 0, count = 0;
|
||||
|
||||
vstring_sprintf(sizefilename, "%s/%s", dirname, "maildirsize");
|
||||
|
||||
@@ -128,7 +130,7 @@
|
||||
first = 1;
|
||||
|
||||
while (*p) {
|
||||
- long n = 0, c = 0;
|
||||
+ uint64_t n = 0, c = 0;
|
||||
char *q = p;
|
||||
|
||||
while (*p) {
|
||||
@@ -143,7 +145,7 @@
|
||||
continue;
|
||||
}
|
||||
|
||||
- if(sscanf(q, "%ld %ld", &n, &c) == 2) {
|
||||
+ if(sscanf(q, "%llu %llu", &n, &c) == 2) {
|
||||
sum += n;
|
||||
count += c;
|
||||
}
|
||||
@@ -179,7 +181,7 @@
|
||||
* Returns the size given in ",S=<size>" in the filename,
|
||||
* zero if it cannot find ",S=<size>" in the filename.
|
||||
*/
|
||||
-static long maildir_parsequota(const char *n)
|
||||
+static uint64_t maildir_parsequota(const char *n)
|
||||
{
|
||||
const char *o;
|
||||
int yes = 0;
|
||||
@@ -204,7 +206,7 @@
|
||||
}
|
||||
|
||||
if (yes) {
|
||||
- long s = 0;
|
||||
+ uint64_t s = 0;
|
||||
|
||||
while (*o >= '0' && *o <= '9')
|
||||
s = s*10 + (*o++ - '0');
|
||||
@@ -231,17 +233,17 @@
|
||||
* Returns the sum of the sizes of all measurable files,
|
||||
* zero if the directory could not be opened.
|
||||
*/
|
||||
-static long check_dir_size(char *dirname, long *countptr)
|
||||
+static uint64_t check_dir_size(char *dirname, uint64_t *countptr)
|
||||
{
|
||||
char *myname = "check_dir_size";
|
||||
DIR *dir;
|
||||
- long sum = 0;
|
||||
+ uint64_t sum = 0;
|
||||
struct dirent *ent;
|
||||
struct stat statbuf;
|
||||
|
||||
if (!var_virt_mailbox_limit_inbox && var_virt_maildir_extended && (sum = read_maildirsize(dirname, countptr))) {
|
||||
if (msg_verbose)
|
||||
- msg_info("%s: maildirsize used: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr);
|
||||
+ msg_info("%s: maildirsize used: dir=%s sum=%llu count=%llu", myname, dirname, sum, *countptr);
|
||||
return sum;
|
||||
}
|
||||
|
||||
@@ -262,7 +264,7 @@
|
||||
|
||||
while ((ent = readdir(dir)) != NULL) {
|
||||
char *name = ent->d_name;
|
||||
- long tmpsum = 0;
|
||||
+ uint64_t tmpsum = 0;
|
||||
VSTRING *buffer;
|
||||
|
||||
if (var_virt_trash_count) {
|
||||
@@ -325,7 +327,7 @@
|
||||
closedir(dir);
|
||||
|
||||
if (msg_verbose)
|
||||
- msg_info("%s: full scan done: dir=%s sum=%ld count=%ld", myname, dirname, sum, *countptr);
|
||||
+ msg_info("%s: full scan done: dir=%s sum=%llu count=%llu", myname, dirname, sum, *countptr);
|
||||
|
||||
return sum;
|
||||
}
|
||||
@@ -443,9 +445,9 @@
|
||||
char *sizefilename = (char *) 0; /* Maildirsize file name. */
|
||||
VSTRING *filequota; /* Quota setting from the maildirsize file. */
|
||||
VSTREAM *sizefile; /* Maildirsize file handle. */
|
||||
- long n = 0; /* Limit in long integer format. */
|
||||
- long saved_count = 0; /* The total number of files. */
|
||||
- long saved_size = 0; /* The total quota of all files. */
|
||||
+ uint64_t n = 0; /* Limit in long integer format. */
|
||||
+ uint64_t saved_count = 0; /* The total number of files. */
|
||||
+ uint64_t saved_size = 0; /* The total quota of all files. */
|
||||
struct stat mail_stat; /* To check the size of the mail to be written. */
|
||||
struct stat sizefile_stat; /* To check the size of the maildirsize file. */
|
||||
time_t tm; /* To check the age of the maildirsize file. */
|
||||
@@ -520,7 +522,8 @@
|
||||
* warn the user, else use the value directly as the maildir limit.
|
||||
*/
|
||||
if (*var_virt_mailbox_limit_maps != 0 && (limit_res = mail_addr_find(virtual_mailbox_limit_maps, state.msg_attr.user, (char **) NULL)) != 0) {
|
||||
- n = atol(limit_res);
|
||||
+ /* if there is some unexpected char in limit_res var, n will be zero! */
|
||||
+ n = strtoull(limit_res, NULL, 10);
|
||||
if (n > 0) {
|
||||
if ((n < var_message_limit) && (!var_virt_mailbox_limit_override)) {
|
||||
n = var_virt_mailbox_limit;
|
||||
@@ -535,13 +538,13 @@
|
||||
}
|
||||
else {
|
||||
if (msg_verbose)
|
||||
- msg_info("%s: set virtual maildir limit size for %s to %ld",
|
||||
+ msg_info("%s: set virtual maildir limit size for %s to %llu",
|
||||
myname, usr_attr.mailbox, n);
|
||||
}
|
||||
}
|
||||
else if (n == 0) {
|
||||
if (msg_verbose)
|
||||
- msg_info("%s: set virtual maildir limit size for %s to %ld",
|
||||
+ msg_info("%s: set virtual maildir limit size for %s to %llu",
|
||||
myname, usr_attr.mailbox, n);
|
||||
}
|
||||
else {
|
||||
@@ -662,7 +665,7 @@
|
||||
*/
|
||||
if (stat(tmpfile, &mail_stat) == 0) {
|
||||
if (n != 0) {
|
||||
- saved_size += (long) mail_stat.st_size;
|
||||
+ saved_size += (uint64_t) mail_stat.st_size;
|
||||
saved_count++;
|
||||
}
|
||||
if (var_virt_maildir_extended) {
|
||||
@@ -866,7 +869,9 @@
|
||||
filequota = vstring_alloc(128);
|
||||
vstring_get_null_bound(filequota, sizefile, 127);
|
||||
vstream_fclose(sizefile);
|
||||
- if (atol(vstring_export(filequota)) != n)
|
||||
+ /* if there will be some unexpected char in filequota var, strtoull() return 0
|
||||
+ and this probably != n, so file will be rewritten */
|
||||
+ if (strtoull(vstring_export(filequota), NULL, 10) != n)
|
||||
unlink(sizefilename);
|
||||
}
|
||||
|
||||
@@ -886,7 +891,7 @@
|
||||
|
||||
/* If the creation worked, write to the file, otherwise just give up. */
|
||||
if (sizefile) {
|
||||
- vstream_fprintf(sizefile, "%ldS\n%ld %ld\n", n, saved_size, saved_count);
|
||||
+ vstream_fprintf(sizefile, "%lluS\n%llu %llu\n", n, saved_size, saved_count);
|
||||
vstream_fclose(sizefile);
|
||||
}
|
||||
}
|
||||
diff -uNr postfix-2.5.6-vda-ng.orig/src/virtual/Makefile.in postfix-2.5.6/src/virtual/Makefile.in
|
||||
--- postfix-2.5.6-vda-ng.orig/src/virtual/Makefile.in 2007-03-17 18:51:46.000000000 +0100
|
||||
+++ postfix-2.5.6/src/virtual/Makefile.in 2008-08-25 12:20:41.034889712 +0200
|
||||
@@ -4,7 +4,7 @@
|
||||
HDRS = virtual.h
|
||||
TESTSRC =
|
||||
DEFS = -I. -I$(INC_DIR) -D$(SYSTYPE)
|
||||
-CFLAGS = $(DEBUG) $(OPT) $(DEFS)
|
||||
+CFLAGS = $(DEBUG) $(OPT) $(DEFS) -std=gnu99
|
||||
PROG = virtual
|
||||
TESTPROG=
|
||||
INC_DIR = ../../include
|
1459
postfix-2.6.1-vda-ng.patch
Normal file
1459
postfix-2.6.1-vda-ng.patch
Normal file
File diff suppressed because it is too large
Load Diff
3
postfix-2.6.1.tar.bz2
Normal file
3
postfix-2.6.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:09fd1b79d900b42e41c9f3ed31c6400dfb6e0d2955aed27d76d5e464bf2d09c9
|
||||
size 2438713
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5e9732abe32e8eebb4fb53a2e338cc31d2307f96af303f6f5d2b0993040684c2
|
||||
size 18111
|
||||
oid sha256:81bb95c7b712f3ac4a1356917992e7c5e650e03b192f9a35117351360386cc97
|
||||
size 21145
|
||||
|
3
postfix-mysql.tar.bz2
Normal file
3
postfix-mysql.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cff3c067d45ff6a9c7ce1c7ac47c155955fe55b965ef1bf030b1bd912ce55479
|
||||
size 1743
|
@ -1,3 +1,75 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 28 09:22:54 CEST 2009 - varkoly@suse.de
|
||||
|
||||
- bnc#540538 – postfix-2.6.1-10.1 installs new files in /etc/postfix and does not generate <file>.db
|
||||
- bnc#519438 - Postfix: Running chrooted lets qmgr loosing his syslog-socket
|
||||
- remove obsolate version tests from SuSEconfig.postfix
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 28 08:24:43 CEST 2009 - varkoly@suse.de
|
||||
|
||||
- bnc#525825 - when using cyrus in a chroot environment Suseconfig does not
|
||||
create socket /var/lib/imap/socket/lmtp
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Sep 14 11:34:41 UTC 2009 - chris@computersalat.de
|
||||
|
||||
- spec
|
||||
o fdupes if >= 1100
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Sep 10 21:22:46 CEST 2009 - chris@computersalat.de
|
||||
|
||||
- update to 2.6.1
|
||||
o merge home:varkoly:Factory and o:F
|
||||
- spec mods
|
||||
o use of getent
|
||||
- rpmlint
|
||||
o remove unneeded dists from examples/chroot-setup/
|
||||
o postin-without-ldconfig
|
||||
o files-duplicate /usr/share/doc/packages/postfix-doc/html/
|
||||
o files-duplicate /usr/share/man/man?
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Apr 13 18:21:14 UTC 2009 - chris@computersalat.de
|
||||
|
||||
- added VDA patch
|
||||
o Mailbox / Maildir size limit, known also as "soft quota",
|
||||
to avoid user take all you disk space
|
||||
o Customizable "limit" message when the soft quota limit is reached.
|
||||
NOTE: message is sent to senders, but NOT to the owner of the mailbox.
|
||||
o Limit only 'INBOX', because some people use IMAP and don't want
|
||||
the same limit in IMAP folder that are differents from INBOX.
|
||||
o Support for 'Courier' style Maildir, usefull for people that
|
||||
use courier as pop3/imap server and to get fast soft quota summary.
|
||||
Note that it is also compatible with qmail maildir per default.
|
||||
o Supports for Courier 'maildirsize' file in Maildir folder that
|
||||
is used to read quotas quickly. Note that this option is not
|
||||
actived per default and can be dangerous on some NFS client
|
||||
implementation
|
||||
(like for example Solaris that cache some filesystem operations).
|
||||
o Customisable suffix for Maildir support, when share same external
|
||||
dict between postfix and pop3/imap server sometime "Maildir/" suffix
|
||||
is needed to avoid extra database handling (eg LDAP, MySQL...).
|
||||
- some improvements of SuSEconfig.postfix
|
||||
o POSTFIX_LISTEN: Comma separated list of IP's
|
||||
o POSTFIX_INET_PROTO: ipv4, ipv6, all
|
||||
o POSTFIX_MYHOSTNAME: define SMTPs FQHOSTNAME
|
||||
o POSTFIX_WITH_MYSQL: when using MySQL as backend
|
||||
o POSTFIX_BASIC_SPAM_PREVENTION: "custom"
|
||||
you can now define your own rules
|
||||
- POSTFIX_SMTPD_CLIENT_RESTRICTIONS
|
||||
- POSTFIX_SMTPD_HELO_RESTRICTIONS
|
||||
- POSTFIX_SMTPD_SENDER_RESTRICTIONS
|
||||
- POSTFIX_SMTPD_RECIPIENT_RESTRICTIONS
|
||||
- added helo_access for helo checks
|
||||
- added relay for relaying domain
|
||||
- added MySQL stuff when using MySQL as backend (virtuser)
|
||||
o you should consider postfixAdmin as mgmnt interface
|
||||
o when runninng postfix chrooted:
|
||||
you have to run SUSEconfig each time when you have restarted MySQL
|
||||
because of linking mysql.sock
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 29 15:18:52 CEST 2009 - varkoly@suse.de
|
||||
|
||||
|
566
postfix.spec
566
postfix.spec
@ -1,5 +1,5 @@
|
||||
#
|
||||
# spec file for package postfix (Version 2.5.6)
|
||||
# spec file for package postfix (Version 2.6.1)
|
||||
#
|
||||
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
#
|
||||
@ -17,69 +17,53 @@
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define usetls 1
|
||||
|
||||
Name: postfix
|
||||
#!BuildIgnore: sendmail
|
||||
BuildRequires: db-devel mysql-devel openldap2-devel pcre-devel postgresql-devel
|
||||
# require pwdutils to make postinstall script check work
|
||||
BuildRequires: pwdutils
|
||||
%define usetls 1
|
||||
Url: http://www.postfix.org/
|
||||
Summary: A fast, secure, and flexible mailer
|
||||
Version: 2.6.1
|
||||
Release: 1
|
||||
License: IBM Public License ..
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
Provides: smtp_daemon
|
||||
Conflicts: sendmail exim
|
||||
Url: http://www.postfix.org/
|
||||
AutoReqProv: on
|
||||
Summary: A fast, secure, and flexible mailer
|
||||
Version: 2.5.6
|
||||
Release: 5
|
||||
Source: postfix-%{version}.tar.bz2
|
||||
Source1: postfix-SuSE.tar.gz
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
Source1: %{name}-SuSE.tar.gz
|
||||
Source2: %{name}-mysql.tar.bz2
|
||||
Source10: rpmlintrc
|
||||
Patch: dynamic_maps.patch
|
||||
Patch1: dynamic_maps_pie.patch
|
||||
Patch2: pointer_to_literals.patch
|
||||
Patch3: ipv6_disabled.patch
|
||||
PreReq: /usr/sbin/useradd /usr/sbin/groupadd %insserv_prereq %fillup_prereq /bin/sed /bin/awk /bin/grep textutils sh-utils fileutils pcre openldap2-client netcfg
|
||||
Patch10: %{name}-2.2.9-main.cf.patch
|
||||
Patch11: %{name}-%{version}-vda-ng.patch
|
||||
Patch12: %{name}-%{version}-vda-ng-64bit.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
PreReq: %insserv_prereq %fillup_prereq
|
||||
PreReq: /usr/bin/getent
|
||||
PreReq: /usr/sbin/useradd /usr/sbin/groupadd
|
||||
PreReq: /bin/sed /bin/awk /bin/grep
|
||||
PreReq: textutils sh-utils fileutils pcre openldap2-client netcfg
|
||||
BuildRequires: db-devel
|
||||
BuildRequires: mysql-devel
|
||||
BuildRequires: openldap2-devel pcre-devel postgresql-devel
|
||||
# require pwdutils to make postinstall script check work
|
||||
BuildRequires: pwdutils
|
||||
%if 0%{?suse_version} >= 1100
|
||||
BuildRequires: fdupes
|
||||
%endif
|
||||
#
|
||||
|
||||
%package mysql
|
||||
License: IBM Public License ..
|
||||
Summary: Postfix plugin to support MySQL maps
|
||||
AutoReqProv: on
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
PreReq: %{name} = %{version}
|
||||
#
|
||||
|
||||
%package postgresql
|
||||
License: IBM Public License ..
|
||||
Summary: Postfix plugin to support PostgreSQL maps
|
||||
AutoReqProv: on
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
PreReq: %{name} = %{version}
|
||||
#
|
||||
|
||||
%package devel
|
||||
License: IBM Public License ..
|
||||
Summary: Development headers for the postfix package
|
||||
AutoReqProv: on
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
PreReq: %{name} = %{version}
|
||||
|
||||
%package doc
|
||||
License: IBM Public License ..
|
||||
Summary: Documentations for the postfix package
|
||||
AutoReqProv: on
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
PreReq: %{name} = %{version}
|
||||
Conflicts: sendmail exim
|
||||
Provides: smtp_daemon
|
||||
#
|
||||
# Some defines
|
||||
#
|
||||
%define postfixfiles postfix.filelist
|
||||
%define pf_config_directory /etc/postfix
|
||||
%define pf_daemon_directory /usr/lib/postfix
|
||||
%define pf_docdir %{_docdir}/%{name}-doc
|
||||
%define postfixfiles %{name}.filelist
|
||||
%define pf_config_directory /etc/%{name}
|
||||
%define pf_daemon_directory /usr/lib/%{name}
|
||||
%define pf_command_directory /usr/sbin
|
||||
%define pf_queue_directory var/spool/postfix
|
||||
%define pf_queue_directory var/spool/%{name}
|
||||
%define pf_sendmail_path /usr/sbin/sendmail
|
||||
%define pf_newaliases_path /usr/bin/newaliases
|
||||
%define pf_mailq_path /usr/bin/mailq
|
||||
@ -87,22 +71,102 @@ PreReq: %{name} = %{version}
|
||||
%define pf_readme_directory %{_docdir}/%{name}-doc/README_FILES
|
||||
%define pf_html_directory %{_docdir}/%{name}-doc/html
|
||||
%define pf_sample_directory %{_docdir}/%{name}-doc/samples
|
||||
%define pf_data_directory /var/lib/postfix
|
||||
%define postfix_uid 51
|
||||
%define postfix_gid 51
|
||||
%define pf_data_directory /var/lib/%{name}
|
||||
%define pf_uid 51
|
||||
%define pf_gid 51
|
||||
%define maildrop_gid 59
|
||||
%define conf_backup_dir /var/adm/backup/postfix
|
||||
%define conf_backup_dir /var/adm/backup/%{name}
|
||||
%define omc_pdir /usr/share/omc/
|
||||
%define omc_dir /usr/share/omc/svcinfo.d/
|
||||
#
|
||||
%define vmusr vmail
|
||||
%define vmgid 303
|
||||
%define vmid 303
|
||||
%define vmdir /srv/maildirs
|
||||
#
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%description
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Development headers for the postfix package
|
||||
License: IBM Public License ..
|
||||
Group: Development/Libraries/C and C++
|
||||
AutoReqProv: on
|
||||
PreReq: %{name} = %{version}
|
||||
|
||||
%description devel
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: Documentations for the postfix package
|
||||
License: IBM Public License ..
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
|
||||
%description doc
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
This package contains the documentation for %{name}
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
|
||||
%package mysql
|
||||
Summary: Postfix plugin to support MySQL maps
|
||||
License: IBM Public License ..
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
AutoReqProv: on
|
||||
PreReq: %{name} = %{version}
|
||||
|
||||
%description mysql
|
||||
Postfix plugin to support MySQL maps. This library will be loaded by
|
||||
starting %{name} if you'll access a postmap which is stored in mysql.
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
|
||||
%package postgresql
|
||||
Summary: Postfix plugin to support PostgreSQL maps
|
||||
License: IBM Public License ..
|
||||
Group: Productivity/Networking/Email/Servers
|
||||
AutoReqProv: on
|
||||
PreReq: %{name} = %{version}
|
||||
|
||||
%description postgresql
|
||||
Postfix plugin to support PostgreSQL maps. This library will be loaded
|
||||
by starting %{name} if you'll access a postmap which is stored in
|
||||
PostgreSQL.
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n postfix-%{version} -a 1
|
||||
%patch
|
||||
%setup -n %{name}-%{version} -a 1 -a 2
|
||||
%patch -p1
|
||||
%patch1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch10 -p1
|
||||
%patch11 -p1
|
||||
%ifarch x86_64
|
||||
%patch12 -p1
|
||||
%endif
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%build
|
||||
@ -124,16 +188,16 @@ export PIE=-pie
|
||||
make makefiles DEBUG=""
|
||||
cd lib
|
||||
for i in dns global master tls util milter; do
|
||||
ln -sf lib${i}.a libpostfix-${i}.so.1.0.1;
|
||||
ln -sf lib${i}.a lib%{name}-${i}.so.1.0.1;
|
||||
done
|
||||
cd -
|
||||
make LD_LIBRARY_PATH=$(pwd)/lib:${LD_LIBRARY_PATH}
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%install
|
||||
/usr/sbin/groupadd -g %{postfix_gid} -o -r postfix 2> /dev/null || :
|
||||
/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || :
|
||||
/usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || :
|
||||
/usr/sbin/useradd -r -o -g postfix -u %{postfix_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} postfix 2> /dev/null || :
|
||||
/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || :
|
||||
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
|
||||
install lib/*.1 $RPM_BUILD_ROOT/%{_libdir}
|
||||
for i in $RPM_BUILD_ROOT/%{_libdir}/*.1; do
|
||||
@ -170,17 +234,17 @@ mkdir -p $RPM_BUILD_ROOT/%{_libdir}/sasl2
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/sbin
|
||||
mkdir -p $RPM_BUILD_ROOT/%{conf_backup_dir}
|
||||
mkdir -p $RPM_BUILD_ROOT/%{pf_sample_directory}
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/include/postfix
|
||||
mkdir -p $RPM_BUILD_ROOT/usr/include/%{name}
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
||||
install -m 644 postfix-SuSE/smtp $RPM_BUILD_ROOT/etc/pam.d/smtp
|
||||
install -m 644 %{name}-SuSE/smtp $RPM_BUILD_ROOT/etc/pam.d/smtp
|
||||
#mkdir samples
|
||||
install -m 755 postfix-SuSE/rc.postfix $RPM_BUILD_ROOT/etc/init.d/postfix
|
||||
ln -sf ../etc/init.d/postfix $RPM_BUILD_ROOT/sbin/rcpostfix
|
||||
install -m 755 %{name}-SuSE/rc.%{name} $RPM_BUILD_ROOT/etc/init.d/%{name}
|
||||
ln -sf ../etc/init.d/%{name} $RPM_BUILD_ROOT/sbin/rc%{name}
|
||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||
rm -f $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.postfix
|
||||
sed -e 's;@lib@;%{_lib};g' postfix-SuSE/sysconfig.postfix > $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.postfix
|
||||
install -m 644 postfix-SuSE/sysconfig.mail-postfix $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mail-postfix
|
||||
rm -f $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix
|
||||
rm -f $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
|
||||
sed -e 's;@lib@;%{_lib};g' %{name}-SuSE/sysconfig.%{name} > $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.%{name}
|
||||
install -m 644 %{name}-SuSE/sysconfig.mail-%{name} $RPM_BUILD_ROOT/var/adm/fillup-templates/sysconfig.mail-%{name}
|
||||
rm -f $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name}
|
||||
sed -e 's;@lib@;%{_lib};g' \
|
||||
-e 's;@conf_backup_dir@;%{conf_backup_dir};' \
|
||||
-e 's;@daemon_directory@;%{pf_daemon_directory};' \
|
||||
@ -191,25 +255,27 @@ sed -e 's;@lib@;%{_lib};g' \
|
||||
-e 's;@manpage_directory@;%{_mandir};' \
|
||||
-e 's;@newaliases_path@;%{pf_newaliases_path};' \
|
||||
-e 's;@sample_directory@;%{pf_sample_directory};' \
|
||||
-e 's;@mailq_path@;%{pf_mailq_path};' postfix-SuSE/SuSEconfig.postfix \
|
||||
> $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix
|
||||
chmod 755 $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.postfix
|
||||
install -m 644 postfix-SuSE/master.cf $RPM_BUILD_ROOT/etc/postfix/master.cf
|
||||
install -m 644 postfix-SuSE/dynamicmaps.cf $RPM_BUILD_ROOT/etc/postfix/dynamicmaps.cf
|
||||
install -m 644 postfix-SuSE/permissions $RPM_BUILD_ROOT/etc/permissions.d/postfix
|
||||
install -m 644 postfix-SuSE/sender_canonical $RPM_BUILD_ROOT/etc/postfix/sender_canonical
|
||||
install -m 644 postfix-SuSE/relay_ccerts $RPM_BUILD_ROOT/etc/postfix/relay_ccerts
|
||||
install -m 600 postfix-SuSE/sasl_passwd $RPM_BUILD_ROOT/etc/postfix/sasl_passwd
|
||||
-e 's;@mailq_path@;%{pf_mailq_path};' %{name}-SuSE/SuSEconfig.%{name} \
|
||||
> $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name}
|
||||
chmod 755 $RPM_BUILD_ROOT/sbin/conf.d/SuSEconfig.%{name}
|
||||
install -m 644 %{name}-SuSE/master.cf $RPM_BUILD_ROOT/etc/%{name}/master.cf
|
||||
install -m 644 %{name}-SuSE/dynamicmaps.cf $RPM_BUILD_ROOT/etc/%{name}/dynamicmaps.cf
|
||||
install -m 644 %{name}-SuSE/helo_access $RPM_BUILD_ROOT/etc/postfix/helo_access
|
||||
install -m 644 %{name}-SuSE/permissions $RPM_BUILD_ROOT/etc/permissions.d/%{name}
|
||||
install -m 644 %{name}-SuSE/sender_canonical $RPM_BUILD_ROOT/etc/%{name}/sender_canonical
|
||||
install -m 644 %{name}-SuSE/relay $RPM_BUILD_ROOT/etc/postfix/relay
|
||||
install -m 644 %{name}-SuSE/relay_ccerts $RPM_BUILD_ROOT/etc/%{name}/relay_ccerts
|
||||
install -m 600 %{name}-SuSE/sasl_passwd $RPM_BUILD_ROOT/etc/%{name}/sasl_passwd
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sasl2
|
||||
install -m 600 postfix-SuSE/smtpd.conf $RPM_BUILD_ROOT/etc/sasl2/smtpd.conf
|
||||
install -m 644 postfix-SuSE/openssl_postfix.conf.in $RPM_BUILD_ROOT/etc/postfix/openssl_postfix.conf.in
|
||||
install -m 755 postfix-SuSE/mkpostfixcert $RPM_BUILD_ROOT/usr/sbin/mkpostfixcert
|
||||
install -m 600 %{name}-SuSE/smtpd.conf $RPM_BUILD_ROOT/etc/sasl2/smtpd.conf
|
||||
install -m 644 %{name}-SuSE/openssl_%{name}.conf.in $RPM_BUILD_ROOT/etc/%{name}/openssl_%{name}.conf.in
|
||||
install -m 755 %{name}-SuSE/mk%{name}cert $RPM_BUILD_ROOT/usr/sbin/mk%{name}cert
|
||||
rm -rf $RPM_BUILD_ROOT/%{pf_queue_directory}
|
||||
install -m 644 postfix-SuSE/master.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/master.cf
|
||||
install -m 644 %{name}-SuSE/master.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/master.cf
|
||||
mkdir -p $RPM_BUILD_ROOT/%{omc_dir}
|
||||
install -m 644 postfix-SuSE/postfix.xml $RPM_BUILD_ROOT/%{omc_dir}
|
||||
install -m 644 %{name}-SuSE/%{name}.xml $RPM_BUILD_ROOT/%{omc_dir}
|
||||
mkdir -p $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/
|
||||
install -m 644 postfix-SuSE/postfix-fw $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/postfix
|
||||
install -m 644 %{name}-SuSE/%{name}-fw $RPM_BUILD_ROOT/etc/sysconfig/SuSEfirewall2.d/services/%{name}
|
||||
{
|
||||
cat<<EOF
|
||||
#
|
||||
@ -222,8 +288,8 @@ cat<<EOF
|
||||
#
|
||||
EOF
|
||||
cat conf/main.cf
|
||||
} > $RPM_BUILD_ROOT/etc/postfix/main.cf
|
||||
$RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/postfix \
|
||||
} > $RPM_BUILD_ROOT/etc/%{name}/main.cf
|
||||
$RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/%{name} \
|
||||
-e "manpage_directory = %{_mandir}" \
|
||||
"setgid_group = %{pf_setgid_group}" \
|
||||
"mailq_path = %{pf_mailq_path}" \
|
||||
@ -235,7 +301,7 @@ $RPM_BUILD_ROOT/usr/sbin/postconf -c $RPM_BUILD_ROOT/etc/postfix \
|
||||
"daemon_directory = %{pf_daemon_directory}" \
|
||||
"biff = no" \
|
||||
"inet_protocols = all"
|
||||
install -m 644 $RPM_BUILD_ROOT/etc/postfix/main.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/main.cf
|
||||
install -m 644 $RPM_BUILD_ROOT/etc/%{name}/main.cf $RPM_BUILD_ROOT/%{conf_backup_dir}/main.cf
|
||||
# -----------------------------------------------------------------------
|
||||
# preparing /etc/postfix/postfix-files to be able to use postfix
|
||||
# own upgrade script. Unfortunately it looks in postfix-files and
|
||||
@ -244,17 +310,17 @@ install -m 644 $RPM_BUILD_ROOT/etc/postfix/main.cf $RPM_BUILD_ROOT/%{conf_backup
|
||||
# also remove the both sql dictionary libs as they will not be installed
|
||||
# per default
|
||||
# -----------------------------------------------------------------------
|
||||
rm -f $RPM_BUILD_ROOT/etc/postfix/aliases
|
||||
rm -f $RPM_BUILD_ROOT/etc/postfix/postfix-files
|
||||
sed 's;^$config_directory/aliases\(.*\);/etc/aliases\1;' conf/postfix-files \
|
||||
| grep -v '^$manpage_directory' | grep -Ev 'dict_(mysql|pgsql)' > $RPM_BUILD_ROOT/etc/postfix/postfix-files
|
||||
rm -f $RPM_BUILD_ROOT/etc/%{name}/aliases
|
||||
rm -f $RPM_BUILD_ROOT/etc/%{name}/%{name}-files
|
||||
sed 's;^$config_directory/aliases\(.*\);/etc/aliases\1;' conf/%{name}-files \
|
||||
| grep -v '^$manpage_directory' | grep -Ev 'dict_(mysql|pgsql)' > $RPM_BUILD_ROOT/etc/%{name}/%{name}-files
|
||||
rm -f %{postfixfiles}
|
||||
test -f conf/postfix-files || {
|
||||
echo "conf/postfix-files does not exist!"
|
||||
test -f conf/%{name}-files || {
|
||||
echo "conf/%{name}-files does not exist!"
|
||||
exit 1
|
||||
}
|
||||
echo "%defattr(-,root,root)" >> %{postfixfiles}
|
||||
exec <conf/postfix-files
|
||||
exec <conf/%{name}-files
|
||||
while IFS=: read path type owner group mode flags junk; do
|
||||
owner=${owner/\$mail_owner/postfix}
|
||||
group=${group/\$setgid_group/%{pf_setgid_group}}
|
||||
@ -264,72 +330,99 @@ while IFS=: read path type owner group mode flags junk; do
|
||||
group=${group/-/root}
|
||||
echo "%dir %attr($mode,$owner,$group) $path/" >> %{postfixfiles}
|
||||
mkdir -m $mode -p $RPM_BUILD_ROOT/$path
|
||||
printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/postfix
|
||||
printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}
|
||||
;;
|
||||
\$command_directory/*)
|
||||
path=${path/\$command_directory/\/usr\/sbin}
|
||||
group=${group/-/root}
|
||||
echo "%attr($mode,$owner,$group) $path" >> %{postfixfiles}
|
||||
printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/postfix
|
||||
printf '%%-38s %%-18s %%04d\n' $path "${owner}.${group}" $mode >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}
|
||||
;;
|
||||
*) continue;;
|
||||
esac
|
||||
done
|
||||
# postfix-mysql
|
||||
install -m 644 %{name}-mysql/main.cf-mysql $RPM_BUILD_ROOT/etc/%{name}/main.cf-mysql
|
||||
install -m 640 %{name}-mysql/*_maps.cf $RPM_BUILD_ROOT/etc/%{name}/
|
||||
# create paranoid permissions file
|
||||
printf '%%-38s %%-18s %%s\n' /usr/sbin/postdrop "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/postfix.paranoid
|
||||
printf '%%-38s %%-18s %%s\n' /usr/sbin/postqueue "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/postfix.paranoid
|
||||
install -m 644 include/*.h $RPM_BUILD_ROOT/usr/include/postfix/
|
||||
printf '%%-38s %%-18s %%s\n' /usr/sbin/postdrop "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid
|
||||
printf '%%-38s %%-18s %%s\n' /usr/sbin/postqueue "root.%{pf_setgid_group}" "0755" >> $RPM_BUILD_ROOT/etc/permissions.d/%{name}.paranoid
|
||||
install -m 644 include/*.h $RPM_BUILD_ROOT/usr/include/%{name}/
|
||||
# some rpmlint stuff
|
||||
# remove unneeded examples/chroot-setup
|
||||
for example in AIX42 BSDI* F* HPUX* IRIX* NETBSD1 NEXTSTEP3 OPENSTEP4 OSF1 Solaris*; do
|
||||
%{__rm} examples/chroot-setup/${example}
|
||||
done
|
||||
# files-duplicate /usr/share/doc/packages/postfix-doc/html/
|
||||
# so we copy all docs to a postfix-doc to do fdupes :)
|
||||
%{__install} -d $RPM_BUILD_ROOT%{pf_docdir}/html
|
||||
for doc in AAAREADME COMPATIBILITY COPYRIGHT HISTORY INSTALL IPv6-ChangeLog LICENSE PORTING RELEASE_NOTES* US_PATENT_6321267 TLS_LICENSE README_FILES auxiliary examples html %{name}-SuSE/README.SuSE %{name}-SuSE/SPAMASSASSIN+POSTFIX.SuSE; do
|
||||
%{__cp} -rv ${doc} $RPM_BUILD_ROOT%{pf_docdir}/
|
||||
done
|
||||
%if 0%{?suse_version} >= 1100
|
||||
%fdupes $RPM_BUILD_ROOT%{pf_docdir}
|
||||
# files-duplicate /usr/share/man/man?
|
||||
%fdupes $RPM_BUILD_ROOT%{_mandir}
|
||||
%endif
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%pre
|
||||
VERSIONTEST=$(test -x usr/sbin/postconf && usr/sbin/postconf proxy_read_maps 2>/dev/null)
|
||||
if [ -z "$VERSIONTEST" -a -f %{pf_queue_directory}/pid/master.pid ]; then
|
||||
if checkproc -p %{pf_queue_directory}/pid/master.pid usr/lib/postfix/master; then
|
||||
echo "postfix is still running. You have to stop postfix in order to"
|
||||
if checkproc -p %{pf_queue_directory}/pid/master.pid usr/lib/%{name}/master; then
|
||||
echo "%{name} is still running. You have to stop %{name} in order to"
|
||||
echo "install a newer version."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
/usr/sbin/groupadd -g %{postfix_gid} -o -r postfix 2> /dev/null || :
|
||||
/usr/sbin/groupadd -g %{pf_gid} -o -r %{name} 2> /dev/null || :
|
||||
/usr/sbin/groupadd -g %{maildrop_gid} -o -r maildrop 2> /dev/null || :
|
||||
/usr/sbin/useradd -r -o -g postfix -u %{postfix_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} postfix 2> /dev/null || :
|
||||
/usr/sbin/useradd -r -o -g %{name} -u %{pf_uid} -s /bin/false -c "Postfix Daemon" -d /%{pf_queue_directory} %{name} 2> /dev/null || :
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%pre mysql
|
||||
#echo "PARAM_pre: "$1
|
||||
# on `rpm -ivh` PARAM is 1
|
||||
# on `rpm -Uvh` PARAM is 2
|
||||
if [ "$1" = "1" ]; then
|
||||
echo "Adding %{vmusr} user"
|
||||
if [ -z "`%{_bindir}/getent group %{vmusr} 2>/dev/null`" ]; then
|
||||
%{_sbindir}/groupadd -r -g %{vmgid} %{vmusr}
|
||||
fi
|
||||
if [ -z "`%{_bindir}/getent passwd %{vmusr} 2>/dev/null`" ]; then
|
||||
%{_sbindir}/useradd -c "maildirs chef" -d %{vmdir} -g %{vmusr} -u %{vmid} -r -s /bin/false %{vmusr}
|
||||
fi
|
||||
fi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%preun
|
||||
%stop_on_removal postfix
|
||||
%stop_on_removal %{name}
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%post
|
||||
%{fillup_and_insserv -y postfix}
|
||||
# We never have to run suseconfig for postfix after installation
|
||||
# We only start postfix own upgrade-configuration by update
|
||||
if [ ${1:-0} -gt 1 ]; then
|
||||
echo "executing upgrade-configuration"
|
||||
/usr/sbin/postfix set-permissions upgrade-configuration setgid_group=%{pf_setgid_group}
|
||||
fi
|
||||
|
||||
%postun
|
||||
%restart_on_update postfix
|
||||
%insserv_cleanup
|
||||
ldconfig
|
||||
|
||||
%clean
|
||||
#rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%post postgresql
|
||||
FILE=etc/postfix/dynamicmaps.cf
|
||||
if ! grep -q "^pgsql[[:space:]]" ${FILE}; then
|
||||
echo "Adding pgsql map entry to ${FILE}"
|
||||
echo "pgsql /usr/lib/postfix/dict_pgsql.so dict_pgsql_open" >> ${FILE}
|
||||
fi
|
||||
|
||||
%post mysql
|
||||
FILE=etc/postfix/dynamicmaps.cf
|
||||
if ! grep -q "^mysql[[:space:]]" ${FILE}; then
|
||||
echo "Adding mysql map entry to ${FILE}"
|
||||
echo "mysql /usr/lib/postfix/dict_mysql.so dict_mysql_open" >> ${FILE}
|
||||
%preun mysql
|
||||
#echo "PARAM_preun: "$1
|
||||
# on `rpm -e` PARAM is 0
|
||||
if [ "$1" = "0" ]; then
|
||||
FILE=etc/%{name}/dynamicmaps.cf
|
||||
if [ -e "$FILE" ] ; then
|
||||
if grep -q "^mysql[[:space:]]" ${FILE}; then
|
||||
echo "Removing mysql map entry from ${FILE}"
|
||||
sed "/^mysql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \
|
||||
cp --remove-destination ${FILE}.$$ ${FILE} && \
|
||||
rm ${FILE}.$$
|
||||
fi
|
||||
else
|
||||
echo "Can not find \"$FILE\". Not updating the file." >&2
|
||||
fi
|
||||
echo "Removing %{vmusr} user"
|
||||
userdel %{vmusr} 2> /dev/null
|
||||
groupdel %{vmusr} 2> /dev/null
|
||||
fi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%preun postgresql
|
||||
if [ "$1" = 0 ] ; then
|
||||
FILE=etc/postfix/dynamicmaps.cf
|
||||
FILE=etc/%{name}/dynamicmaps.cf
|
||||
if [ -e "$FILE" ] ; then
|
||||
if grep -q "^pgsql[[:space:]]" ${FILE}; then
|
||||
echo "Removing pgsql map entry from ${FILE}"
|
||||
@ -341,150 +434,127 @@ if [ "$1" = 0 ] ; then
|
||||
echo "Can not find \"$FILE\". Not updating the file." >&2
|
||||
fi
|
||||
fi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%preun mysql
|
||||
if [ "$1" = 0 ] ; then
|
||||
FILE=etc/postfix/dynamicmaps.cf
|
||||
if [ -e "$FILE" ] ; then
|
||||
if grep -q "^mysql[[:space:]]" ${FILE}; then
|
||||
echo "Removing mysql map entry from ${FILE}"
|
||||
sed "/^mysql[[:space:]]/d" ${FILE} > ${FILE}.$$ && \
|
||||
cp --remove-destination ${FILE}.$$ ${FILE} && \
|
||||
rm ${FILE}.$$
|
||||
fi
|
||||
else
|
||||
echo "Can not find \"$FILE\". Not updating the file." >&2
|
||||
fi
|
||||
%post
|
||||
%{fillup_and_insserv -y postfix}
|
||||
# We never have to run suseconfig for postfix after installation
|
||||
# We only start postfix own upgrade-configuration by update
|
||||
if [ ${1:-0} -gt 1 ]; then
|
||||
echo "executing upgrade-configuration"
|
||||
/usr/sbin/%{name} set-permissions upgrade-configuration setgid_group=%{pf_setgid_group}
|
||||
#New map in 11.2 #TODO remove it later
|
||||
. /etc/sysconfig/postfix
|
||||
sed -i "s/^POSTFIX_MAP_LIST=.*/POSTFIX_MAP_LIST=\"$POSTFIX_MAP_LIST relay\"/" /etc/sysconfig/postfix
|
||||
fi
|
||||
ldconfig
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files postgresql
|
||||
%defattr(-,root,root)
|
||||
/usr/lib/postfix/dict_pgsql.so
|
||||
%postun
|
||||
%restart_on_update %{name}
|
||||
%insserv_cleanup
|
||||
ldconfig
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files mysql
|
||||
%defattr(-,root,root)
|
||||
/usr/lib/postfix/dict_mysql.so
|
||||
%post postgresql
|
||||
FILE=etc/%{name}/dynamicmaps.cf
|
||||
if ! grep -q "^pgsql[[:space:]]" ${FILE}; then
|
||||
echo "Adding pgsql map entry to ${FILE}"
|
||||
echo "pgsql /usr/lib/%{name}/dict_pgsql.so dict_pgsql_open" >> ${FILE}
|
||||
fi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
/usr/include/postfix/
|
||||
%post mysql
|
||||
FILE=etc/%{name}/dynamicmaps.cf
|
||||
if ! grep -q "^mysql[[:space:]]" ${FILE}; then
|
||||
echo "Adding mysql map entry to ${FILE}"
|
||||
echo "mysql /usr/lib/%{name}/dict_mysql.so dict_mysql_open" >> ${FILE}
|
||||
fi
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
%files doc
|
||||
%defattr(-,root,root)
|
||||
%doc AAAREADME COMPATIBILITY COPYRIGHT HISTORY INSTALL IPv6-ChangeLog LICENSE
|
||||
%doc PORTING RELEASE_NOTES* US_PATENT_6321267 TLS_LICENSE
|
||||
%doc README_FILES examples html auxiliary
|
||||
%doc postfix-SuSE/README.SuSE
|
||||
%doc postfix-SuSE/SPAMASSASSIN+POSTFIX.SuSE
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files -f %{postfixfiles}
|
||||
%defattr(-,root,root)
|
||||
%config /etc/pam.d/*
|
||||
/var/adm/fillup-templates/sysconfig.postfix
|
||||
/var/adm/fillup-templates/sysconfig.mail-postfix
|
||||
/sbin/conf.d/SuSEconfig.postfix
|
||||
%config(noreplace) %{omc_dir}/postfix.xml
|
||||
%dir /etc/postfix
|
||||
%config(noreplace) /etc/postfix/access
|
||||
%config(noreplace) /etc/postfix/generic
|
||||
%config(noreplace) /etc/postfix/canonical
|
||||
#%config(noreplace) /etc/postfix/cidr_table
|
||||
%config(noreplace) /etc/postfix/main.cf
|
||||
%config /etc/postfix/main.cf.default
|
||||
%config(noreplace) /etc/postfix/master.cf
|
||||
%config(noreplace) /etc/postfix/openssl_postfix.conf.in
|
||||
%config(noreplace) /etc/postfix/relocated
|
||||
%config(noreplace) /etc/postfix/transport
|
||||
%config(noreplace) /etc/postfix/virtual
|
||||
%config(noreplace) /etc/postfix/sasl_passwd
|
||||
%config(noreplace) /etc/postfix/sender_canonical
|
||||
#%config(noreplace) /etc/postfix/tcp_table
|
||||
#%config(noreplace) /etc/postfix/pcre_table
|
||||
#%config(noreplace) /etc/postfix/regexp_table
|
||||
%config(noreplace) /etc/postfix/relay_ccerts
|
||||
%config(noreplace) /etc/postfix/header_checks
|
||||
%config(noreplace) /etc/postfix/bounce.cf.default
|
||||
%config(noreplace) /etc/postfix/dynamicmaps.cf
|
||||
%config /etc/sysconfig/SuSEfirewall2.d/services/postfix
|
||||
/var/adm/fillup-templates/sysconfig.%{name}
|
||||
/var/adm/fillup-templates/sysconfig.mail-%{name}
|
||||
/sbin/conf.d/SuSEconfig.%{name}
|
||||
%config(noreplace) %{omc_dir}/%{name}.xml
|
||||
%dir /etc/%{name}
|
||||
%config(noreplace) /etc/%{name}/access
|
||||
%config(noreplace) /etc/%{name}/generic
|
||||
%config(noreplace) /etc/%{name}/helo_access
|
||||
%config(noreplace) /etc/%{name}/canonical
|
||||
#%config(noreplace) /etc/%{name}/cidr_table
|
||||
%config(noreplace) /etc/%{name}/main.cf
|
||||
%config /etc/%{name}/main.cf.default
|
||||
%config(noreplace) /etc/%{name}/master.cf
|
||||
%config(noreplace) /etc/%{name}/openssl_%{name}.conf.in
|
||||
%config(noreplace) /etc/%{name}/relocated
|
||||
%config(noreplace) /etc/%{name}/transport
|
||||
%config(noreplace) /etc/%{name}/virtual
|
||||
%config(noreplace) /etc/%{name}/sasl_passwd
|
||||
%config(noreplace) /etc/%{name}/sender_canonical
|
||||
#%config(noreplace) /etc/%{name}/tcp_table
|
||||
#%config(noreplace) /etc/%{name}/pcre_table
|
||||
#%config(noreplace) /etc/%{name}/regexp_table
|
||||
%config(noreplace) /etc/%{name}/relay
|
||||
%config(noreplace) /etc/%{name}/relay_ccerts
|
||||
%config(noreplace) /etc/%{name}/header_checks
|
||||
%config(noreplace) /etc/%{name}/bounce.cf.default
|
||||
%config(noreplace) /etc/%{name}/dynamicmaps.cf
|
||||
%config /etc/sysconfig/SuSEfirewall2.d/services/%{name}
|
||||
%dir /etc/sasl2/
|
||||
%config(noreplace) /etc/sasl2/smtpd.conf
|
||||
%config /etc/postfix/LICENSE
|
||||
%config /etc/%{name}/LICENSE
|
||||
%if %{usetls}
|
||||
%config /etc/postfix/TLS_LICENSE
|
||||
%config /etc/%{name}/TLS_LICENSE
|
||||
%endif
|
||||
%config /etc/permissions.d/postfix
|
||||
%config /etc/permissions.d/postfix.paranoid
|
||||
%attr(0644, root, root) /etc/postfix/makedefs.out
|
||||
%attr(0755, root, root) /etc/postfix/postfix-script
|
||||
%attr(0755, root, root) /etc/postfix/post-install
|
||||
%attr(0644, root, root) /etc/postfix/postfix-files
|
||||
%config %attr(0755,root,root) /etc/init.d/postfix
|
||||
%config /etc/permissions.d/%{name}
|
||||
%config /etc/permissions.d/%{name}.paranoid
|
||||
%attr(0644, root, root) %config /etc/%{name}/makedefs.out
|
||||
%attr(0644, root, root) %config /etc/%{name}/%{name}-files
|
||||
/usr/lib/%{name}/%{name}-files
|
||||
%config %attr(0755,root,root) /etc/init.d/%{name}
|
||||
/usr/bin/mailq
|
||||
/usr/bin/newaliases
|
||||
%attr(0755, root, root) /usr/sbin/sendmail
|
||||
/usr/sbin/qmqp-source
|
||||
/usr/sbin/smtp-sink
|
||||
/usr/sbin/smtp-source
|
||||
/usr/sbin/mkpostfixcert
|
||||
/sbin/rcpostfix
|
||||
/usr/sbin/mk%{name}cert
|
||||
/sbin/rc%{name}
|
||||
%{_libdir}/lib*
|
||||
/usr/lib/sendmail
|
||||
%dir /usr/lib/postfix
|
||||
/usr/lib/postfix/*[^.so]
|
||||
/usr/lib/postfix/dict_ldap.so
|
||||
/usr/lib/postfix/dict_pcre.so
|
||||
/usr/lib/postfix/dict_tcp.so
|
||||
%dir /usr/lib/%{name}
|
||||
/usr/lib/%{name}/*[^.so]
|
||||
/usr/lib/%{name}/dict_ldap.so
|
||||
/usr/lib/%{name}/dict_pcre.so
|
||||
/usr/lib/%{name}/dict_tcp.so
|
||||
%{conf_backup_dir}
|
||||
%dir %attr(0700,postfix,root) %{pf_data_directory}
|
||||
%dir %attr(0700,%{name},root) %{pf_data_directory}
|
||||
%{_mandir}/man?/*.gz
|
||||
|
||||
%description
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
/usr/include/%{name}/
|
||||
|
||||
%files doc
|
||||
%defattr(0644,root,root,0755)
|
||||
%dir %{pf_docdir}/
|
||||
%{pf_docdir}/
|
||||
|
||||
%files mysql
|
||||
%defattr(-,root,root)
|
||||
%doc %{name}-mysql/%{name}-mysql.sql
|
||||
%config(noreplace) %attr(640, root, %{name}) /etc/%{name}/*_maps.cf
|
||||
%config(noreplace) /etc/%{name}/main.cf-mysql
|
||||
/usr/lib/%{name}/dict_mysql.so
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
%description mysql
|
||||
Postfix plugin to support MySQL maps. This library will be loaded by
|
||||
starting postfix if you'll access a postmap which is stored in mysql.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
%description postgresql
|
||||
Postfix plugin to support PostgreSQL maps. This library will be loaded
|
||||
by starting postfix if you'll access a postmap which is stored in
|
||||
PostgreSQL.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
%description devel
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
|
||||
%description doc
|
||||
Postfix aims to be an alternative to the widely-used sendmail program.
|
||||
This package contains the documentation for postfix
|
||||
|
||||
|
||||
|
||||
Authors:
|
||||
--------
|
||||
Wietse Venema <wietse@porcupine.org>
|
||||
%files postgresql
|
||||
%defattr(-,root,root)
|
||||
/usr/lib/%{name}/dict_pgsql.so
|
||||
|
||||
%changelog
|
||||
|
4
rpmlintrc
Normal file
4
rpmlintrc
Normal file
@ -0,0 +1,4 @@
|
||||
addFilter("executable-sourced-script .*/sbin/conf.d/SuSEconfig.postfix")
|
||||
addFilter("sourced-script-with-shebang .*/sbin/conf.d/SuSEconfig.postfix")
|
||||
addFilter("devel-file-in-non-devel-package .*/usr/lib/libpostfix*.so")
|
||||
addFilter("devel-file-in-non-devel-package .*/usr/lib64/libpostfix*.so")
|
Loading…
Reference in New Issue
Block a user