Configure Reply-To address (#312)

This commit is contained in:
Clément Oudot 2011-05-27 09:41:13 +00:00
parent e661459a88
commit eb01359322
4 changed files with 16 additions and 6 deletions

View File

@ -133,6 +133,8 @@ localStorageOptions={ 'namespace' => 'MyNamespace', 'default_expires_in' => 600,
;SMTPAuthPass = secret
# Mail From address
;mailFrom = noreply@test.com
# Reply To
;mailReplyTo = noreply@test.com
# Mail confirmation URL
;mailUrl = http://reset.example.com
# Mail subject for confirmation message

View File

@ -773,7 +773,7 @@ sub struct {
passwordManagement => {
_nodes => [
qw(SMTPServer SMTPAuthUser SMTPAuthPass mailUrl mailFrom mailSubject mailBody mailConfirmSubject mailConfirmBody randomPasswordRegexp)
qw(SMTPServer SMTPAuthUser SMTPAuthPass mailUrl mailFrom mailReplyTo mailSubject mailBody mailConfirmSubject mailConfirmBody randomPasswordRegexp)
],
_help => 'password',
SMTPServer => 'text:/SMTPServer',
@ -781,6 +781,7 @@ sub struct {
SMTPAuthPass => 'text:/SMTPAuthPass',
mailUrl => 'text:/mailUrl',
mailFrom => 'text:/mailFrom',
mailReplyTo => 'text:/mailReplyTo',
mailSubject => 'text:/mailSubject',
mailBody => 'textarea:/mailBody',
mailConfirmSubject => 'text:/mailConfirmSubject',
@ -1195,6 +1196,7 @@ sub testStruct {
keyMsgFail => 'Bad category ID',
},
mailFrom => $testNotDefined,
mailReplyTo => $testNotDefined,
trustedDomains => $testNotDefined,
exportedAttr => $testNotDefined,
mailSubject => $testNotDefined,

View File

@ -185,6 +185,7 @@ sub en {
mailConfirmSubject => 'Confirmation mail subject',
mailFrom => 'Mail sender',
mailLDAPFilter => 'Mail filter',
mailReplyTo => 'Reply address',
mailSubject => 'Success mail subject',
mailUrl => 'Page URL',
managerDn => 'Account',
@ -579,6 +580,7 @@ sub fr {
mailConfirmSubject => 'Sujet du message de confirmation',
mailFrom => 'Expéditeur du message',
mailLDAPFilter => 'Filtre mail',
mailReplyTo => 'Adresse de réponse',
mailSubject => 'Sujet du message de succès',
mailUrl => 'URL de la page',
managerDn => 'Compte de connexion LDAP',

View File

@ -42,13 +42,17 @@ sub send_mail {
$self->lmLog( "SMTP Subject " . $subject, 'debug' );
$self->lmLog( "SMTP Body " . $body, 'debug' );
$self->lmLog( "SMTP HTML flag " . ( $html ? "on" : "off" ), 'debug' );
$self->lmLog( "SMTP Reply-To " . $self->{mailReplyTo}, 'debug' )
if $self->{mailReplyTo};
eval {
my $message = MIME::Lite->new(
From => $self->{mailFrom},
To => $mail,
Subject => $subject,
Type => "TEXT",
Data => $body,
From => $self->{mailFrom},
To => $mail,
"Reply-To" => $self->{mailReplyTo},
Subject => $subject,
Type => "TEXT",
Data => $body,
);
$message->attr( "content-type" => "text/html; charset=utf-8" ) if $html;
$self->{SMTPServer}