Lots of fixes in auto-reply templates

tags/smeserver-expire-accounts-0.1.7-1
Daniel Berteaud 8 years ago
parent 13ec63f061
commit 475d18dbb0
  1. 14
      root/etc/e-smith/templates-user/.lock-auto-reply/message.txt/00Setup
  2. 28
      root/etc/e-smith/templates-user/.lock-auto-reply/message.txt/10Message
  3. 0
      root/etc/e-smith/templates-user/.lock-auto-reply/message.txt/template-begin
  4. 8
      root/etc/e-smith/templates-user/lock-auto-reply/message.txt/00Setup
  5. 19
      root/etc/e-smith/templates-user/lock-auto-reply/message.txt/10Message

@ -0,0 +1,14 @@
{
# vim: ft=perl:
die "USERNAME not set." unless defined ($USERNAME);
use esmith::AccountsDB;
$adb = esmith::AccountsDB->open_ro or die "Couldn't open AccountsDB";
$user = $adb->get($USERNAME) or die "No user $USERNAME in AccountsDB";
%props = $user->props;
$props{EmailForward} ||= 'local';
$OUT = '';
}

@ -0,0 +1,28 @@
{
use esmith::I18N;
use Locale::gettext;
use MIME::Lite;
my $i18n = new esmith::I18N;
$i18n->setLocale('lockAutoReply.tmpl');
my $fwd = ($props{EmailForward} =~ /^(forward|both)$/) ?
sprintf(gettext("Your mail has been forwarded to %s"), ($props{ForwardAddress} || 'devnull@' . $DomainName)) . ".\n" .
gettext("This forward is only temporary, you should update your addressbook.") : "";
my $msg = MIME::Lite->new(
Subject => gettext("This account is no longer valid"),
From => "\$USER@" . $DomainName,
Data => gettext("This is an automatic message in reply to your email with the following subject:") . "\n\n" .
'%S' . "\n\n" .
gettext("I'm sorry to inform you that the email address \$RECIPIENT is no longer valid.") . "\n" . $fwd
);
$msg->scrub([ 'Date' ]);
$msg->attr("content-type" => "text/plain");
$msg->attr("content-type.charset" => "utf-8");
$OUT = $msg->as_string;
}

@ -1,8 +0,0 @@
{
use Locale::gettext;
use esmith::I18N;
my $i18n = new esmith::I18N;
$i18n->setLocale('expireAutoReply.tmpl');
}

@ -1,19 +0,0 @@
{
use Mime::Lite;
my $msg = MIME::Lite->new(
Subject => gettext("This account is no longer valid"),
From => "\$USER@" . $DomainName
Data => gettext("This is an automatic message in reply to your email with the following subject:") . "\n" .
"%S" .
gettext("I'm sorry to inform you that the email address \$RECIPIENT is no longer valid") .
($props{EmailForward} =~ /^(forward|both)$/) ? sprintf(gettext("Your mail has been forwarded to %s"), $props{ForwardAddress}) .
gettext("This forward is only temporary, you should update your addressbook") : "";
);
$msg->attr("content-type" => "text/plain");
$msg->attr("content-type.charset" => "utf-8");
$OUT = $msg->as_string;
}
Loading…
Cancel
Save