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

Collapse All | Expand All

(-)postfix/Makefile (-52 / +73 lines)
Lines 6-12 Link Here
6
#
6
#
7
7
8
PORTNAME=	postfix
8
PORTNAME=	postfix
9
PORTVERSION=	2.6.0
9
PORTVERSION=	2.6.1
10
PORTEPOCH=	1
10
PORTEPOCH=	1
11
CATEGORIES=	mail ipv6
11
CATEGORIES=	mail ipv6
12
MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
12
MASTER_SITES=	ftp://ftp.porcupine.org/mirrors/postfix-release/official/ \
Lines 76-83 Link Here
76
	bounce.8 trace.8 \
76
	bounce.8 trace.8 \
77
	smtp.8 lmtp.8
77
	smtp.8 lmtp.8
78
78
79
CONF1=	access aliases canonical generic header_checks main.cf master.cf \
79
PORTEXAMPLES=	access aliases canonical generic header_checks \
80
	relocated transport virtual
80
		main.cf master.cf relocated transport virtual
81
81
82
.if !defined(DEBUG)
82
.if !defined(DEBUG)
83
MAKEFILEFLAGS+=	DEBUG=
83
MAKEFILEFLAGS+=	DEBUG=
Lines 85-98 Link Here
85
85
86
MAKEFILEFLAGS+=	CC="${CC}" OPT="${CFLAGS}"
86
MAKEFILEFLAGS+=	CC="${CC}" OPT="${CFLAGS}"
87
87
88
SCRIPTS_ENV=	WRKDIRPREFIX="${WRKDIRPREFIX}" \
89
		TOUCH="${TOUCH}" \
90
		MKDIR="${MKDIR}"
91
92
.include <bsd.port.pre.mk>
88
.include <bsd.port.pre.mk>
93
89
90
POSTFIX_CCARGS+=	-DDEF_CONFIG_DIR=\\\"${ETCDIR}\\\" \
91
			-DDEF_SAMPLE_DIR=\\\"${EXAMPLESDIR}\\\" \
92
			-DDEF_DAEMON_DIR=\\\"${PREFIX}/libexec/postfix\\\" \
93
			-DDEF_COMMAND_DIR=\\\"${PREFIX}/sbin\\\" \
94
			-DDEF_SENDMAIL_PATH=\\\"${PREFIX}/sbin/sendmail\\\" \
95
			-DDEF_NEWALIAS_PATH=\\\"${PREFIX}/bin/newaliases\\\" \
96
			-DDEF_MAILQ_PATH=\\\"${PREFIX}/bin/mailq\\\" \
97
			-DDEF_MANPAGE_DIR=\\\"${MANPREFIX}/man\\\" \
98
			-DDEF_README_DIR=\\\"${READMEDIR}\\\" \
99
			-DDEF_HTML_DIR=\\\"${READMEDIR}\\\" \
100
			-DDEF_QUEUE_DIR=\\\"/var/spool/postfix\\\" \
101
			-DDEF_DATA_DIR=\\\"/var/db/postfix\\\" \
102
			-DDEF_MAIL_OWNER=\\\"postfix\\\" \
103
			-DDEF_SGID_GROUP=\\\"maildrop\\\" \
104
			-DALIAS_DB_MAP=\\\"hash:/etc/mail/aliases\\\"
105
94
# Default requirement for postfix rc script
106
# Default requirement for postfix rc script
95
_REQUIRE=	LOGIN cleanvar
107
_REQUIRE=		LOGIN cleanvar
96
108
97
.if defined(WITH_PCRE)
109
.if defined(WITH_PCRE)
98
LIB_DEPENDS+=		pcre.0:${PORTSDIR}/devel/pcre
110
LIB_DEPENDS+=		pcre.0:${PORTSDIR}/devel/pcre
Lines 111-116 Link Here
111
.if defined(WITH_DOVECOT)
123
.if defined(WITH_DOVECOT)
112
RUN_DEPENDS+=		dovecot:${PORTSDIR}/mail/dovecot
124
RUN_DEPENDS+=		dovecot:${PORTSDIR}/mail/dovecot
113
POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"
125
POSTFIX_CCARGS+=	-DUSE_SASL_AUTH -DDEF_SERVER_SASL_TYPE=\\\"dovecot\\\"
126
_REQUIRE+=		dovecot
114
.endif
127
.endif
115
128
116
.if defined(WITH_SASLKRB)
129
.if defined(WITH_SASLKRB)
Lines 183-210 Link Here
183
.endif
196
.endif
184
197
185
.if defined(WITH_VDA)
198
.if defined(WITH_VDA)
186
IGNORE=			wait for a new VDA patch that works with 2.6.0
199
IGNORE=			wait for a new VDA patch that works with ${PORTVERSION}
187
PATCH_SITES+=		http://vda.sourceforge.net/VDA/
200
PATCH_SITES+=		http://vda.sourceforge.net/VDA/
188
PATCHFILES+=		postfix-2.5.6-vda-ng.patch.gz
201
PATCHFILES+=		postfix-${PORTVERSION}-vda-ng.patch.gz
189
PATCH_DIST_STRIP=	-p1
202
PATCH_DIST_STRIP=	-p1
203
PLIST_SUB+=	VDA=""
204
.else
205
PLIST_SUB+=	VDA="@comment "
190
.endif
206
.endif
191
207
192
.if defined(WITH_TEST)
208
.if defined(WITH_TEST)
193
BINTEST=	qmqp-sink qmqp-source smtp-sink smtp-source
209
BINTEST=	qmqp-sink qmqp-source smtp-sink smtp-source
194
MANTEST=	qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1
210
MANTEST=	qmqp-sink.1 qmqp-source.1 smtp-sink.1 smtp-source.1
195
MAN1+=		${MANTEST}
211
MAN1+=		${MANTEST}
196
PLIST_SUB+=	SUB_TEST=""
212
PLIST_SUB+=	TEST=""
197
.else
213
.else
198
PLIST_SUB+=	SUB_TEST="@comment "
214
PLIST_SUB+=	TEST="@comment "
199
.endif
215
.endif
200
216
201
.if defined(NOPORTDOCS)
217
.if defined(NOPORTDOCS)
202
READMEDIR=no
218
READMEDIR=no
203
.else
219
.else
204
READMEDIR=${PREFIX}/share/doc/postfix
220
READMEDIR=${DOCSDIR}
205
.endif
221
.endif
206
222
207
SUB_LIST+=	REQUIRE="${_REQUIRE}"
223
SUB_LIST+=	REQUIRE="${_REQUIRE}" READMEDIR="${READMEDIR}"
224
SUB_FILES+=	pkg-install pkg-message
225
226
# sed script for files in ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man
227
REINPLACE=	s!^PATH=.*!PATH=/bin:/sbin:/usr/bin:/usr/sbin:${PREFIX}/bin:${PREFIX}/sbin!;\
228
		s!(_directory = )/usr/!\1${PREFIX}/!g;\
229
		s!^(data_directory = /var/)lib/!\1db/!g;\
230
		s!^\#(mynetworks_style = host)!\1!g;\
231
		s!^(sendmail_path =)!\1 ${PREFIX}/sbin/sendmail!g;\
232
		s!^(newaliases_path =)!\1 ${PREFIX}/bin/newaliases!g;\
233
		s!^(mailq_path =)!\1 ${PREFIX}/bin/mailq!g;\
234
		s!^(setgid_group =)!\1 maildrop!g;\
235
		s!^(manpage_directory =)!\1 ${PREFIX}/man!g;\
236
		s!^(sample_directory =)!\1 ${EXAMPLESDIR}!g;\
237
		s!^((html|readme)_directory =)!\1 ${READMEDIR}!g;\
238
		\!^\#alias_database = dbm:/etc/mail/aliases$$!d;\
239
		s!/etc/aliases!/etc/mail/aliases!g;\
240
		s!(:|= )/etc/postfix!\1$$config_directory!g;\
241
		s!/etc/postfix!${ETCDIR}!g;
208
242
209
pre-patch:
243
pre-patch:
210
.if defined(POSTFIX_OPTIONS)
244
.if defined(POSTFIX_OPTIONS)
Lines 233-252 Link Here
233
	fi
267
	fi
234
.endif
268
.endif
235
269
236
	@${ECHO} "<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>" \
270
	@${ECHO} '<HTML><BODY>See <A HREF="header_checks.5.html">header_checks.5.html</A></BODY></HTML>' \
237
		> ${WRKSRC}/html/body_checks.5.html
271
		> ${WRKSRC}/html/body_checks.5.html
238
	@${FIND} -P ${WRKSRC}/man -type f | ${XARGS} \
272
	@${REINPLACE_CMD} -E -e 's![[:<:]]perl[[:>:]]!${PERL}!' \
239
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
273
		${WRKSRC}/src/bounce/Makefile.in
240
	@${FIND} -P ${WRKSRC}/README_FILES -type f | ${XARGS} \
274
	@${REINPLACE_CMD} -E -e 's!^(#define DEF_SGID_GROUP[^"]+)"postdrop"$$!\1"maildrop"!' \
241
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
275
		${WRKSRC}/src/global/mail_params.h
242
	@${FIND} -P ${WRKSRC}/conf -type f | ${XARGS} \
276
	@${FIND} -X ${WRKSRC}/README_FILES ${WRKSRC}/conf ${WRKSRC}/man \
243
		${REINPLACE_CMD} -e "s|/etc/postfix|${PREFIX}/etc/postfix|g"
277
		-type f -a ! \( -name INSTALL -o -name aliases \) | ${XARGS} \
278
		${REINPLACE_CMD} -E -e '${REINPLACE}'
244
279
245
post-patch:
280
post-patch:
246
# All files modified with ${FILESDIR}/patch-* to use !!PREFIX!! need REINPLACE. Put below.
281
.if defined(WITH_VDA)
247
	@${REINPLACE_CMD} -e "s,!!PREFIX!!,${PREFIX},g" \
282
	@${ECHO} '$$readme_directory/VDA_README:f:root:-:644' \
248
		${WRKSRC}/conf/main.cf ${WRKSRC}/src/global/mail_params.h
283
		>> ${WRKSRC}/conf/postfix-files
249
	@${REINPLACE_CMD} -e "s|perl|${PERL}|" ${WRKSRC}/src/bounce/Makefile.in
284
	@${REINPLACE_CMD} -E -e '${REINPLACE}' \
285
		${WRKSRC}/README_FILES/VDA_README
286
.endif
250
287
251
do-configure:
288
do-configure:
252
	(cd ${WRKSRC} && ${MAKE} -f Makefile.init makefiles ${MAKEFILEFLAGS} \
289
	(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
294
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
258
295
259
do-install:
296
do-install:
260
	cd ${WRKSRC}; ${SH} postfix-install -non-interactive install_root=/ tempdir=/tmp \
297
	@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
298
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/rmail/rmail ${PREFIX}/bin/rmail
276
277
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape
299
	${INSTALL_SCRIPT} ${WRKSRC}/auxiliary/qshape/qshape.pl ${PREFIX}/bin/qshape
278
	${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MANPREFIX}/man/man1
300
	${INSTALL_MAN} ${WRKSRC}/man/man1/qshape.1 ${MANPREFIX}/man/man1
279
280
.for f in ${BINTEST}
301
.for f in ${BINTEST}
281
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin
302
	${INSTALL_PROGRAM} ${WRKSRC}/bin/${f} ${PREFIX}/bin
282
.endfor
303
.endfor
283
.for f in ${MANTEST}
304
.for f in ${MANTEST}
284
	${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MANPREFIX}/man/man1
305
	${INSTALL_MAN} ${WRKSRC}/man/man1/${f} ${MANPREFIX}/man/man1
285
.endfor
306
.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)
307
.if !defined(NOPORTDOCS)
293
	${INSTALL} -d -o ${DOCOWN} -g ${DOCGRP} -m 555 ${DOCSDIR}
308
	${INSTALL} -o ${DOCOWN} -g ${DOCGRP} -m 555 -d ${DOCSDIR}
294
	@cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.jpg *.png ${DOCSDIR} && \
309
	@cd ${WRKSRC}/html && ${INSTALL_DATA} *.html *.jpg *.png ${DOCSDIR} && \
295
		${ECHO_MSG} "Installed HTML documentation in ${DOCSDIR}"
310
		${ECHO_MSG} "Installed HTML documentation in ${DOCSDIR}"
296
.endif
311
.endif
312
.if !defined(NOPORTEXAMPLES)
313
	${INSTALL} -o ${SHAREOWN} -g ${SHAREGRP} -m 555 -d ${EXAMPLESDIR}
314
.for f in ${PORTEXAMPLES}
315
	${INSTALL_DATA} ${WRKSRC}/conf/${f} ${EXAMPLESDIR}
316
.endfor
317
	@${ECHO_MSG} "Installed configuration examples in ${EXAMPLESDIR}"
318
.endif
297
319
298
post-install:
320
post-install:
299
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
321
	@${SETENV} ${SCRIPTS_ENV} PKG_PREFIX="${PREFIX}" ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
300
# Fix compressed man pages
322
	# Fix compressed man pages
301
	@${REINPLACE_CMD} -E -e "s|(man[158]/.*.[158]):|\1.gz:|g" ${PREFIX}/libexec/postfix/postfix-files
323
	@${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}
324
	@${CAT} ${PKGMESSAGE}
304
325
305
.include <bsd.port.post.mk>
326
.include <bsd.port.post.mk>
(-)postfix/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
MD5 (postfix/postfix-2.6.0.tar.gz) = 3674618dab2734f49182b8cba2f3186e
1
MD5 (postfix/postfix-2.6.1.tar.gz) = 737bbc245da9c72c174893397f70ae86
2
SHA256 (postfix/postfix-2.6.0.tar.gz) = 8c323d200feba72121c302f15249d56c7521ade16cf5166fadf158e6818883bd
2
SHA256 (postfix/postfix-2.6.1.tar.gz) = ccad7fb855e31c57f3551244b76be5906fcdcde09d5a6ccd144ae144e1df203c
3
SIZE (postfix/postfix-2.6.0.tar.gz) = 3324014
3
SIZE (postfix/postfix-2.6.1.tar.gz) = 3324194
(-)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 (+156 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
DAEMONDIR=${DAEMONDIR:=${PREFIX}/libexec/postfix}
13
READMEDIR=${READMEDIR:=%%READMEDIR%%}
14
EXAMPLESDIR=${EXAMPLESDIR:=%%EXAMPLESDIR%%}
15
BATCH=${BATCH:=no}
16
POSTFIX_DEFAULT_MTA=${POSTFIX_DEFAULT_MTA:=no}
17
18
if [ "${POSTFIX_DEFAULT_MTA}" = "no" ]; then
19
      DEFAULT_REPLACE_MAILERCONF=n
20
else
21
      DEFAULT_REPLACE_MAILERCONF=y
22
fi
23
24
if [ -x /usr/sbin/nologin ]; then
25
      NOLOGIN=/usr/sbin/nologin
26
else
27
      NOLOGIN=/sbin/nologin
28
fi
29
30
ask() {
31
      local question default answer
32
33
      question=$1
34
      default=$2
35
      if [ -z "${PACKAGE_BUILDING}" -a "${BATCH}" = "no" ]; then
36
	      read -p "${question} [${default}]? " answer
37
      fi
38
      if [ -z "${answer}" ]; then
39
	      answer=${default}
40
      fi
41
      echo ${answer}
42
}
43
44
yesno() {
45
      local question default answer
46
47
      question=$1
48
      default=$2
49
      while :; do
50
	      answer=$(ask "${question}" "${default}")
51
	      case "${answer}" in
52
		      [Yy]*)	return 0;;
53
		      [Nn]*)	return 1;;
54
	      esac
55
	      echo "Please answer yes or no."
56
      done
57
}
58
59
if [ "$2" = "PRE-INSTALL" ]; then
60
      USER=postfix
61
      UID=125
62
      GROUP=postfix
63
      GID=125
64
      GROUP2=maildrop
65
      GID2=126
66
67
      if /usr/sbin/pw groupshow "${GROUP}" 2>/dev/null; then
68
	      echo "You already have a group \"${GROUP}\", so I will use it."
69
      else
70
	      if /usr/sbin/pw groupadd ${GROUP} -g ${GID}; then
71
		      echo "Added group \"${GROUP}\"."
72
	      else
73
		      echo "Adding group \"${GROUP}\" failed..."
74
		      echo "Please create it, and try again."
75
		      exit 1
76
	      fi
77
      fi
78
79
      if /usr/sbin/pw groupshow "${GROUP2}" 2>/dev/null; then
80
	      echo "You already have a group \"${GROUP2}\", so I will use it."
81
      else
82
	      if /usr/sbin/pw groupadd ${GROUP2} -g ${GID2}; then
83
		      echo "Added group \"${GROUP2}\"."
84
	      else
85
		      echo "Adding group \"${GROUP2}\" failed..."
86
		      echo "Please create it, and try again."
87
		      exit 1
88
	      fi
89
      fi
90
91
      if /usr/sbin/pw user show "${USER}" 2>/dev/null; then
92
	      echo "You already have a user \"${USER}\", so I will use it."
93
      else
94
	      if /usr/sbin/pw useradd ${USER} -u ${UID} -g ${GROUP} -h - -d /var/spool/postfix -s ${NOLOGIN} -c "Postfix Mail System"; then
95
		      echo "Added user \"${USER}\"."
96
	      else
97
		      echo "Adding user \"${USER}\" failed..."
98
		      echo "Please create it, and try again."
99
		      exit 1
100
	      fi
101
      fi
102
103
      if /usr/sbin/pw show group mail | grep -q "${USER}" 2>/dev/null; then
104
	      echo "You already have user \"${USER}\" in group \"mail\", so I will use it."
105
      else
106
	      echo "You need user \"${USER}\" added to group \"mail\"."
107
	      if yesno "Would you like me to add it" y; then
108
		      /usr/sbin/pw groupmod mail -m ${USER} || exit
109
		      echo "Done."
110
	      else
111
		      echo "Please create it, and try again."
112
		      exit 1
113
	      fi
114
      fi
115
fi
116
117
if [ "$2" = "POST-INSTALL" ]; then
118
      if [ -d ${EXAMPLESDIR} ]; then
119
	      for file in ${EXAMPLESDIR}/*; do
120
		      if [ ! -f ${ETCDIR}/${file#${EXAMPLESDIR}} ]; then
121
			      cp $file ${ETCDIR}/
122
		      fi
123
	      done
124
      fi
125
      /bin/sh ${DAEMONDIR}/post-install tempdir=/tmp \
126
	daemon_directory=${DAEMONDIR} \
127
	upgrade-package
128
fi
129
130
replace() {
131
      local orig repl
132
133
	orig=$1
134
	repl=$2
135
	if [ -e ${orig} ]; then
136
		/bin/mv -f ${orig} ${orig}.OFF
137
		/bin/chmod 0 ${orig}.OFF
138
	fi
139
	if [ -e ${repl} ]; then
140
		/bin/ln -s ${repl} ${orig}
141
	fi
142
}
143
144
if [ "$2" = "POST-INSTALL" -a -z "${PACKAGE_BUILDING}" ]; then
145
	if yesno "Would you like to activate Postfix in /etc/mail/mailer.conf" ${DEFAULT_REPLACE_MAILERCONF}; then
146
		/bin/mv -f /etc/mail/mailer.conf /etc/mail/mailer.conf.old
147
		echo "#"						>	/etc/mail/mailer.conf
148
		echo -n "# Execute the Postfix sendmail program"	>>	/etc/mail/mailer.conf
149
		echo ", named ${PREFIX}/sbin/sendmail"		>>	/etc/mail/mailer.conf
150
		echo "#"						>>	/etc/mail/mailer.conf
151
		echo "sendmail	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
152
		echo "send-mail	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
153
		echo "mailq		${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
154
		echo "newaliases	${PREFIX}/sbin/sendmail"	>>	/etc/mail/mailer.conf
155
	fi
156
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