from .ldap import BaseLdapApplication
from ..xlate import XLATOR
-__version__ = '0.6.4'
+__version__ = '0.6.5'
LOG = logging.getLogger(__name__)
_ = XLATOR.gettext
"""Check existence of given ."""
LOG.debug(_('Checking all available virtual aliases table files ...'))
+ db_extension = self.postfix_filetype_extensions[self.postfix_db_hashtype]
+ if self.verbose > 1:
+ LOG.debug(_("Using file extension for db-files: {!r}.").format(db_extension))
+
+ for va_file in self.virtaliases_files:
+ db_file = va_file.parent / (va_file.name + db_extension)
+ if not db_file.exists() or not db_file.is_file():
+ LOG.error(_(
+ "DB file for virtual aliases {!r} does not exists or is not a regular "
+ "file.").format(str(db_file)))
+ self.virtaliases_files.remove(va_file)
+ continue
+ mtime_db_file = db_file.stat().st_mtime
+ mtime_va_file = va_file.stat().st_mtime
+ if mtime_db_file < mtime_va_file:
+ LOG.warn(_(
+ "The last modification time of {db!r} is older than this "
+ "of {va!r}.").format(db=str(db_file), va=str(va_file)))
+ elif self.verbose > 1:
+ LOG.debug(_(
+ "The last modification time of {db!r} and {va!r} are "
+ "okay.").format(db=str(db_file), va=str(va_file)))
+
# -------------------------------------------------------------------------
def _run(self):