Revision 920fd369
Von Moritz Bunkus vor etwa 17 Jahren hinzugefügt
SL/Mailer.pm | ||
---|---|---|
31 | 31 |
package Mailer; |
32 | 32 |
|
33 | 33 |
use SL::Common; |
34 |
use SL::Template; |
|
34 | 35 |
|
35 | 36 |
sub new { |
36 | 37 |
$main::lxdebug->enter_sub(); |
... | ... | |
93 | 94 |
|
94 | 95 |
local (*IN, *OUT); |
95 | 96 |
|
96 |
my $boundary = time; |
|
97 |
$boundary = "LxOffice-$self->{version}-$boundary"; |
|
98 |
my $domain = $self->{from}; |
|
99 |
$domain =~ s/(.*?\@|>)//g; |
|
100 |
my $msgid = "$boundary\@$domain"; |
|
97 |
my $boundary = time(); |
|
98 |
$boundary = "LxOffice-$self->{version}-$boundary"; |
|
99 |
my $domain = $self->{from}; |
|
100 |
$domain =~ s/(.*?\@|>)//g; |
|
101 |
my $msgid = "$boundary\@$domain"; |
|
102 |
|
|
103 |
my $form = $main::form; |
|
104 |
my $myconfig = \%main::myconfig; |
|
105 |
|
|
106 |
my $email = $myconfig->{email}; |
|
107 |
$email =~ s/[^\w\.\-\+=@]//ig; |
|
108 |
|
|
109 |
$form->{myconfig_email} = $email; |
|
110 |
|
|
111 |
my $template = PlainTextTemplate->new(undef, $form, $myconfig); |
|
112 |
my $sendmail = $template->parse_block($main::sendmail); |
|
101 | 113 |
|
102 | 114 |
$self->{charset} = Common::DEFAULT_CHARSET unless $self->{charset}; |
103 | 115 |
|
104 |
if (!open(OUT, $main::sendmail)) {
|
|
116 |
if (!open(OUT, $sendmail)) { |
|
105 | 117 |
$main::lxdebug->leave_sub(); |
106 |
return "$main::sendmail : $!";
|
|
118 |
return "$sendmail : $!"; |
|
107 | 119 |
} |
108 | 120 |
|
109 | 121 |
$self->{contenttype} = "text/plain" unless $self->{contenttype}; |
Auch abrufbar als: Unified diff
Beim Verschicken von Emails wird das Kommando $sendmail durch Lx-Offices Template-System geschleust. Vordefiniert ist, dass Sendmail der Parameter "-f emailadresse" mitgegeben wird, sodass die Envelope-From-Adresse die des aktuellen Lx-Office-Benutzers und nicht die des Webservers ist. Das vermeidet, dass Emails wegen Spam/nicht existierender Domänennamen von Providern abgelehnt wedren.