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}; |
lx-erp.conf | ||
---|---|---|
17 | 17 |
$eur= 1; |
18 | 18 |
|
19 | 19 |
# location of sendmail |
20 |
$sendmail = "| /usr/sbin/sendmail -t";
|
|
20 |
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
|
|
21 | 21 |
|
22 | 22 |
# set language for login and admin |
23 | 23 |
$language = "de"; |
lx-erp.conf.default | ||
---|---|---|
17 | 17 |
$eur= 1; |
18 | 18 |
|
19 | 19 |
# location of sendmail |
20 |
$sendmail = "| /usr/sbin/sendmail -t";
|
|
20 |
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
|
|
21 | 21 |
|
22 | 22 |
# set language for login and admin |
23 | 23 |
$language = "de"; |
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.