diff --git a/dovecot-1.2.6-greetings.patch b/dovecot-1.2.6-greetings.patch new file mode 100644 index 0000000..c59d0d9 --- /dev/null +++ b/dovecot-1.2.6-greetings.patch @@ -0,0 +1,98 @@ +diff -up dovecot-1.2.6/src/imap-login/client.c.greetings dovecot-1.2.6/src/imap-login/client.c +--- dovecot-1.2.6/src/imap-login/client.c.greetings 2009-10-05 20:10:44.000000000 +0200 ++++ dovecot-1.2.6/src/imap-login/client.c 2009-10-21 12:20:03.995249615 +0200 +@@ -93,11 +93,12 @@ bool client_skip_line(struct imap_client + + static const char *get_capability(struct imap_client *client, bool full) + { +- const char *auths; ++ const char *auths, *cap_str; + ++ cap_str = full || capability_string_overridden ? capability_string : ++ CAPABILITY_BANNER_STRING; + auths = client_authenticate_get_capabilities(client->common.secured); +- return t_strconcat(full ? capability_string : CAPABILITY_BANNER_STRING, +- (ssl_initialized && !client->common.tls) ? ++ return t_strconcat(cap_str, (ssl_initialized && !client->common.tls) ? + " STARTTLS" : "", + disable_plaintext_auth && !client->common.secured ? + " LOGINDISABLED" : "", auths, NULL); +diff -up dovecot-1.2.6/src/login-common/common.h.greetings dovecot-1.2.6/src/login-common/common.h +--- dovecot-1.2.6/src/login-common/common.h.greetings 2009-01-15 21:27:26.000000000 +0100 ++++ dovecot-1.2.6/src/login-common/common.h 2009-10-21 12:20:03.996248613 +0200 +@@ -23,7 +23,7 @@ extern const char *trusted_networks; + extern unsigned int max_connections; + extern unsigned int login_process_uid; + extern struct auth_client *auth_client; +-extern bool closing_down; ++extern bool closing_down, capability_string_overridden; + + void main_ref(void); + void main_unref(void); +diff -up dovecot-1.2.6/src/login-common/main.c.greetings dovecot-1.2.6/src/login-common/main.c +--- dovecot-1.2.6/src/login-common/main.c.greetings 2009-08-12 20:03:16.000000000 +0200 ++++ dovecot-1.2.6/src/login-common/main.c 2009-10-21 12:20:03.996248613 +0200 +@@ -28,7 +28,7 @@ const char *trusted_networks; + unsigned int max_connections; + unsigned int login_process_uid; + struct auth_client *auth_client; +-bool closing_down; ++bool closing_down, capability_string_overridden; + + static const char *process_name; + static struct ioloop *ioloop; +@@ -354,8 +354,11 @@ static void main_init(void) + + /* capability default is set in imap/pop3-login */ + value = getenv("CAPABILITY_STRING"); +- if (value != NULL && *value != '\0') ++ if (value != NULL && *value != '\0') { + capability_string = value; ++ if (getenv("CAPABILITY_STRING_OVERRIDDEN") != NULL) ++ capability_string_overridden = TRUE; ++ } + + closing_down = FALSE; + main_refcount = 0; +diff -up dovecot-1.2.6/src/login-common/ssl-proxy-openssl.c.greetings dovecot-1.2.6/src/login-common/ssl-proxy-openssl.c +--- dovecot-1.2.6/src/login-common/ssl-proxy-openssl.c.greetings 2009-09-29 16:14:15.000000000 +0200 ++++ dovecot-1.2.6/src/login-common/ssl-proxy-openssl.c 2009-10-21 12:20:04.000248772 +0200 +@@ -715,6 +715,7 @@ static DH *ssl_tmp_dh_callback(SSL *ssl + return ssl_params.dh_1024; + } + ++#ifdef HAVE_SSL_CTX_SET_INFO_CALLBACK + static void ssl_info_callback(const SSL *ssl, int where, int ret) + { + struct ssl_proxy *proxy; +@@ -732,6 +733,7 @@ static void ssl_info_callback(const SSL + net_ip2addr(&proxy->ip)); + } + } ++#endif + + static int ssl_verify_client_cert(int preverify_ok, X509_STORE_CTX *ctx) + { +@@ -814,8 +816,10 @@ static void ssl_proxy_ctx_init(SSL_CTX * + cafile, ssl_last_error()); + } + } ++#ifdef HAVE_SSL_CTX_SET_INFO_CALLBACK + if (verbose_ssl) + SSL_CTX_set_info_callback(ssl_ctx, ssl_info_callback); ++#endif + if (SSL_CTX_need_tmp_RSA(ssl_ctx)) + SSL_CTX_set_tmp_rsa_callback(ssl_ctx, ssl_gen_rsa_key); + SSL_CTX_set_tmp_dh_callback(ssl_ctx, ssl_tmp_dh_callback); +diff -up dovecot-1.2.6/src/master/login-process.c.greetings dovecot-1.2.6/src/master/login-process.c +--- dovecot-1.2.6/src/master/login-process.c.greetings 2009-10-21 12:20:03.965978906 +0200 ++++ dovecot-1.2.6/src/master/login-process.c 2009-10-21 12:23:04.696873716 +0200 +@@ -635,6 +635,8 @@ static void login_process_init_env(struc + *set->imap_capability != '\0' ? + set->imap_capability : + set->imap_generated_capability, NULL)); ++ if (*set->imap_capability != '\0') ++ env_put("CAPABILITY_STRING_OVERRIDDEN=1"); + } else if (group->mail_process_type == PROCESS_TYPE_MANAGESIEVE) { + env_put(t_strconcat("CAPABILITY_STRING=", + set->managesieve_generated_capability, NULL)); diff --git a/dovecot.spec b/dovecot.spec index 7ba3438..db0d03f 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -2,7 +2,7 @@ Summary: Secure imap and pop3 server Name: dovecot Epoch: 1 Version: 1.2.6 -Release: 3%{?dist} +Release: 5%{?dist} #dovecot itself is MIT, a few sources are PD, (manage)sieve is LGPLv2, perfect_maildir.pl is GPLv2+ License: MIT and LGPLv2 and GPLv2+ Group: System Environment/Daemons @@ -40,6 +40,9 @@ Patch1: dovecot-1.1-default-settings.patch Patch2: dovecot-1.0.beta2-mkcert-permissions.patch Patch3: dovecot-1.0.rc7-mkcert-paths.patch +# taken from upstream, for dovecot <= 1.2.6 use imap_capability in greeting message, rhbz#524485 +Patch4: dovecot-1.2.6-greetings.patch + Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: openssl-devel, pam-devel, zlib-devel, libcap-devel BuildRequires: libtool autoconf automake @@ -86,18 +89,18 @@ Dovecot is an IMAP server for Linux/UNIX-like systems, written with security primarily in mind. It also contains a small POP3 server. It supports mail in either of maildir or mbox formats. -The SQL drivers and authentication plugins are in their subpackages. +The SQL drivers and authentication plug-ins are in their subpackages. %if %{build_sieve} %package sieve Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: Sieve plugin for dovecot LDA +Summary: Sieve plug-in for dovecot LDA Group: System Environment/Daemons License: MIT and LGPLv2+ %description sieve -This package provides sieve plugin version %{sieve_version} for dovecot LDA. +This package provides sieve plug-in version %{sieve_version} for dovecot LDA. %endif %if %{build_managesieve} @@ -105,7 +108,7 @@ This package provides sieve plugin version %{sieve_version} for dovecot LDA. Requires: %{name} = %{epoch}:%{version}-%{release} Summary: Manage Sieve daemon for dovecot Group: System Environment/Daemons -License: LGPLv2.1 +License: LGPLv2 %description managesieve This package provides the Manage Sieve daemon version %{managesieve_version} for dovecot. @@ -114,51 +117,51 @@ This package provides the Manage Sieve daemon version %{managesieve_version} for %if %{build_postgres} %package pgsql Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: Postgres SQL backend for dovecot +Summary: Postgres SQL back end for dovecot Group: System Environment/Daemons %description pgsql -This package provides the Postgres SQL backend for dovecot-auth etc. +This package provides the Postgres SQL back end for dovecot-auth etc. %endif %if %{build_mysql} %package mysql Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: MySQL backend for dovecot +Summary: MySQL back end for dovecot Group: System Environment/Daemons %description mysql -This package provides the MySQL backend for dovecot-auth etc. +This package provides the MySQL back end for dovecot-auth etc. %endif %if %{build_sqlite} %package sqlite Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: SQLite backend for dovecot +Summary: SQLite back end for dovecot Group: System Environment/Daemons %description sqlite -This package provides the SQLite backend for dovecot-auth etc. +This package provides the SQLite back end for dovecot-auth etc. %endif %if %{build_ldap} %package ldap Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: LDAP auth plugin for dovecot +Summary: LDAP auth plug-in for dovecot Group: System Environment/Daemons %description ldap -This package provides the LDAP auth plugin for dovecot-auth etc. +This package provides the LDAP auth plug-in for dovecot-auth etc. %endif %if %{build_gssapi} %package gssapi Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: GSSAPI auth mechanism plugin for dovecot +Summary: GSSAPI auth mechanism plug-in for dovecot Group: System Environment/Daemons %description gssapi -This package provides the GSSAPI auth mechanism plugin for dovecot-auth etc. +This package provides the GSSAPI auth mechanism plug-in for dovecot-auth etc. %endif %package devel Requires: %{name} = %{epoch}:%{version}-%{release} -Summary: Development files dor dovecot +Summary: Development files for dovecot Group: Development/Libraries %description devel This package provides the development files for dovecot. @@ -170,6 +173,7 @@ zcat %{SOURCE11} | patch -p1 --fuzz=0 -s %patch1 -p1 -b .default-settings %patch2 -p1 -b .mkcert-permissions %patch3 -p1 -b .mkcert-paths +%patch4 -p1 -b .greetings %if %{build_sieve} %setup -q -D -T -a 8 @@ -290,9 +294,20 @@ do install -p -m644 $f $RPM_BUILD_ROOT%{docdir}/UW-to-Dovecot-Migration done +# fix encoding +pushd $RPM_BUILD_ROOT +for fe in ./%{docdir}/auth-protocol.txt +do + iconv -f iso-8859-1 -t utf-8 <$fe >$fe.new + touch -r $fe $fe.new + mv -f $fe.new $fe +done +popd + mv $RPM_BUILD_ROOT%{docdir} $RPM_BUILD_ROOT%{docdir}-%{version} mkdir -p $RPM_BUILD_ROOT/var/lib/dovecot + %if %{build_sieve} # dovecot-sieve pushd %{sieve_name}-%{sieve_version} @@ -437,6 +452,13 @@ fi %changelog +* Mon Nov 02 2009 Michal Hlavinka - 1:1.2.6-5 +- spec cleanup + +* Wed Oct 21 2009 Michal Hlavinka - 1:1.2.6-4 +- imap-login: If imap_capability is set, show it in the banner + instead of the default (#524485) + * Mon Oct 19 2009 Michal Hlavinka - 1:1.2.6-3 - sieve updated to 0.1.13 which brings these changes: - Body extension: implemented proper handling of the :raw transform