View | Details | Raw Unified | Return to bug 127200
Collapse All | Expand All

(-)dovecot/Makefile (-34 / +88 lines)
Lines 7-25 Link Here
7
#
7
#
8
8
9
PORTNAME=	dovecot
9
PORTNAME=	dovecot
10
DISTVERSION=	1.1.2
10
DISTVERSION=	1.1.3
11
PORTREVISION=	1
12
CATEGORIES=	mail ipv6
11
CATEGORIES=	mail ipv6
13
MASTER_SITES=	http://www.dovecot.org/releases/1.1/
12
MASTER_SITES=	http://www.dovecot.org/releases/1.1/
14
13
15
MAINTAINER=	yds@coolrat.org
14
MAINTAINER=	yds@CoolRat.org
16
COMMENT=	Secure and compact IMAP and POP3 servers
15
COMMENT=	Secure and compact IMAP and POP3 servers
17
16
18
USE_ICONV=	yes
17
USE_ICONV=	yes
19
USE_RC_SUBR=	dovecot.sh
18
USE_RC_SUBR=	dovecot.sh
20
19
21
GNU_CONFIGURE=	yes
20
GNU_CONFIGURE=	yes
22
CONFIGURE_ARGS=	--without-shadow --localstatedir=/var
21
CONFIGURE_TARGET=	--build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
22
CONFIGURE_ARGS=	--localstatedir=/var --without-shadow
23
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
23
CONFIGURE_ENV=	CPPFLAGS="-I${LOCALBASE}/include" \
24
		LDFLAGS="-L${LOCALBASE}/lib"
24
		LDFLAGS="-L${LOCALBASE}/lib"
25
USE_LDCONFIG=	${PREFIX}/lib/dovecot \
25
USE_LDCONFIG=	${PREFIX}/lib/dovecot \
Lines 27-51 Link Here
27
		${PREFIX}/lib/dovecot/pop3 \
27
		${PREFIX}/lib/dovecot/pop3 \
28
		${PREFIX}/lib/dovecot/lda
28
		${PREFIX}/lib/dovecot/lda
29
29
30
.if !defined(NOPORTDOCS)
30
.if defined(NOPORTDOCS)
31
PORTDOCS=	*.txt wiki
32
.else
33
CONFIGURE_ARGS+=	--without-docs
31
CONFIGURE_ARGS+=	--without-docs
32
.else
33
DOCS=		AUTHORS COPYING COPYING.LGPL COPYING.MIT INSTALL NEWS TODO README
34
PORTDOCS=	*.txt wiki ${DOCS}
34
.endif
35
.endif
35
36
36
DOVECOT_UID?=	143
37
DOVECOT_UID?=	143
37
DOVECOT_GID?=	143
38
DOVECOT_GID?=	143
38
SCRIPT_ENV+=	DOVECOT_UID=${DOVECOT_UID} \
39
39
		DOVECOT_GID=${DOVECOT_GID}
40
PROTOCOLS=	imap
40
41
41
OPTIONS=	KQUEUE		"kqueue(2) support"	on  \
42
OPTIONS=	KQUEUE		"kqueue(2) support"	on  \
42
		SSL		"SSL support"		on  \
43
		SSL		"SSL support"		on  \
43
		IPV6		"IPv6 support"		on  \
44
		IPV6		"IPv6 support"		on  \
44
		POP3		"POP3 support"		on  \
45
		POP3		"POP3 support"		on  \
45
		LDA		"LDA support"		on  \
46
		LDA		"LDA support"		on  \
46
		MANAGESIEVE	"ManageSieve support"	off  \
47
		MANAGESIEVE	"ManageSieve support"	on  \
47
		GSSAPI		"GSSAPI support"	off \
48
		GSSAPI		"GSSAPI support"	off \
48
		VPOPMAIL	"VPopMail support"	off \
49
		VPOPMAIL	"VPopMail support"	off \
50
		BDB		"BerkleyDB support"	off \
49
		LDAP		"OpenLDAP support"	off \
51
		LDAP		"OpenLDAP support"	off \
50
		PGSQL		"PostgreSQL support"	off \
52
		PGSQL		"PostgreSQL support"	off \
51
		MYSQL		"MySQL support"		off \
53
		MYSQL		"MySQL support"		off \
Lines 56-61 Link Here
56
# Default requirement for dovecot rc script
58
# Default requirement for dovecot rc script
57
_REQUIRE=	LOGIN
59
_REQUIRE=	LOGIN
58
60
61
# sed script for dovecot.conf
62
SED_CONF=	s!%%PROTOCOLS%%!${PROTOCOLS}!g;\
63
		s!/usr/!${PREFIX}/!g;\
64
		s!=/usr!=${PREFIX}!g;\
65
		s!=/etc !=${PREFIX}/etc !g;\
66
		s!/etc/dovecot!${PREFIX}&!g;\
67
		s![[:<:]]doc/(dovecot-[^-]+)-example.conf[[:>:]]!${EXAMPLESDIR}/\1.conf!g;\
68
		s!\#sendmail_path = /usr/.*!sendmail_path = /usr/sbin/sendmail!g;
69
59
## kqueue(2) support
70
## kqueue(2) support
60
#
71
#
61
.if !defined(WITHOUT_KQUEUE)
72
.if !defined(WITHOUT_KQUEUE)
Lines 64-70 Link Here
64
75
65
## SSL support
76
## SSL support
66
#
77
#
67
.if defined(WITHOUT_SSL)
78
.if defined(WITH_SSL) && !defined(WITHOUT_SSL)
79
PROTOCOLS+=	imaps
80
.else
68
CONFIGURE_ARGS+=	--without-ssl
81
CONFIGURE_ARGS+=	--without-ssl
69
.endif
82
.endif
70
83
Lines 78-87 Link Here
78
#
91
#
79
.if defined(WITHOUT_POP3)
92
.if defined(WITHOUT_POP3)
80
CONFIGURE_ARGS+=	--without-pop3d
93
CONFIGURE_ARGS+=	--without-pop3d
81
PROTOCOLS=		imap
82
PLIST_SUB+=		POP3="@comment "
94
PLIST_SUB+=		POP3="@comment "
83
.else
95
.else
84
PROTOCOLS=		imap pop3
96
PROTOCOLS+=		pop3
97
.if defined(WITH_SSL) && !defined(WITHOUT_SSL)
98
PROTOCOLS+=		pop3s
99
.endif
85
PLIST_SUB+=		POP3=""
100
PLIST_SUB+=		POP3=""
86
.endif
101
.endif
87
102
Lines 96-111 Link Here
96
111
97
## ManageSieve support
112
## ManageSieve support
98
#
113
#
99
.if defined(WITH_MANAGESIEVE)
114
.if defined(WITH_MANAGESIEVE) && !defined(WITHOUT_MANAGESIEVE)
100
MANAGESIEVEVERSION!=	${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V PORTVERSION
115
MANAGESIEVEVERSION!=	${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V PORTVERSION
101
PATCH_SITES!=		${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V MASTER_SITES
116
PATCH_SITES!=		${MAKE} -C ${.CURDIR}/../dovecot-managesieve -V MASTER_SITES
102
PATCHFILES+=		dovecot-${PORTVERSION}-managesieve-${MANAGESIEVEVERSION}.diff.gz
117
PATCHFILES+=		dovecot-${PORTVERSION}-managesieve-${MANAGESIEVEVERSION}.diff.gz
103
PATCH_DIST_STRIP=	-p1
118
PATCH_DIST_STRIP=	-p1
119
PROTOCOLS+=		managesieve
120
DOCS+=			README.managesieve
104
.endif
121
.endif
105
122
106
## GSSAPI support
123
## GSSAPI support
107
#
124
#
108
.if defined(WITH_GSSAPI)
125
.if defined(WITH_GSSAPI) && !defined(WITHOUT_GSSAPI)
109
CONFIGURE_ARGS+=	--with-gssapi
126
CONFIGURE_ARGS+=	--with-gssapi
110
.else
127
.else
111
CONFIGURE_ARGS+=	--without-gssapi
128
CONFIGURE_ARGS+=	--without-gssapi
Lines 113-119 Link Here
113
130
114
## VPopMail Support
131
## VPopMail Support
115
#
132
#
116
.if defined(WITH_VPOPMAIL)
133
.if defined(WITH_VPOPMAIL) && !defined(WITHOUT_VPOPMAIL)
117
VPOPMAIL=		${LOCALBASE}/vpopmail/bin/vchkpw
134
VPOPMAIL=		${LOCALBASE}/vpopmail/bin/vchkpw
118
BUILD_DEPENDS+=		${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
135
BUILD_DEPENDS+=		${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
119
CONFIGURE_ARGS+=	--with-vpopmail
136
CONFIGURE_ARGS+=	--with-vpopmail
Lines 121-187 Link Here
121
CONFIGURE_ARGS+=	--without-vpopmail
138
CONFIGURE_ARGS+=	--without-vpopmail
122
.endif
139
.endif
123
140
141
## BDB Support
142
#
143
.if defined(WITH_BDB) && !defined(WITHOUT_BDB)
144
USE_BDB=		yes
145
CONFIGURE_ARGS+=	--with-db
146
CFLAGS+=		-I${BDB_INCLUDE_DIR} -L${BDB_LIB_DIR}
147
PLIST_SUB+=		BDB=""
148
SED_CONF+=		s!^\#(dict_db_config)!\1!;
149
.else
150
PLIST_SUB+=		BDB="@comment "
151
.endif
152
124
## OpenLDAP Support
153
## OpenLDAP Support
125
#
154
#
126
.if defined(WITH_LDAP)
155
.if defined(WITH_LDAP) && !defined(WITHOUT_LDAP)
127
USE_OPENLDAP=		yes
156
USE_OPENLDAP=		yes
128
CONFIGURE_ARGS+=	--with-ldap
157
CONFIGURE_ARGS+=	--with-ldap
158
PLIST_SUB+=		LDAP=""
129
_REQUIRE+=		slapd
159
_REQUIRE+=		slapd
130
.else
160
.else
131
CONFIGURE_ARGS+=	--without-ldap
161
CONFIGURE_ARGS+=	--without-ldap
162
PLIST_SUB+=		LDAP="@comment "
132
.endif
163
.endif
133
164
134
## PostgreSQL Support
165
## PostgreSQL Support
135
#
166
#
136
.if defined(WITH_PGSQL)
167
.if defined(WITH_PGSQL) && !defined(WITHOUT_PGSQL)
137
USE_PGSQL=		yes
168
USE_PGSQL=		yes
138
CONFIGURE_ARGS+=	--with-pgsql
169
CONFIGURE_ARGS+=	--with-pgsql
170
PLIST_SUB+=		SQL=""
139
_REQUIRE+=		postgresql
171
_REQUIRE+=		postgresql
140
.else
172
.else
141
CONFIGURE_ARGS+=	--without-pgsql
173
CONFIGURE_ARGS+=	--without-pgsql
174
PLIST_SUB+=		SQL="@comment "
142
.endif
175
.endif
143
176
144
## MySQL Support
177
## MySQL Support
145
#
178
#
146
.if defined(WITH_MYSQL)
179
.if defined(WITH_MYSQL) && !defined(WITHOUT_MYSQL)
147
USE_MYSQL=		yes
180
USE_MYSQL=		yes
148
CONFIGURE_ARGS+=	--with-mysql
181
CONFIGURE_ARGS+=	--with-mysql
182
PLIST_SUB+=		SQL=""
149
_REQUIRE+=		mysql
183
_REQUIRE+=		mysql
150
.else
184
.else
151
CONFIGURE_ARGS+=	--without-mysql
185
CONFIGURE_ARGS+=	--without-mysql
186
PLIST_SUB+=		SQL="@comment "
152
.endif
187
.endif
153
188
154
## SQLite Support
189
## SQLite Support
155
#
190
#
156
.if defined(WITH_SQLITE)
191
.if defined(WITH_SQLITE) && !defined(WITHOUT_SQLITE)
157
USE_SQLITE=		3
192
USE_SQLITE=		3
158
CONFIGURE_ARGS+=	--with-sqlite
193
CONFIGURE_ARGS+=	--with-sqlite
194
PLIST_SUB+=		SQL=""
159
.else
195
.else
160
CONFIGURE_ARGS+=	--without-sqlite
196
CONFIGURE_ARGS+=	--without-sqlite
197
PLIST_SUB+=		SQL="@comment "
161
.endif
198
.endif
162
199
163
SUB_LIST+=		REQUIRE="${_REQUIRE}"
200
SUB_LIST+=		REQUIRE="${_REQUIRE}" DOVECOT_UID=${DOVECOT_UID} DOVECOT_GID=${DOVECOT_GID}
201
SUB_FILES+=		pkg-install pkg-deinstall
164
202
165
post-patch:
203
post-patch:
166
.if defined(WITH_GSSAPI)
204
	@${REINPLACE_CMD} -E -e '${SED_CONF}' \
167
	@${REINPLACE_CMD} -e 's,<gssapi/gssapi\.h>,<gssapi.h>,' \
168
		${WRKSRC}/src/auth/mech-gssapi.c \
169
		${WRKSRC}/configure
170
.endif
171
172
post-build:
173
	@${REINPLACE_CMD} \
174
		-e 's,%%PREFIX%%,${PREFIX},g' \
175
		-e 's,%%PROTOCOLS%%,${PROTOCOLS},g' \
176
		${WRKSRC}/dovecot-example.conf
205
		${WRKSRC}/dovecot-example.conf
206
	@${REINPLACE_CMD} -E -e'\
207
		s!-example\.conf[[:>:]]!.conf!g;\
208
		s!^(confdir[[:space:]]+=[[:space:]]+)\$$\(sysconfdir\)!\1${EXAMPLESDIR}!g;\
209
		' ${WRKSRC}/*/Makefile.in ${WRKSRC}/Makefile.in
210
.if defined(WITH_GSSAPI)
211
	@${REINPLACE_CMD} -e '\
212
		s!<gssapi/gssapi\.h>!<gssapi.h>!;\
213
		' ${WRKSRC}/src/auth/mech-gssapi.c ${WRKSRC}/configure
214
.endif
215
	@${LN} -f ${WRKSRC}/dovecot-example.conf		${WRKSRC}/dovecot.conf
216
	@${LN} -f ${WRKSRC}/doc/dovecot-db-example.conf		${WRKSRC}/doc/dovecot-db.conf
217
	@${LN} -f ${WRKSRC}/doc/dovecot-ldap-example.conf	${WRKSRC}/doc/dovecot-ldap.conf
218
	@${LN} -f ${WRKSRC}/doc/dovecot-sql-example.conf	${WRKSRC}/doc/dovecot-sql.conf
177
219
178
pre-install:
220
pre-install:
179
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
221
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
180
222
181
post-install:
223
post-install:
182
	@${MKDIR} ${DATADIR}
224
	${INSTALL_DATA} ${WRKSRC}/dovecot.conf ${EXAMPLESDIR}
183
	${INSTALL_SCRIPT} ${WRKSRC}/doc/mkcert.sh ${DATADIR}
225
	${INSTALL_DATA} ${WRKSRC}/doc/dovecot-db.conf ${EXAMPLESDIR}
184
	${INSTALL_DATA} ${WRKSRC}/doc/dovecot-openssl.cnf ${DATADIR}
226
	${INSTALL_DATA} ${WRKSRC}/doc/dovecot-ldap.conf ${EXAMPLESDIR}
227
	${INSTALL_DATA} ${WRKSRC}/doc/dovecot-sql.conf ${EXAMPLESDIR}
228
	${INSTALL_DATA} ${WRKSRC}/doc/dovecot-openssl.cnf ${EXAMPLESDIR}
229
	${INSTALL_SCRIPT} ${WRKSRC}/doc/mkcert.sh ${EXAMPLESDIR}
230
	@${GREP} '^@exec ' ${TMPPLIST} \
231
		| ${SED} -e 's:^@exec ::; s:%D:${PREFIX}:g;' \
232
		> ${WRKDIR}/.PLIST.exec \
233
		&& ${SH} ${WRKDIR}/.PLIST.exec
234
.if !defined(NOPORTDOCS)
235
.for f in ${DOCS}
236
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
237
.endfor
238
.endif
185
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
239
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
186
	@${CAT} ${PKGMESSAGE}
240
	@${CAT} ${PKGMESSAGE}
187
241
(-)dovecot/distinfo (-6 / +6 lines)
Lines 1-6 Link Here
1
MD5 (dovecot-1.1.2.tar.gz) = fcebb6c099421049632b2f1f019f55cd
1
MD5 (dovecot-1.1.3.tar.gz) = 103ff0ffb4bcb37f22c27779553e48bc
2
SHA256 (dovecot-1.1.2.tar.gz) = 693981dbaa3bfda0796a88995b42c17f8c48d3cc8630a4762557db01170ca91e
2
SHA256 (dovecot-1.1.3.tar.gz) = e07d52e6d61a653672c5173d6d27fe119970c792478cbbd23b87f9fdfc0c13c7
3
SIZE (dovecot-1.1.2.tar.gz) = 2300564
3
SIZE (dovecot-1.1.3.tar.gz) = 2306933
4
MD5 (dovecot-1.1.2-managesieve-0.10.3.diff.gz) = 72e1532ddd5df4ee5f8cf190a1b53cfe
4
MD5 (dovecot-1.1.3-managesieve-0.10.3.diff.gz) = 3e1755a2ca4dab1a8d1cb00d8ea9e451
5
SHA256 (dovecot-1.1.2-managesieve-0.10.3.diff.gz) = 67a2b7ca49d5dc96e57b534008593c9702cecd768801aaba2f588087e5fe5980
5
SHA256 (dovecot-1.1.3-managesieve-0.10.3.diff.gz) = 045520404c0928e63a7127d9a38b7c12ff68ff74dc423f88f8af9e93f129e756
6
SIZE (dovecot-1.1.2-managesieve-0.10.3.diff.gz) = 6117
6
SIZE (dovecot-1.1.3-managesieve-0.10.3.diff.gz) = 5837
(-)dovecot/files/dovecot.sh.in (-4 / +15 lines)
Lines 7-26 Link Here
7
# REQUIRE: %%REQUIRE%%
7
# REQUIRE: %%REQUIRE%%
8
# KEYWORD: shutdown
8
# KEYWORD: shutdown
9
9
10
# Define these dovecot_* variables in one of these files:
11
#	/etc/rc.conf
12
#	/etc/rc.conf.local
13
#	/etc/rc.conf.d/dovecot
10
#
14
#
11
# Add the following lines to /etc/rc.conf to enable dovecot:
15
# DO NOT CHANGE THESE DEFAULT VALUES HERE
12
#
13
#dovecot_enable="YES"
14
#
16
#
17
: ${dovecot_enable:="NO"}
15
18
16
. %%RC_SUBR%%
19
. %%RC_SUBR%%
17
20
18
name=dovecot
21
name=dovecot
19
rcvar=`set_rcvar`
22
rcvar=`set_rcvar`
20
23
21
: ${dovecot_enable:="NO"}
22
command=%%PREFIX%%/sbin/${name}
24
command=%%PREFIX%%/sbin/${name}
23
required_files=%%PREFIX%%/etc/${name}.conf
25
required_files=%%PREFIX%%/etc/${name}.conf
26
start_precmd="${name}_prestart"
27
extra_commands="restart"
28
29
dovecot_prestart()
30
{	# Ensure runtime directories exist with correct permissions
31
	base=/var/run/dovecot
32
	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
33
	/usr/bin/install -o root -g dovecot -m 0750 -d ${base}/login
34
}
24
35
25
load_rc_config ${name}
36
load_rc_config ${name}
26
run_rc_command "$1"
37
run_rc_command "$1"
(-)dovecot/files/patch-configure (+10 lines)
Line 0 Link Here
1
--- configure.orig	2008-07-23 19:47:03.000000000 -0400
2
+++ configure	2008-08-01 07:13:03.765264947 -0400
3
@@ -1003,6 +1003,7 @@
4
 includedir='${prefix}/include'
5
 oldincludedir='/usr/include'
6
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
7
+examplesdir='${datarootdir}/examples/${PACKAGE_TARNAME}'
8
 infodir='${datarootdir}/info'
9
 htmldir='${docdir}'
10
 dvidir='${docdir}'
(-)dovecot/files/patch-dovecot-example.conf (-145 / +220 lines)
Lines 1-213 Link Here
1
--- dovecot-example.conf.orig	2008-06-21 21:21:38.422213158 +0100
1
--- dovecot-example.conf.orig	2008-08-28 06:53:28.000000000 -0400
2
+++ dovecot-example.conf	2008-06-21 21:29:47.638914442 +0100
2
+++ dovecot-example.conf	2008-08-28 06:53:28.000000000 -0400
3
@@ -12,7 +12,7 @@
3
@@ -20,7 +20,7 @@
4
 # Default values are shown for each setting, it's not required to uncomment
5
 # any of the lines. Exception to this are paths, they're just examples with
6
 # the real defaults being based on configure options. The paths listed here
7
-# are for configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var
8
+# are for configure --prefix=%%PREFIX%% --sysconfdir=%%PREFIX%%/etc --localstatedir=/var
9
 # --with-ssldir=/etc/ssl
10
 
4
 
11
 # Base directory where to store runtime data.
12
@@ -21,6 +21,7 @@
13
 # Protocols we want to be serving: imap imaps pop3 pop3s
5
 # Protocols we want to be serving: imap imaps pop3 pop3s
14
 # If you only want to use dovecot-auth, you can set this to "none".
6
 # If you only want to use dovecot-auth, you can set this to "none".
15
 #protocols = imap imaps
7
-#protocols = imap imaps
16
+protocols = %%PROTOCOLS%%
8
+protocols = %%PROTOCOLS%%
17
 
9
 
18
 # A space separated list of IP or host addresses where to listen in for
10
 # A space separated list of IP or host addresses where to listen in for
19
 # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
11
 # connections. "*" listens in all IPv4 interfaces. "[::]" listens in all IPv6
20
@@ -213,6 +214,7 @@
12
@@ -44,7 +44,7 @@
13
 # SSL/TLS is used (LOGINDISABLED capability). Note that if the remote IP
14
 # matches the local IP (ie. you're connecting from the same computer), the
15
 # connection is considered secure and plaintext authentication is allowed.
16
-#disable_plaintext_auth = yes
17
+disable_plaintext_auth = no
18
 
19
 # Should all IMAP and POP3 processes be killed when Dovecot master process
20
 # shuts down. Setting this to "no" means that Dovecot can be upgraded without
21
@@ -211,7 +211,7 @@
22
 #
21
 # <doc/wiki/MailLocation.txt>
23
 # <doc/wiki/MailLocation.txt>
22
 #
24
 #
23
 #mail_location = 
25
-#mail_location = 
24
+mail_location = mbox:~/mail/:INBOX=/var/mail/%u
26
+mail_location = mbox:~/mail/:INBOX=/var/mail/%u
25
 
27
 
26
 # If you need to set multiple mailbox locations or want to change default
28
 # If you need to set multiple mailbox locations or want to change default
27
 # namespace settings, you can do it by defining namespace sections.
29
 # namespace settings, you can do it by defining namespace sections.
28
@@ -273,6 +275,7 @@
30
@@ -271,7 +271,7 @@
31
 # Group to enable temporarily for privileged operations. Currently this is
29
 # used only with INBOX when either its initial creation or dotlocking fails.
32
 # used only with INBOX when either its initial creation or dotlocking fails.
30
 # Typically this is set to "mail" to give access to /var/mail.
33
 # Typically this is set to "mail" to give access to /var/mail.
31
 #mail_privileged_group =
34
-#mail_privileged_group =
32
+mail_privileged_group = mail
35
+mail_privileged_group = mail
33
 
36
 
34
 # Grant access to these supplementary groups for mail processes. Typically
37
 # Grant access to these supplementary groups for mail processes. Typically
35
 # these are used to set up access to shared mailboxes. Note that it may be
38
 # these are used to set up access to shared mailboxes. Note that it may be
36
@@ -340,6 +343,7 @@
39
@@ -310,7 +310,7 @@
40
 
41
 # Rely on O_EXCL to work when creating dotlock files. NFS supports O_EXCL
42
 # since version 3, so this should be safe to use nowadays by default.
43
-#dotlock_use_excl = yes
44
+dotlock_use_excl = yes
45
 
46
 # Don't use fsync() or fdatasync() calls. This makes the performance better
47
 # at the cost of potential data loss if the server (or the file server)
48
@@ -338,20 +338,20 @@
49
 # Show more verbose process titles (in ps). Currently shows user name and
37
 # IP address. Useful for seeing who are actually using the IMAP processes
50
 # IP address. Useful for seeing who are actually using the IMAP processes
38
 # (eg. shared mailboxes or if same uid is used for multiple accounts).
51
 # (eg. shared mailboxes or if same uid is used for multiple accounts).
39
 #verbose_proctitle = no
52
-#verbose_proctitle = no
40
+verbose_proctitle = yes
53
+verbose_proctitle = yes
41
 
54
 
42
 # Valid UID range for users, defaults to 500 and above. This is mostly
55
 # Valid UID range for users, defaults to 500 and above. This is mostly
43
 # to make sure that users can't log in as daemons or other system users.
56
 # to make sure that users can't log in as daemons or other system users.
44
@@ -353,6 +357,7 @@
57
 # Note that denying root logins is hardcoded to dovecot binary and can't
58
 # be done even if first_valid_uid is set to 0.
59
-#first_valid_uid = 500
60
+first_valid_uid = 1000
61
 #last_valid_uid = 0
62
 
63
 # Valid GID range for users, defaults to non-root/wheel. Users having
64
 # non-valid GID as primary group ID aren't allowed to log in. If user
45
 # belongs to supplementary groups with non-valid GIDs, those groups are
65
 # belongs to supplementary groups with non-valid GIDs, those groups are
46
 # not set.
66
 # not set.
47
 #first_valid_gid = 1
67
-#first_valid_gid = 1
48
+first_valid_gid = 0
68
+first_valid_gid = 1000
49
 #last_valid_gid = 0
69
 #last_valid_gid = 0
50
 
70
 
51
 # Maximum number of running mail processes. When this limit is reached,
71
 # Maximum number of running mail processes. When this limit is reached,
52
@@ -503,19 +508,19 @@
72
@@ -418,7 +418,7 @@
53
 
73
 
54
 protocol imap {
74
 # When copying a message, do it with hard links whenever possible. This makes
55
   # Login executable location.
75
 # the performance much better, and it's unlikely to have any side effects.
56
-  #login_executable = /usr/libexec/dovecot/imap-login
76
-#maildir_copy_with_hardlinks = yes
57
+  #login_executable = %%PREFIX%%/libexec/dovecot/imap-login
77
+maildir_copy_with_hardlinks = yes
58
 
78
 
59
   # IMAP executable location. Changing this allows you to execute other
79
 # When copying a message, try to preserve the base filename. Only if the
60
   # binaries before the imap process is executed.
80
 # destination mailbox already contains the same name (ie. the mail is being
61
   #
81
@@ -426,7 +426,7 @@
62
   # This would write rawlogs into ~/dovecot.rawlog/ directory:
82
 # done only by looking at dovecot-uidlist file, so if something outside
63
-  #   mail_executable = /usr/libexec/dovecot/rawlog /usr/libexec/dovecot/imap
83
 # Dovecot does similar filename preserving copies, you may run into problems.
64
+  #   mail_executable = %%PREFIX%%/libexec/dovecot/rawlog %%PREFIX%%/libexec/dovecot/imap
84
 # NOTE: This setting requires maildir_copy_with_hardlinks = yes to work.
65
   #
85
-#maildir_copy_preserve_filename = no
66
   # This would attach gdb into the imap process and write backtraces into
86
+maildir_copy_preserve_filename = yes
67
   # /tmp/gdbhelper.* files:
68
-  #   mail_executable = /usr/libexec/dovecot/gdbhelper /usr/libexec/dovecot/imap
69
+  #   mail_executable = %%PREFIX%%/libexec/dovecot/gdbhelper %%PREFIX%%/libexec/dovecot/imap
70
   #
71
-  #mail_executable = /usr/libexec/dovecot/imap
72
+  #mail_executable = %%PREFIX%%/libexec/dovecot/imap
73
 
74
   # Maximum IMAP command line length in bytes. Some clients generate very long
75
   # command lines with huge mailboxes, so you may need to raise this if you get
76
@@ -529,7 +534,7 @@
77
   # Support for dynamically loadable plugins. mail_plugins is a space separated
78
   # list of plugins to load.
79
   #mail_plugins = 
80
-  #mail_plugin_dir = /usr/lib/dovecot/imap
81
+  #mail_plugin_dir = %%PREFIX%%/lib/dovecot/imap
82
 
87
 
88
 ##
89
 ## mbox-specific settings
90
@@ -533,7 +533,7 @@
83
   # Send IMAP capabilities in greeting message. This makes it unnecessary for
91
   # Send IMAP capabilities in greeting message. This makes it unnecessary for
84
   # clients to request it with CAPABILITY command, so it saves one round-trip.
92
   # clients to request it with CAPABILITY command, so it saves one round-trip.
85
@@ -564,6 +569,7 @@
93
   # Many clients however don't understand it and ask the CAPABILITY anyway.
94
-  #login_greeting_capability = no
95
+  login_greeting_capability = yes
96
 
97
   # IMAP logout format string:
98
   #  %i - total number of bytes read from client
99
@@ -562,7 +562,7 @@
100
   #     but not both. Thunderbird separates these two by forcing server to
86
   #     accept '/' suffix in mailbox names in subscriptions list.
101
   #     accept '/' suffix in mailbox names in subscriptions list.
87
   # The list is space-separated.
102
   # The list is space-separated.
88
   #imap_client_workarounds = 
103
-  #imap_client_workarounds = 
89
+  imap_client_workarounds = delay-newmail netscape-eoh tb-extra-mailbox-sep
104
+  imap_client_workarounds = delay-newmail netscape-eoh tb-extra-mailbox-sep
90
 }
105
 }
91
   
106
   
92
 ##
107
 ##
93
@@ -572,11 +578,11 @@
108
@@ -585,7 +585,7 @@
109
   # Support LAST command which exists in old POP3 specs, but has been removed
110
   # from new ones. Some clients still wish to use this though. Enabling this
111
   # makes RSET command clear all \Seen flags from messages.
112
-  #pop3_enable_last = no
113
+  pop3_enable_last = yes
114
 
115
   # If mail has X-UIDL header, use it as the mail's UIDL.
116
   #pop3_reuse_xuidl = no
117
@@ -614,7 +614,7 @@
118
   # Dovecot's default, so if you're building a new server it would be a good
119
   # idea to change this. %08Xu%08Xv should be pretty fail-safe.
120
   #
121
-  #pop3_uidl_format = %08Xu%08Xv
122
+  pop3_uidl_format = %08Xu%08Xv
94
 
123
 
95
 protocol pop3 {
124
   # POP3 logout format string:
96
   # Login executable location.
125
   #  %i - total number of bytes read from client
97
-  #login_executable = /usr/libexec/dovecot/pop3-login
126
@@ -645,7 +645,7 @@
98
+  #login_executable = %%PREFIX%%/libexec/dovecot/pop3-login
127
   #     Outlook Express and Netscape Mail breaks if end of headers-line is
99
 
100
   # POP3 executable location. See IMAP's mail_executable above for examples
101
   # how this could be changed.
102
-  #mail_executable = /usr/libexec/dovecot/pop3
103
+  #mail_executable = %%PREFIX%%/libexec/dovecot/pop3
104
 
105
   # Don't try to set mails non-recent or seen with POP3 sessions. This is
106
   # mostly intended to reduce disk I/O. With maildir it doesn't move files
107
@@ -636,7 +642,7 @@
108
   # Support for dynamically loadable plugins. mail_plugins is a space separated
109
   # list of plugins to load.
110
   #mail_plugins = 
111
-  #mail_plugin_dir = /usr/lib/dovecot/pop3
112
+  #mail_plugin_dir = %%PREFIX%%/lib/dovecot/pop3
113
 
114
   # Workarounds for various client bugs:
115
   #   outlook-no-nuls:
116
@@ -647,6 +653,7 @@
117
   #     missing. This option simply sends it if it's missing.
128
   #     missing. This option simply sends it if it's missing.
118
   # The list is space-separated.
129
   # The list is space-separated.
119
   #pop3_client_workarounds = 
130
-  #pop3_client_workarounds = 
120
+  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
131
+  pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
121
 }
132
 }
122
 
133
 
123
 ##
134
 ##
124
@@ -664,7 +671,7 @@
135
@@ -667,7 +667,7 @@
125
   # Support for dynamically loadable plugins. mail_plugins is a space separated
126
   # list of plugins to load.
127
   #mail_plugins = 
128
-  #mail_plugin_dir = /usr/lib/dovecot/lda
129
+  #mail_plugin_dir = %%PREFIX%%/lib/dovecot/lda
130
 
136
 
131
   # If user is over quota, return with temporary failure instead of
137
   # If user is over quota, return with temporary failure instead of
132
   # bouncing the mail.
138
   # bouncing the mail.
133
@@ -679,6 +686,7 @@
139
-  #quota_full_tempfail = no
140
+  quota_full_tempfail = yes
134
 
141
 
135
   # Binary to use for sending mails.
142
   # Format to use for logging mail deliveries. You can use variables:
136
   #sendmail_path = /usr/lib/sendmail
143
   #  %$ - Delivery status message (e.g. "saved to INBOX")
137
+  sendmail_path = /usr/sbin/sendmail
144
@@ -736,7 +736,7 @@
138
 
145
 # the standard variables here, eg. %Lu would lowercase the username, %n would
139
   # Human readable error message for rejection mails. Use can use variables:
146
 # drop away the domain if it was given, or "%n-AT-%d" would change the '@' into
140
   #  %n = CRLF, %r = reason, %s = subject, %t = recipient
147
 # "-AT-". This translation is done after auth_username_translation changes.
141
@@ -693,7 +701,7 @@
148
-#auth_username_format =
142
 ##
149
+auth_username_format = %Ln
150
 
151
 # If you want to allow master users to log in by specifying the master
152
 # username within the normal username string (ie. not using SASL mechanism's
153
@@ -792,7 +792,7 @@
154
   #   plain login digest-md5 cram-md5 ntlm rpa apop anonymous gssapi otp skey
155
   #   gss-spnego
156
   # NOTE: See also disable_plaintext_auth setting.
157
-  mechanisms = plain
158
+  mechanisms = plain login
143
 
159
 
144
 # Executable location
160
   #
145
-#auth_executable = /usr/libexec/dovecot/dovecot-auth
161
   # Password database is used to verify user's password (and nothing more).
146
+#auth_executable = %%PREFIX%%/libexec/dovecot/dovecot-auth
162
@@ -854,6 +854,7 @@
147
 
163
     #   args = session=yes %Ls
148
 # Set max. process size in megabytes.
164
     #   args = cache_key=%u dovecot
149
 #auth_process_size = 256
165
     #args = dovecot
150
@@ -783,7 +791,7 @@
166
+    args = session=yes dovecot
151
 #auth_ntlm_use_winbind = no
167
   }
152
 
168
 
153
 # Path for Samba's ntlm_auth helper binary.
169
   # System users (NSS, /etc/passwd, or similiar)
154
-#auth_winbind_helper_path = /usr/bin/ntlm_auth
170
@@ -897,14 +898,16 @@
155
+#auth_winbind_helper_path = %%PREFIX%%/bin/ntlm_auth
171
 
156
 
172
   # SQL database <doc/wiki/AuthDatabase.SQL.txt>
157
 # Number of seconds to delay before replying to failed authentications.
173
   #passdb sql {
158
 #auth_failure_delay = 2
174
-    # Path for SQL configuration file, see doc/dovecot-sql-example.conf
159
@@ -816,7 +824,7 @@
175
-    #args = 
160
 
176
+    # Path for SQL configuration file.
161
   #passdb passwd-file {
177
+    # See doc/dovecot-sql-example.conf
162
     # File contains a list of usernames, one per line
178
+    #args = /etc/dovecot-sql.conf
163
-    #args = /etc/dovecot.deny
179
   #}
164
+    #args = %%PREFIX%%/etc/dovecot.deny
180
 
165
     #deny = yes
181
   # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
182
   #passdb ldap {
183
-    # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
184
-    #args = 
185
+    # Path for LDAP configuration file.
186
+    # See doc/dovecot-ldap-example.conf
187
+    #args = /etc/dovecot-ldap.conf
188
   #}
189
 
190
   # vpopmail authentication <doc/wiki/AuthDatabase.VPopMail.txt>
191
@@ -931,7 +934,7 @@
192
     # proceses. Useful with remote NSS lookups that may block.
193
     # NOTE: Be sure to use this setting with nss_ldap or users might get
194
     # logged in as each others!
195
-    #args = 
196
+    args = blocking=yes
197
   }
198
 
199
   # passwd-like file with specified location
200
@@ -960,14 +963,16 @@
201
 
202
   # SQL database <doc/wiki/AuthDatabase.SQL.txt>
203
   #userdb sql {
204
-    # Path for SQL configuration file, see doc/dovecot-sql-example.conf
205
-    #args = 
206
+    # Path for SQL configuration file.
207
+    # See doc/dovecot-sql-example.conf
208
+    #args = /etc/dovecot-sql.conf
166
   #}
209
   #}
167
 
210
 
168
@@ -1053,7 +1061,7 @@
211
   # LDAP database <doc/wiki/AuthDatabase.LDAP.txt>
169
 # referenced using URIs in format "proxy:<name>".
212
   #userdb ldap {
213
-    # Path for LDAP configuration file, see doc/dovecot-ldap-example.conf
214
-    #args = 
215
+    # Path for LDAP configuration file.
216
+    # See doc/dovecot-ldap-example.conf
217
+    #args = /etc/dovecot-ldap.conf
218
   #}
219
 
220
   # vpopmail <doc/wiki/AuthDatabase.VPopMail.txt>
221
@@ -1007,25 +1012,25 @@
222
   #ssl_username_from_cert = no
223
 
224
   # It's possible to export the authentication interface to other programs:
225
-  #socket listen {
226
-    #master {
227
+  socket listen {
228
+    master {
229
       # Master socket provides access to userdb information. It's typically
230
       # used to give Dovecot's local delivery agent access to userdb so it
231
       # can find mailbox locations.
232
-      #path = /var/run/dovecot/auth-master
233
-      #mode = 0600
234
+      path = /var/run/dovecot/auth-master
235
+      mode = 0600
236
       # Default user/group is the one who started dovecot-auth (root)
237
       #user = 
238
       #group = 
239
-    #}
240
-    #client {
241
+    }
242
+    client {
243
       # The client socket is generally safe to export to everyone. Typical use
244
       # is to export it to your SMTP server so it can do SMTP AUTH lookups
245
       # using it.
246
-      #path = /var/run/dovecot/auth-client
247
-      #mode = 0660
248
-    #}
249
-  #}
250
+      path = /var/run/dovecot/auth-client
251
+      mode = 0660
252
+    }
253
+  }
254
 }
170
 
255
 
171
 dict {
256
 # If you wish to use another authentication server than dovecot-auth, you can
172
-  #quota = mysql:/etc/dovecot-dict-quota.conf 
257
@@ -1055,8 +1060,9 @@
173
+  #quota = mysql:%%PREFIX%%/etc/dovecot-dict-quota.conf 
258
   #quota = mysql:/etc/dovecot-dict-quota.conf 
174
 }
259
 }
175
 
260
 
176
 # Path to Berkeley DB's configuration file. See doc/dovecot-db.conf for an
261
-# Path to Berkeley DB's configuration file. See doc/dovecot-db-example.conf
177
@@ -1095,8 +1103,8 @@
262
-#dict_db_config = 
263
+# Path to Berkeley DB's configuration file.
264
+# See doc/dovecot-db-example.conf
265
+#dict_db_config = /etc/dovecot-db.conf
266
 
267
 ##
268
 ## Plugin settings
269
@@ -1093,8 +1099,8 @@
178
   # Each quota root has separate limits. Only the command for the first
270
   # Each quota root has separate limits. Only the command for the first
179
   # exceeded limit is excecuted, so put the highest limit first.
271
   # exceeded limit is excecuted, so put the highest limit first.
180
   # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
272
   # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
181
-  #   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
273
-  #   quota_warning = storage=95%% /usr/local/bin/quota-warning.sh 95
182
-  #   quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
274
-  #   quota_warning2 = storage=80%% /usr/local/bin/quota-warning.sh 80
183
+  #   quota_warning = storage=95%% %%PREFIX%%/local/bin/quota-warning.sh 95
275
+  #   quota_warning = storage=95%% /usr/bin/quota-warning.sh 95
184
+  #   quota_warning2 = storage=80%% %%PREFIX%%/local/bin/quota-warning.sh 80
276
+  #   quota_warning2 = storage=80%% /usr/bin/quota-warning.sh 80
185
   #quota = maildir
277
   #quota = maildir
186
 
278
 
187
   # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir
279
   # ACL plugin. vfile backend reads ACLs from "dovecot-acl" file from maildir
188
@@ -1105,7 +1113,7 @@
280
@@ -1131,7 +1137,7 @@
189
   # one file for each mailbox, eg. INBOX or sub.mailbox. cache_secs parameter
190
   # specifies how many seconds to wait between stat()ing dovecot-acl file
191
   # to see if it changed.
192
-  #acl = vfile:/etc/dovecot-acls:cache_secs=300
193
+  #acl = vfile:%%PREFIX%%/etc/dovecot-acls:cache_secs=300
194
 
195
   # Convert plugin. If set, specifies the source storage path which is
196
   # converted to destination storage (mail_location) when the user logs in.
197
@@ -1124,14 +1132,14 @@
198
   # until the message can be saved within quota limits. The configuration file
199
   # is a text file where each line is in format: <priority> <mailbox name>
200
   # Mails are first deleted in lowest -> highest priority number order
201
-  #trash = /etc/dovecot-trash.conf
202
+  #trash = %%PREFIX%%/etc/dovecot-trash.conf
203
 
204
   # Expire plugin. Mails are expunged from mailboxes after being there the
205
   # configurable time. The first expiration date for each mailbox is stored in
206
   # a dictionary so it can be quickly determined which mailboxes contain
207
   # expired mails. The actual expunging is done in a nightly cronjob, which
208
   # you must set up:
281
   # you must set up:
209
-  #   dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
282
   #   dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool
210
+  #   dovecot --exec-mail ext %%PREFIX%%/libexec/dovecot/expire-tool
211
   #expire = Trash 7 Spam 30
283
   #expire = Trash 7 Spam 30
212
   #expire_dict = db:/var/lib/dovecot/expire.db
284
-  #expire_dict = db:/var/lib/dovecot/expire.db
285
+  #expire_dict = db:/var/db/dovecot/expire.db
213
 
286
 
287
   # Lazy expunge plugin. Currently works only with maildirs. When a user
288
   # expunges mails, the mails are moved to a mailbox in another namespace
(-)dovecot/files/pkg-deinstall.in (+70 lines)
Line 0 Link Here
1
#! /bin/sh
2
#
3
#	$FreeBSD: $
4
#
5
# ex:ts=4
6
7
ask() {
8
	local question default answer
9
10
	question=$1
11
	default=$2
12
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
13
		read -p "${question} [${default}]? " answer
14
	fi
15
	echo ${answer:-${default}}
16
}
17
18
yesno() {
19
	local question default answer
20
21
	question=$1
22
	default=$2
23
	while :; do
24
		answer=$(ask "${question}" "${default}")
25
		case "${answer}" in
26
		[Yy]*)	return 0;;
27
		[Nn]*)	return 1;;
28
		esac
29
		echo "Please answer yes or no."
30
	done
31
}
32
33
delete_account() {
34
	local port user uid group gid
35
36
	port=$1
37
	user=${2%:*}
38
	uid=${2#*:}
39
	group=${3%:*}
40
	gid=${3#*:}
41
42
	echo "If you do not intend to reinstall ${port}, you should manually"
43
	echo "remove user '${user}' (uid='${uid}') and group '${group}' (gid='${gid}')."
44
}
45
46
case $2 in
47
48
DEINSTALL)
49
	if ps -axc | grep -qw dovecot; then
50
		if yesno "Dovecot is still running. Shall I stop it?" y; then
51
			killall dovecot
52
			sleep 2
53
		else
54
			echo "OK ... I hope you know what you are doing."
55
		fi
56
	fi
57
58
	delete_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%}
59
60
	echo "Also manually rm -rf /var/db/dovecot if anything was stored there."
61
62
	base=/var/run/dovecot
63
	DIRLIST="${base}/login ${base}"
64
	echo "Cleaning up \"${base}\"."
65
	for directory in ${DIRLIST}; do
66
		rmdir ${directory} 2>/dev/null || :
67
	done
68
	;;
69
70
esac
(-)dovecot/files/pkg-install.in (+97 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/dovecot/files/pkg-install.in,v 1.11 2008/04/10 09:45:22 rafan Exp $
4
#
5
# ex:ts=4
6
7
ask() {
8
	local question default answer
9
10
	question=$1
11
	default=$2
12
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
13
		read -p "${question} [${default}]? " answer
14
	fi
15
	echo ${answer:-${default}}
16
}
17
18
yesno() {
19
	local question default answer
20
21
	question=$1
22
	default=$2
23
	while :; do
24
		answer=$(ask "${question}" "${default}")
25
		case "${answer}" in
26
		[Yy]*)	return 0;;
27
		[Nn]*)	return 1;;
28
		esac
29
		echo "Please answer yes or no."
30
	done
31
}
32
33
create_account() {
34
	local port user uid group gid gcos home shell
35
36
	port=$1
37
	user=${2%:*}
38
	uid=${2#*:}
39
	group=${3%:*}
40
	gid=${3#*:}
41
	gcos=$4
42
	home=$5
43
	shell=$6
44
45
	pw_user_uid=$(pw usershow -n "${user}" 2>/dev/null | cut -d: -f3)
46
	pw_uid_user=$(pw usershow -u "${uid}" 2>/dev/null | cut -d: -f1)
47
	pw_group_gid=$(pw groupshow -n "${group}" 2>/dev/null | cut -d: -f3)
48
	pw_gid_group=$(pw groupshow -g "${gid}" 2>/dev/null | cut -d: -f1)
49
50
	if [ -z "${pw_group_gid}" -a -z "${pw_gid_group}" ]; then
51
		echo "You need a ${group} group; creating it..."
52
		pw groupadd "${group}" -g "${gid}" || exit
53
		echo "Done."
54
	elif [ "${gid}" = "${pw_group_gid}" -a "${group}" = "${pw_gid_group}" ]; then
55
		echo "Using existing ${group} group."
56
	else
57
		echo "${port} has reserved the groupname '${group}' and gid '${gid}':"
58
		[ -n "${pw_group_gid}" -a "${gid}"   != "${pw_group_gid}" ] \
59
			&& echo "ERROR: groupname '${group}' already in use by gid '${pw_group_gid}'"
60
		[ -n "${pw_gid_group}" -a "${group}" != "${pw_gid_group}" ] \
61
			&& echo "ERROR: gid '${gid}' already in use by group '${pw_gid_group}'"
62
		echo "Please resolve these issues and try again:"
63
		echo "Either remove the conflicting group or if you wish to continue using a legacy group override DOVECOT_GID."
64
		exit 1
65
	fi
66
67
	if [ -z "${pw_user_uid}" -a -z "${pw_uid_user}" ]; then
68
		echo "You need a ${user} user; creating it..."
69
		pw useradd "${user}" -u "${uid}" -g "${group}" -c "${gcos}" -d "${home}" -s "${shell}"
70
		echo "Done."
71
	elif [ "${uid}" = "${pw_user_uid}" -a "${user}" = "${pw_uid_user}" ]; then
72
		echo "Using existing ${user} user."
73
	else
74
		echo "${port} has reserved the username '${user}' and uid '${uid}':"
75
		[ -n "${pw_user_uid}" -a "${uid}"  != "${pw_user_uid}" ] \
76
			&& echo "ERROR: username '${user}' already in use by uid '${pw_user_uid}'"
77
		[ -n "${pw_uid_user}" -a "${user}" != "${pw_uid_user}" ] \
78
			&& echo "ERROR: uid '${uid}' already in use by user '${pw_uid_user}'"
79
		echo "Please resolve these issues and try again:"
80
		echo "Either remove the conflicting user or if you wish to continue using a legacy user override DOVECOT_UID."
81
		exit 1
82
	fi
83
}
84
85
case $2 in
86
87
PRE-INSTALL)
88
	create_account Dovecot dovecot:${DOVECOT_UID:-%%DOVECOT_UID%%} dovecot:${DOVECOT_GID:-%%DOVECOT_GID%%} "Dovecot User" /var/empty /usr/sbin/nologin
89
	;;
90
91
POST-INSTALL)
92
	base=/var/run/dovecot
93
	/usr/bin/install -o root -g wheel -m 0755 -d ${base}
94
	/usr/bin/install -o root -g dovecot -m 0750 -d ${base}/login
95
	;;
96
97
esac
(-)dovecot/pkg-deinstall (-65 lines)
Lines 1-65 Link Here
1
#! /bin/sh
2
#
3
# ex:ts=4
4
5
ask() {
6
	local question default answer
7
8
	question=$1
9
	default=$2
10
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
11
		read -p "${question} [${default}]? " answer
12
	fi
13
	echo ${answer:-${default}}
14
}
15
16
yesno() {
17
	local question default answer
18
19
	question=$1
20
	default=$2
21
	while :; do
22
		answer=$(ask "${question}" "${default}")
23
		case "${answer}" in
24
		[Yy]*)	return 0;;
25
		[Nn]*)	return 1;;
26
		esac
27
		echo "Please answer yes or no."
28
	done
29
}
30
31
delete_account() {
32
	local port user uid group gid
33
34
	port=$1
35
	user=${2%:*}
36
	uid=${2#*:}
37
	group=${3%:*}
38
	gid=${3#*:}
39
40
	echo "If you do not intend to reinstall ${port}, you should manually remove the user '${user}' (uid='${uid}') and the group '${group}' (gid='${gid}')."
41
}
42
43
case $2 in
44
45
DEINSTALL)
46
	if ps -axc | grep -qw dovecot; then
47
		if yesno "Dovecot is still running. Shall I stop it?" y; then
48
			killall dovecot
49
			sleep 2
50
		else
51
			echo "OK ... I hope you know what you are doing."
52
		fi
53
	fi
54
55
	delete_account Dovecot dovecot:${DOVECOT_UID:-143} dovecot:${DOVECOT_GID:-143}
56
57
	base=/var/run/dovecot
58
	DIRLIST="${base}/login ${base}"
59
	echo "Cleaning up \"${base}\"."
60
	for directory in ${DIRLIST}; do
61
		rmdir ${directory} 2>/dev/null || :
62
	done
63
	;;
64
65
esac
(-)dovecot/pkg-install (-107 lines)
Lines 1-107 Link Here
1
#!/bin/sh
2
#
3
#	$FreeBSD: ports/mail/dovecot/pkg-install,v 1.11 2008/04/10 09:45:22 rafan Exp $
4
#
5
# ex:ts=4
6
7
ask() {
8
	local question default answer
9
10
	question=$1
11
	default=$2
12
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
13
		read -p "${question} [${default}]? " answer
14
	fi
15
	echo ${answer:-${default}}
16
}
17
18
yesno() {
19
	local question default answer
20
21
	question=$1
22
	default=$2
23
	while :; do
24
		answer=$(ask "${question}" "${default}")
25
		case "${answer}" in
26
		[Yy]*)	return 0;;
27
		[Nn]*)	return 1;;
28
		esac
29
		echo "Please answer yes or no."
30
	done
31
}
32
33
create_account() {
34
	local port user uid group gid gcos home shell
35
36
	port=$1
37
	user=${2%:*}
38
	uid=${2#*:}
39
	group=${3%:*}
40
	gid=${3#*:}
41
	gcos=$4
42
	home=$5
43
	shell=$6
44
45
	pw_user_uid=$(pw usershow -n "${user}" 2>/dev/null | cut -d: -f3)
46
	pw_uid_user=$(pw usershow -u "${uid}" 2>/dev/null | cut -d: -f1)
47
	pw_group_gid=$(pw groupshow -n "${group}" 2>/dev/null | cut -d: -f3)
48
	pw_gid_group=$(pw groupshow -g "${gid}" 2>/dev/null | cut -d: -f1)
49
50
	if [ -z "${pw_group_gid}" -a -z "${pw_gid_group}" ]; then
51
		echo "You need a ${group} group; creating it..."
52
		pw groupadd "${group}" -g "${gid}" || exit
53
		echo "Done."
54
	elif [ "${gid}" = "${pw_group_gid}" -a "${group}" = "${pw_gid_group}" ]; then
55
		echo "Using existing ${group} group."
56
	else
57
		echo "${port} has reserved the groupname '${group}' and gid '${gid}':"
58
		[ -n "${pw_group_gid}" -a "${gid}"   != "${pw_group_gid}" ] \
59
			&& echo "ERROR: groupname '${group}' already in use by gid '${pw_group_gid}'"
60
		[ -n "${pw_gid_group}" -a "${group}" != "${pw_gid_group}" ] \
61
			&& echo "ERROR: gid '${gid}' already in use by group '${pw_gid_group}'"
62
		echo "Please resolve these issues and try again:"
63
		echo "Either remove the conflicting group or if you wish to continue using a legacy group override DOVECOT_GID."
64
		exit 1
65
	fi
66
67
	if [ -z "${pw_user_uid}" -a -z "${pw_uid_user}" ]; then
68
		echo "You need a ${user} user; creating it..."
69
		pw useradd "${user}" -u "${uid}" -g "${group}" -c "${gcos}" -d "${home}" -s "${shell}"
70
		echo "Done."
71
	elif [ "${uid}" = "${pw_user_uid}" -a "${user}" = "${pw_uid_user}" ]; then
72
		echo "Using existing ${user} user."
73
	else
74
		echo "${port} has reserved the username '${user}' and uid '${uid}':"
75
		[ -n "${pw_user_uid}" -a "${uid}"  != "${pw_user_uid}" ] \
76
			&& echo "ERROR: username '${user}' already in use by uid '${pw_user_uid}'"
77
		[ -n "${pw_uid_user}" -a "${user}" != "${pw_uid_user}" ] \
78
			&& echo "ERROR: uid '${uid}' already in use by user '${pw_uid_user}'"
79
		echo "Please resolve these issues and try again:"
80
		echo "Either remove the conflicting user or if you wish to continue using a legacy user override DOVECOT_UID."
81
		exit 1
82
	fi
83
}
84
85
case $2 in
86
87
PRE-INSTALL)
88
	create_account Dovecot dovecot:${DOVECOT_UID:-143} dovecot:${DOVECOT_GID:-143} "Dovecot User" /var/empty /usr/sbin/nologin
89
	;;
90
91
POST-INSTALL)
92
	base=/var/run/dovecot
93
	DIRLIST="${base} ${base}/login"
94
	echo "Fixing ownerships and modes in \"${base}\"."
95
	for directory in ${DIRLIST}; do
96
		if [ ! -d "${directory}" ]; then
97
			mkdir -p ${directory}
98
			echo "Created directory: ${directory}"
99
		fi
100
	done
101
	chown -R root:wheel   ${base}
102
	chmod -R 0755         ${base}
103
	chown -R root:dovecot ${base}/login
104
	chmod -R 0750         ${base}/login
105
	;;
106
107
esac
(-)dovecot/pkg-plist (-12 / +19 lines)
Lines 1-10 Link Here
1
@comment $FreeBSD: ports/mail/dovecot/pkg-plist,v 1.28 2008/07/24 23:38:12 beech Exp $
1
@comment $FreeBSD: ports/mail/dovecot/pkg-plist,v 1.28 2008/07/24 23:38:12 beech Exp $
2
@unexec if cmp -s %D/etc/dovecot-example.conf %D/etc/dovecot.conf; then rm -f %D/etc/dovecot.conf; fi
3
etc/dovecot-example.conf
4
@exec if [ ! -f %D/etc/dovecot.conf ] ; then cp -p %D/%F %B/dovecot.conf; fi
5
%%PORTDOCS%%etc/dovecot-db-example.conf
6
%%PORTDOCS%%etc/dovecot-ldap-example.conf
7
%%PORTDOCS%%etc/dovecot-sql-example.conf
8
@dirrmtry include/dovecot
2
@dirrmtry include/dovecot
9
lib/dovecot/imap/lib01_acl_plugin.so
3
lib/dovecot/imap/lib01_acl_plugin.so
10
lib/dovecot/imap/lib02_lazy_expunge_plugin.so
4
lib/dovecot/imap/lib02_lazy_expunge_plugin.so
Lines 29-35 Link Here
29
lib/dovecot/lda/lib20_fts_plugin.so
23
lib/dovecot/lda/lib20_fts_plugin.so
30
lib/dovecot/lda/lib20_mail_log_plugin.so
24
lib/dovecot/lda/lib20_mail_log_plugin.so
31
lib/dovecot/lda/lib21_fts_squat_plugin.so
25
lib/dovecot/lda/lib21_fts_squat_plugin.so
32
@dirrm lib/dovecot/lda
26
@dirrmtry lib/dovecot/lda
33
lib/dovecot/pop3/lib02_lazy_expunge_plugin.so
27
lib/dovecot/pop3/lib02_lazy_expunge_plugin.so
34
lib/dovecot/pop3/lib10_quota_plugin.so
28
lib/dovecot/pop3/lib10_quota_plugin.so
35
lib/dovecot/pop3/lib20_convert_plugin.so
29
lib/dovecot/pop3/lib20_convert_plugin.so
Lines 40-45 Link Here
40
lib/dovecot/pop3/lib20_zlib_plugin.so
34
lib/dovecot/pop3/lib20_zlib_plugin.so
41
lib/dovecot/pop3/lib21_fts_squat_plugin.so
35
lib/dovecot/pop3/lib21_fts_squat_plugin.so
42
@dirrm lib/dovecot/pop3
36
@dirrm lib/dovecot/pop3
37
@exec install -o root -g wheel -m 0755 -d %D/lib/dovecot/auth
43
@dirrm lib/dovecot/auth
38
@dirrm lib/dovecot/auth
44
lib/dovecot/lib01_acl_plugin.a
39
lib/dovecot/lib01_acl_plugin.a
45
lib/dovecot/lib01_acl_plugin.la
40
lib/dovecot/lib01_acl_plugin.la
Lines 74-80 Link Here
74
lib/dovecot/lib21_fts_squat_plugin.a
69
lib/dovecot/lib21_fts_squat_plugin.a
75
lib/dovecot/lib21_fts_squat_plugin.la
70
lib/dovecot/lib21_fts_squat_plugin.la
76
lib/dovecot/lib21_fts_squat_plugin.so
71
lib/dovecot/lib21_fts_squat_plugin.so
77
@dirrm lib/dovecot
72
@dirrmtry lib/dovecot
78
libexec/dovecot/checkpassword-reply
73
libexec/dovecot/checkpassword-reply
79
libexec/dovecot/convert-tool
74
libexec/dovecot/convert-tool
80
%%LDA%%libexec/dovecot/deliver
75
%%LDA%%libexec/dovecot/deliver
Lines 92-100 Link Here
92
%%POP3%%libexec/dovecot/pop3-login
87
%%POP3%%libexec/dovecot/pop3-login
93
libexec/dovecot/rawlog
88
libexec/dovecot/rawlog
94
libexec/dovecot/ssl-build-param
89
libexec/dovecot/ssl-build-param
95
@dirrm libexec/dovecot
90
@dirrmtry libexec/dovecot
96
sbin/dovecot
91
sbin/dovecot
97
sbin/dovecotpw
92
sbin/dovecotpw
98
%%DATADIR%%/dovecot-openssl.cnf
93
@unexec if cmp -s %D/%%EXAMPLESDIR%%/dovecot.conf %D/etc/dovecot.conf; then rm -f %D/etc/dovecot.conf; fi
99
%%DATADIR%%/mkcert.sh
94
%%EXAMPLESDIR%%/dovecot.conf
100
@dirrm %%DATADIR%%
95
@exec if [ ! -f %D/etc/dovecot.conf ]; then cp -p %D/%%EXAMPLESDIR%%/dovecot.conf %D/etc/dovecot.conf; fi
96
%%BDB%%@unexec if cmp -s %D/%%EXAMPLESDIR%%/dovecot-db.conf %D/etc/dovecot-db.conf; then rm -f %D/etc/dovecot-db.conf; fi
97
%%EXAMPLESDIR%%/dovecot-db.conf
98
%%BDB%%@exec if [ ! -f %D/etc/dovecot-db.conf ]; then cp -p %D/%%EXAMPLESDIR%%/dovecot-db.conf %D/etc/dovecot-db.conf; fi
99
%%LDAP%%@unexec if cmp -s %D/%%EXAMPLESDIR%%/dovecot-ldap.conf %D/etc/dovecot-ldap.conf; then rm -f %D/etc/dovecot-ldap.conf; fi
100
%%EXAMPLESDIR%%/dovecot-ldap.conf
101
%%LDAP%%@exec if [ ! -f %D/etc/dovecot-ldap.conf ]; then cp -p %D/%%EXAMPLESDIR%%/dovecot-ldap.conf %D/etc/dovecot-ldap.conf; fi
102
%%SQL%%@unexec if cmp -s %D/%%EXAMPLESDIR%%/dovecot-sql.conf %D/etc/dovecot-sql.conf; then rm -f %D/etc/dovecot-sql.conf; fi
103
%%EXAMPLESDIR%%/dovecot-sql.conf
104
%%SQL%%@exec if [ ! -f %D/etc/dovecot-sql.conf ]; then cp -p %D/%%EXAMPLESDIR%%/dovecot-sql.conf %D/etc/dovecot-sql.conf; fi
105
%%EXAMPLESDIR%%/dovecot-openssl.cnf
106
%%EXAMPLESDIR%%/mkcert.sh
107
@dirrm %%EXAMPLESDIR%%

Return to bug 127200