Revision 920fd369
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
SL/Mailer.pm | ||
---|---|---|
package Mailer;
|
||
|
||
use SL::Common;
|
||
use SL::Template;
|
||
|
||
sub new {
|
||
$main::lxdebug->enter_sub();
|
||
... | ... | |
|
||
local (*IN, *OUT);
|
||
|
||
my $boundary = time;
|
||
$boundary = "LxOffice-$self->{version}-$boundary";
|
||
my $domain = $self->{from};
|
||
$domain =~ s/(.*?\@|>)//g;
|
||
my $msgid = "$boundary\@$domain";
|
||
my $boundary = time();
|
||
$boundary = "LxOffice-$self->{version}-$boundary";
|
||
my $domain = $self->{from};
|
||
$domain =~ s/(.*?\@|>)//g;
|
||
my $msgid = "$boundary\@$domain";
|
||
|
||
my $form = $main::form;
|
||
my $myconfig = \%main::myconfig;
|
||
|
||
my $email = $myconfig->{email};
|
||
$email =~ s/[^\w\.\-\+=@]//ig;
|
||
|
||
$form->{myconfig_email} = $email;
|
||
|
||
my $template = PlainTextTemplate->new(undef, $form, $myconfig);
|
||
my $sendmail = $template->parse_block($main::sendmail);
|
||
|
||
$self->{charset} = Common::DEFAULT_CHARSET unless $self->{charset};
|
||
|
||
if (!open(OUT, $main::sendmail)) {
|
||
if (!open(OUT, $sendmail)) {
|
||
$main::lxdebug->leave_sub();
|
||
return "$main::sendmail : $!";
|
||
return "$sendmail : $!";
|
||
}
|
||
|
||
$self->{contenttype} = "text/plain" unless $self->{contenttype};
|
lx-erp.conf | ||
---|---|---|
$eur= 1;
|
||
|
||
# location of sendmail
|
||
$sendmail = "| /usr/sbin/sendmail -t";
|
||
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
|
||
|
||
# set language for login and admin
|
||
$language = "de";
|
lx-erp.conf.default | ||
---|---|---|
$eur= 1;
|
||
|
||
# location of sendmail
|
||
$sendmail = "| /usr/sbin/sendmail -t";
|
||
$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
|
||
|
||
# set language for login and admin
|
||
$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.