View | Details | Raw Unified | Return to bug 134728 | Differences between
and this patch

Collapse All | Expand All

(-)postfix/Makefile (-50 / +72 lines)
Lines 7-12 Link Here
7
7
8
PORTNAME=	postfix
8
PORTNAME=	postfix
9
PORTVERSION=	2.6.0
9
PORTVERSION=	2.6.0
10
PORTREVISION=	1
10
PORTEPOCH=	1
11
PORTEPOCH=	1
11
CATEGORIES=	mail ipv6
12
CATEGORIES=	mail ipv6
12
MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
13
MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
Lines 76-83 Link Here
76
	bounce.8 trace.8 \
77
	bounce.8 trace.8 \
77
	smtp.8 lmtp.8
78
	smtp.8 lmtp.8
78
79
79
CONF1=	access aliases canonical generic header_checks main.cf master.cf \
80
PORTEXAMPLES=	access aliases canonical generic header_checks \
80
	relocated transport virtual
81
		main.cf master.cf relocated transport virtual
81
82
82
.if !defined(DEBUG)
83
.if !defined(DEBUG)
83
MAKEFILEFLAGS+=	DEBUG=
84
MAKEFILEFLAGS+=	DEBUG=
Lines 85-98 Link Here
85
86
86
MAKEFILEFLAGS+=	CC="${CC}" OPT="${CFLAGS}"
87
MAKEFILEFLAGS+=	CC="${CC}" OPT="${CFLAGS}"
87
88
88
SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
89
		TOUCH="${TOUCH}" \
90
		MKDIR="${MKDIR}"
91
92
.include <bsd.port.pre.mk>
89
.include <bsd.port.pre.mk>
93
90
91
POSTFIX_CCARGS+=	-DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \
92
			-DDEF_SAMPLE_DIR=\\\"${EXAMPLESDIR}\\\" \
93
			-DDEF_DAEMON_DIR=\\\"${PREFIX}/libexec/postfix\\\" \
94
			-DDEF_COMMAND_DIR=\\\"${PREFIX}/sbin\\\" \
95
			-DDEF_SENDMAIL_PATH=\\\"${PREFIX}/sbin/sendmail\\\" \
96
			-DDEF_NEWALIAS_PATH=\\\"${PREFIX}/bin/newaliases\\\" \
97
			-DDEF_MAILQ_PATH=\\\"${PREFIX}/bin/mailq\\\" \
98
			-DDEF_MANPAGE_DIR=\\\"${MANPREFIX}/man\\\" \
99
			-DDEF_README_DIR=\\\"${READMEDIR}\\\" \
100
			-DDEF_HTML_DIR=\\\"${READMEDIR}\\\" \
101
			-DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" \
102
			-DDEF_DATA_DIR=\\\"/var/db/postfix\\\" \
103
			-DDEF_MAIL_OWNER=\\\"postfix\\\" \
104
			-DDEF_SGID_GROUP=\\\"maildrop\\\" \
105
			-DALIAS_DB_MAP=\\\"hash:/etc/mail/aliases\\\"
106
94
# Default requirement for postfix rc script
107
# Default requirement for postfix rc script
95
_REQUIRE=	LOGIN cleanvar
108
_REQUIRE=		LOGIN cleanvar
96
109
97
.if defined(WITH_PCRE)
110
.if defined(WITH_PCRE)
98
LIB_DEPENDS+=		pcre.0:${PORTSDIR}/devel/pcre
111
LIB_DEPENDS+=		pcre.0:${PORTSDIR}/devel/pcre
Lines 111-116 Link Here
111
.if defined(WITH_DOVECOT)
124
.if defined(WITH_DOVECOT)
112
RUN_DEPENDS+=		dovecot:${PORTSDIR}/mail/dovecot
125
RUN_DEPENDS+=		dovecot:${PORTSDIR}/mail/dovecot
113
POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"
126
POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"
127
_REQUIRE+=		dovecot
114
.endif
128
.endif
115
129
116
.if defined(WITH_SASLKRB)
130
.if defined(WITH_SASLKRB)
Lines 185-210 Link Here
185
.if defined(WITH_VDA)
199
.if defined(WITH_VDA)
186
IGNORE=			wait for a new VDA patch that works with 2.6.0
200
IGNORE=			wait for a new VDA patch that works with 2.6.0
187
PATCH_SITES+=		http://vda.sourceforge.net/VDA/
201
PATCH_SITES+=		http://vda.sourceforge.net/VDA/
188
PATCHFILES+=		postfix-2.5.6-vda-ng.patch.gz
202
PATCHFILES+=		postfix-${PORTVERSION}-vda-ng.patch.gz
189
PATCH_DIST_STRIP=	-p1
203
PATCH_DIST_STRIP=	-p1
204
PLIST_SUB+=	VDA=""
205
.else
206
PLIST_SUB+=	VDA="@comment "
190
.endif
207
.endif
191
208
192
.if defined(WITH_TEST)
209
.if defined(WITH_TEST)
193
BINTEST=	qmqp-sink qmqp-source smtp-sink smtp-source
210
BINTEST=	qmqp-sink qmqp-source smtp-sink smtp-source
194
MANTEST=	qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1
211
MANTEST=	qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1
195
MAN1+=		${MANTEST}
212
MAN1+=		${MANTEST}
196
PLIST_SUB+=	SUB_TEST=""
213
PLIST_SUB+=	TEST=""
197
.else
214
.else
198
PLIST_SUB+=	SUB_TEST="@comment "
215
PLIST_SUB+=	TEST="@comment "
199
.endif
216
.endif
200
217
201
.if defined(NOPORTDOCS)
218
.if defined(NOPORTDOCS)
202
READMEDIR=no
219
READMEDIR=no
203
.else
220
.else
204
READMEDIR=${PREFIX}/share/doc/postfix
221
READMEDIR=${DOCSDIR}
205
.endif
222
.endif
206
223
207
SUB_LIST+=	REQUIRE="${_REQUIRE}"
224
SUB_LIST+=	REQUIRE="${_REQUIRE}" READMEDIR="${READMEDIR}"
225
SUB_FILES+=	pkg-install pkg-message
226
227
# sed script for files in ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man
228
REINPLACE=	s!^PATH=.*!PATH=/bin:/sbin:/usr/bin:/usr/sbin:${PREFIX}/bin:${PREFIX}/sbin!;\
229
		s!(_directory = )/usr/!\1${PREFIX}/!g;\
230
		s!^(data_directory = /var/)lib/!\1db/!g;\
231
		s!^\#(mynetworks_style = host)!\1!g;\
232
		s!^(sendmail_path =)!\1 ${PREFIX}/sbin/sendmail!g;\
233
		s!^(newaliases_path =)!\1 ${PREFIX}/bin/newaliases!g;\
234
		s!^(mailq_path =)!\1 ${PREFIX}/bin/mailq!g;\
235
		s!^(setgid_group =)!\1 maildrop!g;\
236
		s!^(manpage_directory =)!\1 ${PREFIX}/man!g;\
237
		s!^(sample_directory =)!\1 ${EXAMPLESDIR}!g;\
238
		s!^((html|readme)_directory =)!\1 ${READMEDIR}!g;\
239
		\!^\#alias_database = dbm:/etc/mail/aliases$$!d;\
240
		s!/etc/aliases!/etc/mail/aliases!g;\
241
		s!(:|= )/etc/postfix!\1$$config_directory!g;\
242
		s!/etc/postfix!${ETCDIR}!g;
208
243
209
pre-patch:
244
pre-patch:
210
.if defined(POSTFIX_OPTIONS)
245
.if defined(POSTFIX_OPTIONS)
Lines 233-252 Link Here
233
	fi
268
	fi
234
.endif
269
.endif
235
270
236
	@${ECHO} "<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>" \
271
	@${ECHO} '<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>' \
237
		> ${WRKSRC}/html/body_checks.5.html
272
		> ${WRKSRC}/html/body_checks.5.html
238
	@${FIND} -P ${WRKSRC}/man -type f | ${XARGS} \
273
	@${REINPLACE_CMD} -E -e 's![[:<:]]perl[[:>:]]!${PERL}!' \
239
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
274
		${WRKSRC}/src/bounce/Makefile.in
240
	@${FIND} -P ${WRKSRC}/README_FILES -type f | ${XARGS} \
275
	@${REINPLACE_CMD} -E -e 's!^(#define DEF_SGID_GROUP[^"]+)"postdrop"$$!\1"maildrop"!' \
241
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
276
		${WRKSRC}/src/global/mail_params.h
242
	@${FIND} -P ${WRKSRC}/conf -type f | ${XARGS} \
277
	@${FIND} -X ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man \
243
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
278
		-type f -a ! \( -name INSTALL -o -name aliases \) | ${XARGS} \
279
		${REINPLACE_CMD} -E -e '${REINPLACE}'
244
280
245
post-patch:
281
post-patch:
246
# All files modified with ${FILESDIR}/patch-* to use !!PREFIX!! need REINPLACE. Put below.
282
.if defined(WITH_VDA)
247
	@${REINPLACE_CMD} -e "s,!!PREFIX!!,${PREFIX},g" \
283
	@${ECHO} '$$readme_directory/VDA_README:f:root:-:644' \
248
		${WRKSRC}/conf/main.cf ${WRKSRC}/src/global/mail_params.h
284
		>> ${WRKSRC}/conf/postfix-files
249
	@${REINPLACE_CMD} -e "s|perl|${PERL}|" ${WRKSRC}/src/bounce/Makefile.in
285
	@${REINPLACE_CMD} -E -e '${REINPLACE}' \
286
		${WRKSRC}/README_FILES/VDA_README
287
.endif
250
288
251
do-configure:
289
do-configure:
252
	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
290
	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
Lines 257-305 Link Here
257
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
295
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
258
296
259
do-install:
297
do-install:
260
	cd ${WRKSRC}; ${SH} postfix-install -non-interactive install_root=/ tempdir=/tmp \
298
	@cd ${WRKSRC} && ${SH} postfix-install -non-interactive install_root=/ tempdir=/tmp
261
		config_directory=${PREFIX}/etc/postfix \
262
		data_directory=/var/db/postfix \
263
		daemon_directory=${PREFIX}/libexec/postfix \
264
		command_directory=${PREFIX}/sbin \
265
		queue_directory=/var/spool/postfix \
266
		sendmail_path=${PREFIX}/sbin/sendmail \
267
		newaliases_path=${PREFIX}/bin/newaliases \
268
		mailq_path=${PREFIX}/bin/mailq \
269
		mail_owner=postfix \
270
		setgid_group=maildrop \
271
		manpage_directory=${MANPREFIX}/man \
272
		sample_directory=${PREFIX}/etc/postfix \
273
		readme_directory=${READMEDIR}
274
275
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${PREFIX}/bin/rmail
299
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${PREFIX}/bin/rmail
276
277
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape
300
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape
278
	${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MANPREFIX}/man/man1
301
	${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MANPREFIX}/man/man1
279
280
.for f in ${BINTEST}
302
.for f in ${BINTEST}
281
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin
303
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin
282
.endfor
304
.endfor
283
.for f in ${MANTEST}
305
.for f in ${MANTEST}
284
	${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MANPREFIX}/man/man1
306
	${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MANPREFIX}/man/man1
285
.endfor
307
.endfor
286
287
	@${MKDIR} ${PREFIX}/etc/postfix/dist
288
.for f in ${CONF1}
289
	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${PREFIX}/etc/postfix/dist
290
.endfor
291
292
.if !defined(NOPORTDOCS)
308
.if !defined(NOPORTDOCS)
293
	${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCSDIR}
309
	${INSTALL} -o ${DOCOWN} -g ${DOCGRP} -m 555 -d ${DOCSDIR}
294
	@cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.jpg *.png ${DOCSDIR} && \
310
	@cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.jpg *.png ${DOCSDIR} && \
295
		${ECHO_MSG} "Installed HTML documentation in ${DOCSDIR}"
311
		${ECHO_MSG} "Installed HTML documentation in ${DOCSDIR}"
296
.endif
312
.endif
313
.if !defined(NOPORTEXAMPLES)
314
	${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m 555 -d ${EXAMPLESDIR}
315
.for f in ${PORTEXAMPLES}
316
	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${EXAMPLESDIR}
317
.endfor
318
	@${ECHO_MSG} "Installed configuration examples in ${EXAMPLESDIR}"
319
.endif
297
320
298
post-install:
321
post-install:
299
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
322
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
300
# Fix compressed man pages
323
	# Fix compressed man pages
301
	@${REINPLACE_CMD} -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${PREFIX}/libexec/postfix/postfix-files
324
	@${REINPLACE_CMD} -i '' -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${PREFIX}/libexec/postfix/postfix-files
302
	@${RM} -f ${PREFIX}/libexec/postfix/postfix-files.bak
303
	@${CAT} ${PKGMESSAGE}
325
	@${CAT} ${PKGMESSAGE}
304
326
305
.include <bsd.port.post.mk>
327
.include <bsd.port.post.mk>
(-)postfix/files/patch-conf::main.cf (-80 lines)
Lines 1-80 Link Here
1
--- conf/main.cf.orig	2007-12-18 11:50:25.000000000 -0200
2
+++ conf/main.cf	2008-02-29 22:35:12.000000000 -0300
3
@@ -33,19 +33,19 @@
4
 # The command_directory parameter specifies the location of all
5
 # postXXX commands.
6
 #
7
-command_directory = /usr/sbin
8
+command_directory = !!PREFIX!!/sbin
9
 
10
 # The daemon_directory parameter specifies the location of all Postfix
11
 # daemon programs (i.e. programs listed in the master.cf file). This
12
 # directory must be owned by root.
13
 #
14
-daemon_directory = /usr/libexec/postfix
15
+daemon_directory = !!PREFIX!!/libexec/postfix
16
 
17
 # The data_directory parameter specifies the location of Postfix-writable
18
 # data files (caches, random numbers). This directory must be owned
19
 # by the mail_owner account (see below).
20
 #
21
-data_directory = /var/lib/postfix
22
+data_directory = /var/db/postfix
23
 
24
 # QUEUE AND PROCESS OWNERSHIP
25
 #
26
@@ -244,7 +244,7 @@
27
 # 
28
 #mynetworks_style = class
29
 #mynetworks_style = subnet
30
-#mynetworks_style = host
31
+mynetworks_style = host
32
 
33
 # Alternatively, you can specify the mynetworks list by hand, in
34
 # which case Postfix ignores the mynetworks_style setting.
35
@@ -615,37 +615,37 @@
36
 # sendmail_path: The full pathname of the Postfix sendmail command.
37
 # This is the Sendmail-compatible mail posting interface.
38
 # 
39
-sendmail_path =
40
+sendmail_path = !!PREFIX!!/sbin/sendmail
41
 
42
 # newaliases_path: The full pathname of the Postfix newaliases command.
43
 # This is the Sendmail-compatible command to build alias databases.
44
 #
45
-newaliases_path =
46
+newaliases_path = !!PREFIX!!/bin/newaliases
47
 
48
 # mailq_path: The full pathname of the Postfix mailq command.  This
49
 # is the Sendmail-compatible mail queue listing command.
50
 # 
51
-mailq_path =
52
+mailq_path = !!PREFIX!!/bin/mailq
53
 
54
 # setgid_group: The group for mail submission and queue management
55
 # commands.  This must be a group name with a numerical group ID that
56
 # is not shared with other accounts, not even with the Postfix account.
57
 #
58
-setgid_group =
59
+setgid_group = maildrop
60
 
61
 # html_directory: The location of the Postfix HTML documentation.
62
 #
63
-html_directory =
64
+html_directory = no
65
 
66
 # manpage_directory: The location of the Postfix on-line manual pages.
67
 #
68
-manpage_directory =
69
+manpage_directory = !!PREFIX!!/man
70
 
71
 # sample_directory: The location of the Postfix sample configuration files.
72
 # This parameter is obsolete as of Postfix 2.1.
73
 #
74
-sample_directory =
75
+sample_directory = !!PREFIX!!/etc/postfix
76
 
77
 # readme_directory: The location of the Postfix README files.
78
 #
79
-readme_directory =
80
+readme_directory = no
(-)postfix/files/patch-conf::post-install (-11 lines)
Lines 1-11 Link Here
1
--- conf/post-install.orig	Thu Feb 24 08:06:08 2005
2
+++ conf/post-install	Sat Mar  5 11:53:42 2005
3
@@ -185,7 +185,7 @@
4
 
5
 umask 022
6
 
7
-PATH=/bin:/usr/bin:/usr/sbin:/usr/etc:/sbin:/etc:/usr/contrib/bin:/usr/gnu/bin:/usr/ucb:/usr/bsd
8
+PATH=/bin:/usr/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin
9
 SHELL=/bin/sh
10
 IFS=" 	
11
 "
(-)postfix/files/patch-makedefs (-7 / +5 lines)
Lines 1-12 Link Here
1
--- makedefs.orig	2007-03-24 10:30:18.000000000 -0300
1
--- makedefs.orig	2009-05-11 17:26:46.000000000 -0400
2
+++ makedefs	2007-10-22 16:18:48.000000000 -0200
2
+++ makedefs	2009-05-11 17:26:46.000000000 -0400
3
@@ -130,6 +130,10 @@
3
@@ -144,6 +144,8 @@
4
 		;;
4
 		;;
5
   FreeBSD.6*)	SYSTYPE=FREEBSD6
5
   FreeBSD.7*)	SYSTYPE=FREEBSD7
6
 		;;
6
 		;;
7
+  FreeBSD.7*)	SYSTYPE=FREEBSD6
7
+  FreeBSD.8*)	SYSTYPE=FREEBSD7
8
+		;;
9
+  FreeBSD.8*)	SYSTYPE=FREEBSD6
10
+		;;
8
+		;;
11
   OpenBSD.2*)	SYSTYPE=OPENBSD2
9
   OpenBSD.2*)	SYSTYPE=OPENBSD2
12
 		;;
10
 		;;
(-)postfix/files/patch-src::global::mail_params.h (-38 lines)
Lines 1-38 Link Here
1
--- src/global/mail_params.h.orig	Mon Jun 30 18:57:48 2008
2
+++ src/global/mail_params.h	Mon Jun 30 19:00:05 2008
3
@@ -67,7 +67,7 @@
4
 extern gid_t var_owner_gid;
5
 
6
 #define VAR_SGID_GROUP		"setgid_group"
7
-#define DEF_SGID_GROUP		"postdrop"
8
+#define DEF_SGID_GROUP		"maildrop"
9
 extern char *var_sgid_group;
10
 extern gid_t var_sgid_gid;
11
 
12
@@ -241,7 +241,7 @@
13
   */
14
 #define VAR_DAEMON_DIR		"daemon_directory"
15
 #ifndef DEF_DAEMON_DIR
16
-#define DEF_DAEMON_DIR		"/usr/libexec/postfix"
17
+#define DEF_DAEMON_DIR		"!!PREFIX!!/libexec/postfix"
18
 #endif
19
 extern char *var_daemon_dir;
20
 
21
@@ -265,7 +265,7 @@
22
   */
23
 #define VAR_DATA_DIR		"data_directory"
24
 #ifndef DEF_DATA_DIR
25
-#define DEF_DATA_DIR		"/var/lib/postfix"
26
+#define DEF_DATA_DIR		"/var/db/postfix"
27
 #endif
28
 extern char *var_data_dir;
29
 
30
@@ -279,7 +279,7 @@
31
   */
32
 #define VAR_CONFIG_DIR		"config_directory"
33
 #ifndef DEF_CONFIG_DIR
34
-#define DEF_CONFIG_DIR		"/etc/postfix"
35
+#define DEF_CONFIG_DIR		"!!PREFIX!!/etc/postfix"	
36
 #endif
37
 extern char *var_config_dir;
38
 
(-)postfix/files/pkg-install.in (+153 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/postfix/pkg-install,v 1.27 2009/05/18 14:36:33 pav Exp $
4
#
5
6
# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it
7
# will make the port/package use defaults which make postfix replace
8
# sendmail as much as possible.
9
10
PREFIX=${PKG_PREFIX:=%%PREFIX%%}
11
ETCDIR=${ETCDIR:=%%ETCDIR%%}
12
READMEDIR=${READMEDIR:=%%READMEDIR%%}
13
EXAMPLESDIR=${EXAMPLESDIR:=%%EXAMPLESDIR%%}
14
BATCH=${BATCH:=no}
15
POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
16
17
if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then
18
	DEFAULT_REPLACE_MAILERCONF=n
19
else
20
	DEFAULT_REPLACE_MAILERCONF=y
21
fi
22
23
if [ -x /usr/sbin/nologin ]; then
24
	NOLOGIN=/usr/sbin/nologin
25
else
26
	NOLOGIN=/sbin/nologin
27
fi
28
29
ask() {
30
	local question default answer
31
32
	question=$1
33
	default=$2
34
	if [ -z "${PACKAGE_BUILDING}" -a "${BATCH}" = "no" ]; then
35
		read -p "${question} [${default}]? " answer
36
	fi
37
	if [ -z "${answer}" ]; then
38
		answer=${default}
39
	fi
40
	echo ${answer}
41
}
42
43
yesno() {
44
	local question default answer
45
46
	question=$1
47
	default=$2
48
	while :; do
49
		answer=$(ask "${question}" "${default}")
50
		case "${answer}" in
51
			[Yy]*)	return 0;;
52
			[Nn]*)	return 1;;
53
		esac
54
		echo "Please answer yes or no."
55
	done
56
}
57
58
if [ "$2" = "PRE-INSTALL" ]; then
59
	USER=postfix
60
	UID=125
61
	GROUP=postfix
62
	GID=125
63
	GROUP2=maildrop
64
	GID2=126
65
66
	if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
67
		echo "You already have a group \"${GROUP}\", so I will use it."
68
	else
69
		if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
70
			echo "Added group \"${GROUP}\"."
71
		else
72
			echo "Adding group \"${GROUP}\" failed..."
73
			echo "Please create it, and try again."
74
			exit 1
75
		fi
76
	fi
77
78
	if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then
79
		echo "You already have a group \"${GROUP2}\", so I will use it."
80
	else
81
		if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then
82
			echo "Added group \"${GROUP2}\"."
83
		else
84
			echo "Adding group \"${GROUP2}\" failed..."
85
			echo "Please create it, and try again."
86
			exit 1
87
		fi
88
	fi
89
90
	if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
91
		echo "You already have a user \"${USER}\", so I will use it."
92
	else
93
		if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then
94
			echo "Added user \"${USER}\"."
95
		else
96
			echo "Adding user \"${USER}\" failed..."
97
			echo "Please create it, and try again."
98
			exit 1
99
		fi
100
	fi
101
102
	if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then
103
		echo "You already have user \"${USER}\" in group \"mail\", so I will use it."
104
	else
105
		echo "You need user \"${USER}\" added to group \"mail\"."
106
		if yesno "Would you like me to add it" y; then
107
			/usr/sbin/pw groupmod mail -m ${USER} || exit
108
			echo "Done."
109
		else
110
			echo "Please create it, and try again."
111
			exit 1
112
		fi
113
	fi
114
fi
115
116
if [ "$2" = "POST-INSTALL" ]; then
117
	if [ -d ${EXAMPLESDIR} ]; then
118
		for file in ${EXAMPLESDIR}/*; do
119
			if [ ! -f ${ETCDIR}/${file#${EXAMPLESDIR}} ]; then
120
				cp $file ${ETCDIR}/
121
			fi
122
		done
123
	fi
124
	/bin/sh ${PREFIX}/libexec/postfix/post-install tempdir=/tmp upgrade-package
125
fi
126
127
replace() {
128
	local orig repl
129
130
	orig=$1
131
	repl=$2
132
	if [ -e ${orig} ]; then
133
		/bin/mv -f ${orig} ${orig}.OFF
134
		/bin/chmod 0 ${orig}.OFF
135
	fi
136
	if [ -e ${repl} ]; then
137
		/bin/ln -s ${repl} ${orig}
138
	fi
139
}
140
141
if [ "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" ]; then
142
	if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then
143
		/bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old
144
		echo "#"						>	/etc/mail/mailer.conf
145
		echo -n "# Execute the Postfix sendmail program"	>>	/etc/mail/mailer.conf
146
		echo ", named ${PREFIX}/sbin/sendmail"		>>	/etc/mail/mailer.conf
147
		echo "#"						>>	/etc/mail/mailer.conf
148
		echo "sendmail	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
149
		echo "send-mail	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
150
		echo "mailq		${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
151
		echo "newaliases	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
152
	fi
153
fi
(-)postfix/files/pkg-message.in (+25 lines)
Line 0 Link Here
1
To enable postfix startup script please add postfix_enable="YES" in
2
your rc.conf
3
4
If you not need sendmail anymore, please add in your rc.conf:
5
6
sendmail_enable="NO"
7
sendmail_submit_enable="NO"
8
sendmail_outbound_enable="NO"
9
sendmail_msp_queue_enable="NO"
10
11
And you can disable some sendmail specific daily maintenance routines in your
12
/etc/periodic.conf file:
13
14
daily_clean_hoststat_enable="NO"
15
daily_status_mail_rejects_enable="NO"
16
daily_status_include_submit_mailq="NO"
17
daily_submit_queuerun="NO"
18
19
If you are using SASL, you need to make sure that postfix has access to read
20
the sasldb file.  This is accomplished by adding postfix to group mail and
21
making the %%PREFIX%%/etc/sasldb* file(s) readable by group mail (this should
22
be the default for new installs).
23
24
If you are upgrading from postfix version prior to 2.0, please see the README
25
files for recommended changes to your configuration.
(-)postfix/files/postfix.sh.in (-4 / +4 lines)
Lines 25-34 Link Here
25
25
26
load_rc_config $name
26
load_rc_config $name
27
27
28
: ${postfix_enable="NO"}
28
: ${postfix_enable:="NO"}
29
: ${postfix_pidfile="/var/spool/postfix/pid/master.pid"}
29
: ${postfix_pidfile:="/var/spool/postfix/pid/master.pid"}
30
: ${postfix_procname="%%PREFIX%%/libexec/postfix/master"}
30
: ${postfix_procname:="%%PREFIX%%/libexec/postfix/master"}
31
: ${postfix_flags=""}
31
: ${postfix_flags:=""}
32
32
33
start_cmd=${name}_start
33
start_cmd=${name}_start
34
stop_cmd=${name}_stop
34
stop_cmd=${name}_stop
(-)postfix/pkg-install (-167 lines)
Lines 1-167 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/postfix/pkg-install,v 1.27 2009/05/18 14:36:33 pav Exp $
4
#
5
6
# If the POSTFIX_DEFAULT_MTA environment variable is set to YES, it
7
# will make the port/package use defaults which make postfix replace
8
# sendmail as much as possible.
9
10
PKG_PREFIX=${PKG_PREFIX:=/usr/local}
11
BATCH=${BATCH:=no}
12
POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
13
14
if [ x${POSTFIX_DEFAULT_MTA} = xno ]; then
15
	DEFAULT_REPLACE_MAILERCONF=n
16
else
17
	DEFAULT_REPLACE_MAILERCONF=y
18
fi
19
20
if [ -x /usr/sbin/nologin ]; then
21
	NOLOGIN=/usr/sbin/nologin
22
else
23
	NOLOGIN=/sbin/nologin
24
fi
25
26
ask() {
27
	local question default answer
28
29
	question=$1
30
	default=$2
31
	if [ -z "${PACKAGE_BUILDING}" -a x${BATCH} = xno ]; then
32
		read -p "${question} [${default}]? " answer
33
	fi
34
	if [ x${answer} = x ]; then
35
		answer=${default}
36
	fi
37
	echo ${answer}
38
}
39
40
yesno() {
41
	local question default answer
42
43
	question=$1
44
	default=$2
45
	while :; do
46
		answer=$(ask "${question}" "${default}")
47
		case "${answer}" in
48
			[Yy]*)	return 0;;
49
			[Nn]*)	return 1;;
50
		esac
51
		echo "Please answer yes or no."
52
	done
53
}
54
55
if [ x"$2" = xPRE-INSTALL ]; then
56
	USER=postfix
57
	UID=125
58
	GROUP=postfix
59
	GID=125
60
	GROUP2=maildrop
61
	GID2=126
62
63
	if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
64
		echo "You already have a group \"${GROUP}\", so I will use it."
65
	else
66
		if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
67
			echo "Added group \"${GROUP}\"."
68
		else
69
			echo "Adding group \"${GROUP}\" failed..."
70
			echo "Please create it, and try again."
71
			exit 1
72
		fi
73
	fi
74
75
	if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then
76
		echo "You already have a group \"${GROUP2}\", so I will use it."
77
	else
78
		if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then
79
			echo "Added group \"${GROUP2}\"."
80
		else
81
			echo "Adding group \"${GROUP2}\" failed..."
82
			echo "Please create it, and try again."
83
			exit 1
84
		fi
85
	fi
86
87
	if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
88
		echo "You already have a user \"${USER}\", so I will use it."
89
	else
90
		if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then
91
			echo "Added user \"${USER}\"."
92
		else
93
			echo "Adding user \"${USER}\" failed..."
94
			echo "Please create it, and try again."
95
			exit 1
96
		fi
97
	fi
98
99
	if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then
100
		echo "You already have user \"${USER}\" in group \"mail\", so I will use it."
101
	else
102
		echo "You need user \"${USER}\" added to group \"mail\"."
103
		if yesno "Would you like me to add it" y; then
104
			/usr/sbin/pw groupmod mail -m ${USER} || exit
105
			echo "Done."
106
		else
107
			echo "Please create it, and try again."
108
			exit 1
109
		fi
110
	fi
111
fi
112
113
if [ x"$2" = xPOST-INSTALL ]; then
114
	if [ -d ${PKG_PREFIX}/etc/postfix/dist ]; then
115
		for file in ${PKG_PREFIX}/etc/postfix/dist/*; do
116
			if [ ! -f ${PKG_PREFIX}/etc/postfix/${file#${PKG_PREFIX}/etc/postfix/dist} ]; then
117
				cp $file ${PKG_PREFIX}/etc/postfix/
118
			fi
119
		done
120
	fi
121
122
	/bin/sh ${PKG_PREFIX}/libexec/postfix/post-install tempdir=/tmp \
123
	config_directory=${PKG_PREFIX}/etc/postfix \
124
	data_directory=/var/db/postfix \
125
	daemon_directory=${PKG_PREFIX}/libexec/postfix \
126
	command_directory=${PKG_PREFIX}/sbin \
127
	queue_directory=/var/spool/postfix \
128
	sendmail_path=${PKG_PREFIX}/sbin/sendmail \
129
	newaliases_path=${PKG_PREFIX}/bin/newaliases \
130
	mailq_path=${PKG_PREFIX}/bin/mailq \
131
	mail_owner=postfix \
132
	setgid_group=maildrop \
133
	manpage_directory=${PKG_PREFIX}/man \
134
	sample_directory=${PKG_PREFIX}/etc/postfix \
135
	readme_directory=no \
136
	upgrade-package
137
fi
138
# readme_directory is "no" above since the package will have correct perms
139
# already, and we don't know if they had PORTDOCS.
140
141
replace() {
142
	local orig repl
143
144
	orig=$1
145
	repl=$2
146
	if [ -e ${orig} ]; then
147
		/bin/mv -f ${orig} ${orig}.OFF
148
		/bin/chmod 0 ${orig}.OFF
149
	fi
150
	if [ -e ${repl} ]; then
151
		/bin/ln -s ${repl} ${orig}
152
	fi
153
}
154
155
if [ x"$2" = xPOST-INSTALL -a -z "${PACKAGE_BUILDING}" ]; then
156
	if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then
157
		/bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old
158
		echo "#"						>	/etc/mail/mailer.conf
159
		echo -n "# Execute the Postfix sendmail program"	>>	/etc/mail/mailer.conf
160
		echo ", named ${PKG_PREFIX}/sbin/sendmail"		>>	/etc/mail/mailer.conf
161
		echo "#"						>>	/etc/mail/mailer.conf
162
		echo "sendmail	${PKG_PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
163
		echo "send-mail	${PKG_PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
164
		echo "mailq	${PKG_PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
165
		echo "newaliases	${PKG_PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
166
	fi
167
fi
(-)postfix/pkg-message (-25 lines)
Lines 1-25 Link Here
1
To enable postfix startup script please add postfix_enable="YES" in
2
your rc.conf
3
4
If you not need sendmail anymore, please add in your rc.conf:
5
6
sendmail_enable="NO"
7
sendmail_submit_enable="NO"
8
sendmail_outbound_enable="NO"
9
sendmail_msp_queue_enable="NO"
10
11
And you can disable some sendmail specific daily maintenance routines in your
12
/etc/periodic.conf file:
13
14
daily_clean_hoststat_enable="NO"
15
daily_status_mail_rejects_enable="NO"
16
daily_status_include_submit_mailq="NO"
17
daily_submit_queuerun="NO"
18
19
If you are using SASL, you need to make sure that postfix has access to read
20
the sasldb file.  This is accomplished by adding postfix to group mail and
21
making the /usr/local/etc/sasldb* file(s) readable by group mail (this should
22
be the default for new installs).
23
24
If you are upgrading from postfix version prior to 2.0, please see the README
25
files for recommended changes to your configuration.
(-)postfix/pkg-plist (-36 / +26 lines)
Lines 1-28 Link Here
1
@unexec if cmp -s %D/etc/postfix/main.cf %D/etc/postfix/dist/main.cf; then rm -f %D/etc/postfix/main.cf; fi
1
@unexec if cmp -s %D/%%EXAMPLESDIR%%/main.cf %D/%%ETCDIR%%/main.cf; then rm -f %D/%%ETCDIR%%/main.cf; fi
2
@unexec if cmp -s %D/etc/postfix/master.cf %D/etc/postfix/dist/master.cf; then rm -f %D/etc/postfix/master.cf; fi
2
@unexec if cmp -s %D/%%EXAMPLESDIR%%/master.cf %D/%%ETCDIR%%/master.cf; then rm -f %D/%%ETCDIR%%/master.cf; fi
3
@unexec if cmp -s %D/etc/postfix/access %D/etc/postfix/dist/access; then rm -f %D/etc/postfix/access; fi
3
@unexec if cmp -s %D/%%EXAMPLESDIR%%/access %D/%%ETCDIR%%/access; then rm -f %D/%%ETCDIR%%/access; fi
4
@unexec if cmp -s %D/etc/postfix/aliases %D/etc/postfix/dist/aliases; then rm -f %D/etc/postfix/aliases; fi
4
@unexec if cmp -s %D/%%EXAMPLESDIR%%/aliases %D/%%ETCDIR%%/aliases; then rm -f %D/%%ETCDIR%%/aliases; fi
5
@unexec if cmp -s %D/etc/postfix/canonical %D/etc/postfix/dist/canonical; then rm -f %D/etc/postfix/canonical; fi
5
@unexec if cmp -s %D/%%EXAMPLESDIR%%/canonical %D/%%ETCDIR%%/canonical; then rm -f %D/%%ETCDIR%%/canonical; fi
6
@unexec if cmp -s %D/etc/postfix/header_checks %D/etc/postfix/dist/header_checks; then rm -f %D/etc/postfix/header_checks; fi
6
@unexec if cmp -s %D/%%EXAMPLESDIR%%/header_checks %D/%%ETCDIR%%/header_checks; then rm -f %D/%%ETCDIR%%/header_checks; fi
7
@unexec if cmp -s %D/etc/postfix/relocated %D/etc/postfix/dist/relocated; then rm -f %D/etc/postfix/relocated; fi
7
@unexec if cmp -s %D/%%EXAMPLESDIR%%/relocated %D/%%ETCDIR%%/relocated; then rm -f %D/%%ETCDIR%%/relocated; fi
8
@unexec if cmp -s %D/etc/postfix/transport %D/etc/postfix/dist/transport; then rm -f %D/etc/postfix/transport; fi
8
@unexec if cmp -s %D/%%EXAMPLESDIR%%/transport %D/%%ETCDIR%%/transport; then rm -f %D/%%ETCDIR%%/transport; fi
9
@unexec if cmp -s %D/etc/postfix/virtual %D/etc/postfix/dist/virtual; then rm -f %D/etc/postfix/virtual; fi
9
@unexec if cmp -s %D/%%EXAMPLESDIR%%/virtual %D/%%ETCDIR%%/virtual; then rm -f %D/%%ETCDIR%%/virtual; fi
10
@unexec if cmp -s %D/etc/postfix/generic %D/etc/postfix/dist/generic; then rm -f %D/etc/postfix/generic; fi
10
@unexec if cmp -s %D/%%EXAMPLESDIR%%/generic %D/%%ETCDIR%%/generic; then rm -f %D/%%ETCDIR%%/generic; fi
11
etc/postfix/LICENSE
11
%%ETCDIR%%/LICENSE
12
etc/postfix/TLS_LICENSE
12
%%ETCDIR%%/TLS_LICENSE
13
etc/postfix/bounce.cf.default
13
%%ETCDIR%%/bounce.cf.default
14
etc/postfix/main.cf.default
14
%%ETCDIR%%/main.cf.default
15
etc/postfix/makedefs.out
15
%%ETCDIR%%/makedefs.out
16
etc/postfix/dist/main.cf
16
@dirrmtry %%ETCDIR%%
17
etc/postfix/dist/master.cf
18
etc/postfix/dist/access
19
etc/postfix/dist/aliases
20
etc/postfix/dist/canonical
21
etc/postfix/dist/header_checks
22
etc/postfix/dist/relocated
23
etc/postfix/dist/transport
24
etc/postfix/dist/virtual
25
etc/postfix/dist/generic
26
libexec/postfix/anvil
17
libexec/postfix/anvil
27
libexec/postfix/bounce
18
libexec/postfix/bounce
28
libexec/postfix/cleanup
19
libexec/postfix/cleanup
Lines 55-60 Link Here
55
libexec/postfix/verify
46
libexec/postfix/verify
56
libexec/postfix/virtual
47
libexec/postfix/virtual
57
libexec/postfix/tlsmgr
48
libexec/postfix/tlsmgr
49
@dirrm libexec/postfix
50
bin/mailq
51
bin/newaliases
52
bin/qshape
53
bin/rmail
54
%%TEST%%bin/qmqp-sink
55
%%TEST%%bin/qmqp-source
56
%%TEST%%bin/smtp-sink
57
%%TEST%%bin/smtp-source
58
sbin/postalias
58
sbin/postalias
59
sbin/postcat
59
sbin/postcat
60
sbin/postconf
60
sbin/postconf
Lines 68-81 Link Here
68
sbin/postqueue
68
sbin/postqueue
69
sbin/postsuper
69
sbin/postsuper
70
sbin/sendmail
70
sbin/sendmail
71
%%SUB_TEST%%bin/qmqp-sink
72
%%SUB_TEST%%bin/qmqp-source
73
%%SUB_TEST%%bin/smtp-sink
74
%%SUB_TEST%%bin/smtp-source
75
bin/rmail
76
bin/qshape
77
bin/newaliases
78
bin/mailq
79
%%PORTDOCS%%%%DOCSDIR%%/AAAREADME
71
%%PORTDOCS%%%%DOCSDIR%%/AAAREADME
80
%%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README
72
%%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README
81
%%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README.html
73
%%PORTDOCS%%%%DOCSDIR%%/ADDRESS_CLASS_README.html
Lines 164-169 Link Here
164
%%PORTDOCS%%%%DOCSDIR%%/ULTRIX_README
156
%%PORTDOCS%%%%DOCSDIR%%/ULTRIX_README
165
%%PORTDOCS%%%%DOCSDIR%%/UUCP_README
157
%%PORTDOCS%%%%DOCSDIR%%/UUCP_README
166
%%PORTDOCS%%%%DOCSDIR%%/UUCP_README.html
158
%%PORTDOCS%%%%DOCSDIR%%/UUCP_README.html
159
%%VDA%%%%PORTDOCS%%%%DOCSDIR%%/VDA_README
167
%%PORTDOCS%%%%DOCSDIR%%/VERP_README
160
%%PORTDOCS%%%%DOCSDIR%%/VERP_README
168
%%PORTDOCS%%%%DOCSDIR%%/VERP_README.html
161
%%PORTDOCS%%%%DOCSDIR%%/VERP_README.html
169
%%PORTDOCS%%%%DOCSDIR%%/VIRTUAL_README
162
%%PORTDOCS%%%%DOCSDIR%%/VIRTUAL_README
Lines 244-249 Link Here
244
%%PORTDOCS%%%%DOCSDIR%%/tlsmgr.8.html
237
%%PORTDOCS%%%%DOCSDIR%%/tlsmgr.8.html
245
%%PORTDOCS%%%%DOCSDIR%%/generic.5.html
238
%%PORTDOCS%%%%DOCSDIR%%/generic.5.html
246
%%PORTDOCS%%@dirrm %%DOCSDIR%%
239
%%PORTDOCS%%@dirrm %%DOCSDIR%%
247
@dirrm libexec/postfix
248
@dirrm etc/postfix/dist
249
@dirrmtry etc/postfix

Return to bug 134728