From a9ab4ee9a46525ed280958e7a65c359bc05990a2 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 26 Jan 2016 12:32:34 +0100 Subject: [PATCH] Add a template fragment to enable the auto-reply --- root/etc/e-smith/templates-user/.qmail/20ExpireAutoReply | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 root/etc/e-smith/templates-user/.qmail/20ExpireAutoReply diff --git a/root/etc/e-smith/templates-user/.qmail/20ExpireAutoReply b/root/etc/e-smith/templates-user/.qmail/20ExpireAutoReply new file mode 100644 index 0000000..91f99ce --- /dev/null +++ b/root/etc/e-smith/templates-user/.qmail/20ExpireAutoReply @@ -0,0 +1,15 @@ +{ + +use User::pwent; + +my $pwd = $props{'PasswordSet'} || 'no'; +my $locked = $props{'ExpireLockedOn'} || ''; +my $reply = $props{'ExpireAutoReply'} || 'enabled'; + +if ($pwd eq 'yes' || $locked !~ m/^\d{4}\-\d{1,2}\-\d{1,2}$/ || $reply =~ m/^enabled|yes|on|1$/){ + return "" +} + +$OUT .= "| /usr/bin/qmail-autoresponder " getpwnam($USERNAME)->dir . "/.lock-auto-reply\n"; + +}