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

Collapse All | Expand All

(-)dovecot/Makefile (-26 / +48 lines)
Lines 1-3 Link Here
1
# ex:ts=8
1
# New ports collection makefile for:	dovecot
2
# New ports collection makefile for:	dovecot
2
# Date created:				12/08/2002
3
# Date created:				12/08/2002
3
# Whom:			Dominic Marks <dominic.marks@btinternet.com>
4
# Whom:			Dominic Marks <dominic.marks@btinternet.com>
Lines 7-13 Link Here
7
8
8
PORTNAME=	dovecot
9
PORTNAME=	dovecot
9
PORTVERSION=	0.99.10.4
10
PORTVERSION=	0.99.10.4
10
PORTREVISION=	1
11
PORTREVISION=	2
11
CATEGORIES=	mail ipv6
12
CATEGORIES=	mail ipv6
12
MASTER_SITES=	http://www.dovecot.org/
13
MASTER_SITES=	http://www.dovecot.org/
13
14
Lines 28-87 Link Here
28
29
29
PKGMESSAGE=	${WRKDIR}/pkg-message
30
PKGMESSAGE=	${WRKDIR}/pkg-message
30
31
31
DOCS=		auth.txt configuration.txt design.txt \
32
PLIST_DIRS=	libexec/dovecot
33
PLIST_FILES=	etc/dovecot-example.conf \
34
		etc/rc.d/dovecot.sh \
35
		libexec/dovecot/dovecot-auth \
36
		libexec/dovecot/imap \
37
		libexec/dovecot/imap-login \
38
		libexec/dovecot/pop3 \
39
		libexec/dovecot/pop3-login \
40
		sbin/dovecot
41
42
.if !defined(NOPORTDOCS)
43
PORTDOCS=	auth.txt configuration.txt design.txt \
32
		index.txt mail-storages.txt mkcert.sh multiaccess.txt \
44
		index.txt mail-storages.txt mkcert.sh multiaccess.txt \
33
		nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
45
		nfs.txt dovecot-ldap.conf dovecot-pgsql.conf \
34
		dovecot-openssl.cnf securecoding.txt
46
		dovecot-openssl.cnf securecoding.txt
47
.endif
35
48
36
#.include <bsd.port.pre.mk>
49
.include <bsd.port.pre.mk>
37
50
38
## SASL2 support      -> WITH_SASL2=1
51
## SASL2 support
52
OPTIONS+=	SASL2 "SASL2 support" off
39
#
53
#
40
# SASL provides authentication support to
54
# SASL provides authentication support to
41
# session-based protocols. This is can be
55
# session-based protocols. This is can be
42
# used by dovecot for authentication sources.
56
# used by dovecot for authentication sources.
43
#
57
#
44
.if defined(WITH_SASL2)
58
.if defined(WITH_SASL2)
45
LIB_DEPENDS+=	sasl2.2:${PORTSDIR}/security/cyrus-sasl2
59
LIB_DEPENDS+=		sasl2.2:${PORTSDIR}/security/cyrus-sasl2
46
CONFIGURE_ARGS+=	--with-cyrus-sasl2
60
CONFIGURE_ARGS+=	--with-cyrus-sasl2
47
.endif
61
.endif
48
62
49
## VPopMail Support   -> WITH_VPOPMAIL=1
63
## VPopMail Support
64
OPTIONS+=	VPOPMAIL  "VPopMail support" off
50
#
65
#
51
# vpopmail provides easy authentication and
66
# vpopmail provides easy authentication and
52
# multi-domain features. It was originally
67
# multi-domain features. It was originally
53
# created for use with Qmail.
68
# created for use with Qmail.
54
#
69
#
55
.if defined(WITH_VPOPMAIL)
70
.if defined(WITH_VPOPMAIL)
56
VPOPMAIL=	${LOCALBASE}/vpopmail/bin/vchkpw
71
VPOPMAIL=		${LOCALBASE}/vpopmail/bin/vchkpw
57
BUILD_DEPENDS+=	${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
72
BUILD_DEPENDS+=		${VPOPMAIL}:${PORTSDIR}/mail/vpopmail
58
CONFIGURE_ARGS+=	--with-vpopmail
73
CONFIGURE_ARGS+=	--with-vpopmail
59
.endif
74
.endif
60
75
61
## OpenLDAP Support   -> WITH_LDAP=1
76
## OpenLDAP Support
77
OPTIONS+=	LDAP  "OpenLDAP support" off
62
#
78
#
63
# LDAP is the light-weight directory access
79
# LDAP is the light-weight directory access
64
# protocol and can be used by Dovecot for its
80
# protocol and can be used by Dovecot for its
65
# user database.
81
# user database.
66
#
82
#
67
.if defined(WITH_LDAP)
83
.if defined(WITH_LDAP)
68
USE_OPENLDAP=	yes
84
USE_OPENLDAP=		yes
69
CONFIGURE_ARGS+=	--with-ldap
85
CONFIGURE_ARGS+=	--with-ldap
70
.endif
86
.endif
71
87
72
## PostgreSQL Support -> WITH_PGSQL=1
88
## PostgreSQL Support
89
OPTIONS+=	PGSQL  "PostgreSQL support" off
73
#
90
#
74
# PostgreSQL is a powerful SQL database that
91
# PostgreSQL is a powerful SQL database that
75
# can be used to store user tables.
92
# can be used to store user tables.
76
#
93
#
77
.if defined(WITH_PGSQL)
94
.if defined(WITH_PGSQL)
78
LIB_DEPENDS+=	pq.3:${PORTSDIR}/databases/postgresql7
95
LIB_DEPENDS+=		pq.3:${PORTSDIR}/databases/postgresql7
79
CONFIGURE_ARGS+=	--with-pgsql
96
CONFIGURE_ARGS+=	--with-pgsql
80
.endif
97
.endif
81
98
82
pre-configure:
99
.if ${OSVERSION} >= 500038
83
	@${ECHO_MSG} "=> ${PORTNAME} options: see ${MAKEFILE} for descriptions"
100
RC_SUBR?=	/etc/rc.subr
84
	@${SED} -ne 's,^##,=> ,p' ${MAKEFILE}
101
.else
102
USE_RC_SUBR=	yes
103
.endif
85
104
86
pre-build:
105
pre-build:
87
	@${REINPLACE_CMD} -e 's,%%SSLDIR%%,/var/dovecot/ssl,' \
106
	@${REINPLACE_CMD} -e 's,%%SSLDIR%%,/var/dovecot/ssl,' \
Lines 90-98 Link Here
90
	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
109
	@${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},' \
91
		${WRKSRC}/dovecot-example.conf
110
		${WRKSRC}/dovecot-example.conf
92
111
112
post-build:
113
	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
114
		-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
115
		${FILESDIR}/dovecot.sh >${WRKDIR}/dovecot.sh
116
117
pre-install:
118
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
119
93
do-install:
120
do-install:
94
	@${SETENV} ${SCRIPTS_ENV} \
95
		${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL
96
	@${MKDIR} ${PREFIX}/libexec/dovecot
121
	@${MKDIR} ${PREFIX}/libexec/dovecot
97
	${INSTALL_PROGRAM} \
122
	${INSTALL_PROGRAM} \
98
		${WRKSRC}/src/imap/imap \
123
		${WRKSRC}/src/imap/imap \
Lines 103-123 Link Here
103
			${PREFIX}/libexec/dovecot/
128
			${PREFIX}/libexec/dovecot/
104
	${INSTALL_DATA} ${WRKSRC}/dovecot-example.conf ${PREFIX}/etc/
129
	${INSTALL_DATA} ${WRKSRC}/dovecot-example.conf ${PREFIX}/etc/
105
	${INSTALL_PROGRAM} ${WRKSRC}/src/master/dovecot ${PREFIX}/sbin/
130
	${INSTALL_PROGRAM} ${WRKSRC}/src/master/dovecot ${PREFIX}/sbin/
106
	@${SETENV} ${SCRIPTS_ENV} \
131
	${INSTALL_SCRIPT} ${WRKDIR}/dovecot.sh ${PREFIX}/etc/rc.d/
107
		${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
108
	${INSTALL_SCRIPT} -m 751 ${FILESDIR}/dovecot.sh.sample \
109
		${PREFIX}/etc/rc.d/dovecot.sh.sample
110
.if !defined(NOPORTDOCS)
132
.if !defined(NOPORTDOCS)
111
	@${MKDIR} ${DOCSDIR}
133
	@${MKDIR} ${DOCSDIR}
112
.for document in ${DOCS}
134
	@${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/doc/,} ${DOCSDIR}
113
	@${INSTALL_DATA} ${WRKSRC}/doc/${document} ${DOCSDIR}
114
.endfor
115
	@${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
135
	@${INSTALL_DATA} ${FILESDIR}/README.FreeBSD ${DOCSDIR}
116
.endif
136
.endif
137
138
post-install:
139
	@${SETENV} ${SCRIPTS_ENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
117
	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
140
	@${SED} -e 's,%%PREFIX%%,${PREFIX},g' \
118
		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
141
		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
119
		${.CURDIR}/pkg-message >${PKGMESSAGE}
142
		${.CURDIR}/pkg-message >${PKGMESSAGE}
120
	@${CAT} ${PKGMESSAGE}
143
	@${CAT} ${PKGMESSAGE}
121
144
122
#.include <bsd.port.post.mk>
145
.include <bsd.port.post.mk>
123
.include <bsd.port.mk>
(-)dovecot/files/dovecot.sh (+26 lines)
Line 0 Link Here
1
#!/bin/sh
2
#
3
# $FreeBSD$
4
#
5
6
# PROVIDE: dovecot
7
# REQUIRE: LOGIN
8
# KEYWORD: FreeBSD shutdown
9
10
#
11
# Add the following lines to /etc/rc.conf to enable dovecot:
12
#
13
#dovecot_enable="YES"
14
#
15
dovecot_enable="NO"
16
17
. %%RC_SUBR%%
18
19
name=dovecot
20
rcvar=`set_rcvar`
21
22
command=%%PREFIX%%/sbin/${name}
23
required_files=%%PREFIX%%/etc/${name}.conf
24
25
load_rc_config ${name}
26
run_rc_command "$1"
(-)dovecot/files/patch-network.c (+14 lines)
Line 0 Link Here
1
--- src/lib/network.c.orig	Sun Jun 22 23:09:48 2003
2
+++ src/lib/network.c	Sun Jan 25 20:22:17 2004
3
@@ -591,7 +591,11 @@
4
 int net_hosterror_notfound(int error)
5
 {
6
 #ifdef HAVE_IPV6
7
+#ifdef EAI_NODATA
8
 	return error != 1 && (error == EAI_NONAME || error == EAI_NODATA);
9
+#else
10
+	return error != 1 && (error == EAI_NONAME);
11
+#endif
12
 #else
13
 	return error == HOST_NOT_FOUND || error == NO_ADDRESS;
14
 #endif
(-)dovecot/pkg-deinstall (-34 / +44 lines)
Lines 1-55 Link Here
1
#! /bin/sh
1
#! /bin/sh
2
#
3
# ex:ts=4
2
4
3
ask() {
5
ask() {
4
    local question default answer
6
	local question default answer
5
7
6
    question=$1
8
	question=$1
7
    default=$2
9
	default=$2
8
    if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
10
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
9
	read -p "${question} [${default}]? " answer
11
		read -p "${question} [${default}]? " answer
10
    fi
12
	fi
11
    echo ${answer:-${default}}
13
	echo ${answer:-${default}}
12
}
14
}
13
15
14
yesno() {
16
yesno() {
15
    local question default answer
17
	local question default answer
16
18
17
    question=$1
19
	question=$1
18
    default=$2
20
	default=$2
19
    while :; do
21
	while :; do
20
	answer=$(ask "${question}" "${default}")
22
		answer=$(ask "${question}" "${default}")
21
	case "${answer}" in
23
		case "${answer}" in
22
	[Yy]*)	return 0;;
24
		[Yy]*)	return 0;;
23
	[Nn]*)	return 1;;
25
		[Nn]*)	return 1;;
24
	esac
26
		esac
25
	echo "Please answer yes or no."
27
		echo "Please answer yes or no."
26
    done
28
	done
27
}
29
}
28
30
29
delete_account() {
31
delete_account() {
30
    local u
32
	local u
31
33
32
    u=$1
34
	u=$1
33
    if yesno "Do you want me to remove user \"${u}\"" n; then
35
	if yesno "Do you want me to remove user \"${u}\"" n; then
34
	pw userdel -n ${u}
36
		pw userdel -n ${u}
35
	echo "Done."
37
		echo "Done."
36
    fi
38
	fi
37
}
39
}
38
40
39
case $2 in
41
case $2 in
40
42
41
DEINSTALL)
43
DEINSTALL)
42
    if ps -axc | grep -qw dovecot; then
44
	if ps -axc | grep -qw dovecot; then
43
	if yesno "Dovecot is still running. Shall I stop it?" y; then
45
		if yesno "Dovecot is still running. Shall I stop it?" y; then
44
	    killall dovecot
46
			killall dovecot
45
	    sleep 2
47
			sleep 2
46
	else
48
		else
47
	    echo "OK ... I hope you know what you are doing."
49
			echo "OK ... I hope you know what you are doing."
50
		fi
48
	fi
51
	fi
49
    fi
50
52
51
    delete_account dovecot
53
	delete_account dovecot
52
    delete_account dovecot-auth
54
	delete_account dovecot-auth
53
    ;;
55
56
	base=/var/dovecot
57
	DIRLIST="${base}/ssl/private ${base}/ssl/certs ${base}/ssl ${base}/private \
58
		${base}/login ${base}/auth ${base} /var/run/dovecot"
59
	echo "Cleaning up \"${base}\"."
60
	for directory in ${DIRLIST}; do
61
		rmdir ${directory} 2>/dev/null || :
62
	done
63
	;;
54
64
55
esac
65
esac
(-)dovecot/pkg-install (-65 / +65 lines)
Lines 2-94 Link Here
2
#
2
#
3
#	$FreeBSD$
3
#	$FreeBSD$
4
#
4
#
5
5
# ex:ts=4
6
base=/var/dovecot
7
6
8
ask() {
7
ask() {
9
    local question default answer
8
	local question default answer
10
9
11
    question=$1
10
	question=$1
12
    default=$2
11
	default=$2
13
    if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
12
	if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
14
	read -p "${question} [${default}]? " answer
13
		read -p "${question} [${default}]? " answer
15
    fi
14
	fi
16
    echo ${answer:-${default}}
15
	echo ${answer:-${default}}
17
}
16
}
18
17
19
yesno() {
18
yesno() {
20
    local question default answer
19
	local question default answer
21
20
22
    question=$1
21
	question=$1
23
    default=$2
22
	default=$2
24
    while :; do
23
	while :; do
25
	answer=$(ask "${question}" "${default}")
24
		answer=$(ask "${question}" "${default}")
26
	case "${answer}" in
25
		case "${answer}" in
27
	[Yy]*)	return 0;;
26
		[Yy]*)	return 0;;
28
	[Nn]*)	return 1;;
27
		[Nn]*)	return 1;;
29
	esac
28
		esac
30
	echo "Please answer yes or no."
29
		echo "Please answer yes or no."
31
    done
30
	done
32
}
31
}
33
32
34
make_account() {
33
make_account() {
35
    local u g gcos
34
	local u g gcos
36
35
37
    u=$1
36
	u=$1
38
    g=$2
37
	g=$2
39
    gcos=$3
38
	gcos=$3
40
39
41
    if pw group show "${g}" >/dev/null 2>&1; then
40
	if pw group show "${g}" >/dev/null 2>&1; then
42
	echo "You already have a group \"${g}\", so I will use it."
41
		echo "You already have a group \"${g}\", so I will use it."
43
    else
44
	echo "You need a group \"${g}\"."
45
	if which -s pw && yesno "Would you like me to create it" y
46
	then
47
	    pw groupadd ${g} || exit
48
	    echo "Done."
49
	else
42
	else
50
	    echo "Please create it, and try again."
43
		echo "You need a group \"${g}\"."
51
	    exit 1
44
		if which -s pw && yesno "Would you like me to create it" y
45
		then
46
			pw groupadd ${g} || exit
47
			echo "Done."
48
		else
49
			echo "Please create it, and try again."
50
			exit 1
51
		fi
52
	fi
52
	fi
53
    fi
54
    
53
    
55
    if pw user show "${u}" >/dev/null 2>&1; then
54
	if pw user show "${u}" >/dev/null 2>&1; then
56
	echo "You already have a user \"${u}\", so I will use it."
55
		echo "You already have a user \"${u}\", so I will use it."
57
    else
58
	echo "You need a user \"${u}\"."
59
	if which -s pw && yesno "Would you like me to create it" y
60
	then
61
	    pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
62
	    echo "Done."
63
	else
56
	else
64
	    echo "Please create it, and try again."
57
		echo "You need a user \"${u}\"."
65
	    exit 1
58
		if which -s pw && yesno "Would you like me to create it" y
59
		then
60
			pw useradd ${u} -g ${g} -h - -s /sbin/nologin -c "${gcos}" || exit
61
			echo "Done."
62
		else
63
			echo "Please create it, and try again."
64
			exit 1
65
		fi
66
	fi
66
	fi
67
    fi
68
}
67
}
69
68
70
case $2 in
69
case $2 in
71
70
72
PRE-INSTALL)
71
PRE-INSTALL)
73
    make_account dovecot dovecot "Dovecot"
72
	make_account dovecot dovecot "Dovecot"
74
    make_account dovecot-auth dovecot-auth "Dovecot Auth"
73
	make_account dovecot-auth dovecot-auth "Dovecot Auth"
75
    ;;
74
	;;
76
75
77
POST-INSTALL)
76
POST-INSTALL)
78
    DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
77
	base=/var/dovecot
79
	${base}/ssl/private ${base}/login /var/run/dovecot"
78
	DIRLIST="${base} ${base}/auth ${base}/ssl ${base}/ssl/certs \
80
    echo "Fixing ownerships and modes in \"${base}\"."
79
		${base}/ssl/private ${base}/login /var/run/dovecot"
81
    for directory in ${DIRLIST}; do
80
	echo "Fixing ownerships and modes in \"${base}\"."
82
	if [ ! -d "${directory}" ]; then
81
	for directory in ${DIRLIST}; do
83
	    mkdir -p ${directory}
82
		if [ ! -d "${directory}" ]; then
84
	    echo "Created directory: ${directory}"
83
			mkdir -p ${directory}
85
	fi
84
			echo "Created directory: ${directory}"
86
    done
85
		fi
87
    chown -R root:wheel      ${base}
86
	done
88
    chown -R dovecot:dovecot ${base}/auth ${base}/ssl
87
	chown -R root:wheel      ${base}
89
    chown    root:dovecot    ${base}/login /var/run/dovecot
88
	chown -R dovecot:dovecot ${base}/auth ${base}/ssl
90
    chmod 0750 ${base}/login
89
	chown    root:dovecot    ${base}/login /var/run/dovecot
91
    chmod 0700 /var/run/dovecot
90
	chmod 0750 ${base}/login
92
    ;;
91
	chmod 0700 /var/run/dovecot
92
	;;
93
93
94
esac
94
esac
(-)dovecot/pkg-message (-7 / +7 lines)
Lines 1-15 Link Here
1
---------------------------------------------------------------------
1
---------------------------------------------------------------------
2
 
2
 
3
 You can get default configured IMAP and POP3 services running by
3
 You can get default configured IMAP and POP3 services running by
4
 copying the following sample files to the given locations. In this
4
 copying the sample configuration file to the given location and then
5
 simple configuration Dovecot will authenticate users against the
5
 enabling dovecot in /etc/rc.conf.
6
 systems passwd file and use the default /var/mail/$USER mbox files.
6
 In this simple configuration Dovecot will authenticate users against
7
 the systems passwd file and use the default /var/mail/$USER mbox
8
 files.
7
9
8
  %%PREFIX%%/etc/dovecot-example.conf
10
  cd %%PREFIX%%/etc; cp dovecot-example.conf dovecot.conf
9
   -> %%PREFIX%%/etc/dovecot.conf
10
  
11
  
11
  %%PREFIX%%/etc/rc.d/dovecot.sh.sample
12
  echo dovecot_enable="YES" >> /etc/rc.conf
12
   -> %%PREFIX%%/etc/rc.d/dovecot.sh
13
 
13
 
14
 Further information on configuration can be found in:
14
 Further information on configuration can be found in:
15
15

Return to bug 61905