view doc/mkcert.sh @ 22930:bfeda12bb54a

lib-index: mail_index_sync_map() - Don't try to-resync extension updates This was done to call extension record sync handlers, but the previous commit removes them. Fixes a problem where obsolete cache offsets were used in some situations: - Some cache updates are from external transactions and some are from non-external transactions. This is because cache offset updates are being added by whatever the parent index transaction is. - When mail_index_sync_map() is mapping MAIL_INDEX_SYNC_HANDLER_FILE, it has already synced the map. But it's calling mail_index_sync_record() for non-external transactions to call expunge handlers and extension update handlers. It's calling the regular mail_index_sync_record() to do this work. - But mail_index_sync_record() is actually still updating the map. So now mail_index_sync_record() is called for all non-external cache updates, but not for external cache updates! And since these are somewhat randomly either external or non-external, the end result is that the cache offset may be obsolete.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 29 Apr 2018 12:31:23 +0300
parents 46990210b870
children
line wrap: on
line source

#!/bin/sh

# Generates a self-signed certificate.
# Edit dovecot-openssl.cnf before running this.

umask 077
OPENSSL=${OPENSSL-openssl}
SSLDIR=${SSLDIR-/etc/ssl}
OPENSSLCONFIG=${OPENSSLCONFIG-dovecot-openssl.cnf}

CERTDIR=$SSLDIR/certs
KEYDIR=$SSLDIR/private

CERTFILE=$CERTDIR/dovecot.pem
KEYFILE=$KEYDIR/dovecot.pem

if [ ! -d $CERTDIR ]; then
  echo "$SSLDIR/certs directory doesn't exist"
  exit 1
fi

if [ ! -d $KEYDIR ]; then
  echo "$SSLDIR/private directory doesn't exist"
  exit 1
fi

if [ -f $CERTFILE ]; then
  echo "$CERTFILE already exists, won't overwrite"
  exit 1
fi

if [ -f $KEYFILE ]; then
  echo "$KEYFILE already exists, won't overwrite"
  exit 1
fi

$OPENSSL req -new -x509 -nodes -config $OPENSSLCONFIG -out $CERTFILE -keyout $KEYFILE -days 365 || exit 2
chmod 0600 $KEYFILE
echo 
$OPENSSL x509 -subject -fingerprint -noout -in $CERTFILE || exit 2