Alec mial racje koncowki lini ktorych nie widzial vi
pytanie jeszcze mam odnosnie ustawien smtp
w sekcji phpui mam te ustawienia,
przekopiowalem je tez do sekcji [sendinvoices]
smtp_host = ip_serwera
; Smtp server port. Default: 25
smtp_port = 25
; Smtp username used with SMTP-AUTH. Default: none
smtp_username = user
; Smtp password used with SMTP-AUTH. Default: none
smtp_password = haslo_us4era
; Smtp authorization method. By default the best supported method
will be used.]
smtp_auth_type = PLAIN
a mimo tego dostaje komunikat :
/lms/bin# ./lms-sendinvoices -f=2007/12/01
lms-sendinvoices, version 1.8.13 Tessa
(C) 2001-2006 LMS Developers
Using file /etc/lms/lms.ini as config.
Fatal error: I need params for SMTP connection! Can't continue, exiting.
z ktorej sekcji bierze skrypt parametry ?
gdzie trzeba mu zadac parametry do autoryzacji?
--
Pozdrowienia,
Rafał
W Twoim liście datowanym 18 grudnia 2007 (12:32:21) można przeczytać:
DW> R99 na wp napisał(a):
>> Niestety to nie to, skopiowanie naglowka skryptu nie pomoglo.
>> wczesniej porownywalem i nie widzialem roznic.
>>
DW> Hmm, mnie też to wygląda, jakby ścieżka do perla (pierwsza linijka
DW> skryptu) była coś nie teges :/
DW> Swoją drogą nie pamiętam, czy pisałem, że do działania skryptu potrzebny
DW> jest moduł Mail::SendEasy (pojedynczy, bez żadnych zależności, także
DW> intaluje się bez problemów).
DW> Na wszelki wypadek w załączniku jest wersja, która działa u mnie od
DW> kilkunastu dni.
DW> pozdrawiam,
DW> widynek
--
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
R99 na wp wrote:
> Niestety to nie to, skopiowanie naglowka skryptu nie pomoglo.
> wczesniej porownywalem i nie widzialem roznic.
>
>
a może zapisałeś go z windowsowymi znakami końca linii?
--
Aleksander 'A.L.E.C' Machniak http://alec.pl gg:2275252
LAN Management System Developer http://lms.org.pl
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
R99 na wp napisał(a):
> Niestety to nie to, skopiowanie naglowka skryptu nie pomoglo.
> wczesniej porownywalem i nie widzialem roznic.
>
Hmm, mnie też to wygląda, jakby ścieżka do perla (pierwsza linijka
skryptu) była coś nie teges :/
Swoją drogą nie pamiętam, czy pisałem, że do działania skryptu potrzebny
jest moduł Mail::SendEasy (pojedynczy, bez żadnych zależności, także
intaluje się bez problemów).
Na wszelki wypadek w załączniku jest wersja, która działa u mnie od
kilkunastu dni.
pozdrawiam,
widynek
#!/usr/bin/perl
#
# LMS version 1.8.13 Tessa
#
# Copyright (C) 2001-2006 LMS Developers
#
# Please, see the doc/AUTHORS for more information about authors!
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
# $Id: lms-sendinvoices,v 1.28.2.2 2006/01/16 09:35:17 alec Exp $
use strict;
use DBI;
use Config::IniFiles;
use Getopt::Long;
use vars qw($configfile $help $version $quiet $fakedate);
use POSIX qw(strftime);
use LWP::UserAgent;
use Time::Local;
use MIME::QuotedPrint;
use Text::Iconv;
use Mail::SendEasy;
my $_version = '1.8.13 Tessa';
my %options = (
"--config-file|C=s" => \$configfile,
"--quiet|q" => \$quiet,
"--help|h" => \$help,
"--version|v" => \$version,
"--fakedate|f=s" => \$fakedate,
);
Getopt::Long::config("no_ignore_case");
GetOptions(%options);
if($help)
{
print STDERR <<EOF;
lms-sendinvoices, version $_version
(C) 2001-2006 LMS Developers
-C, --config-file=/etc/lms/lms.ini alternate config file
(default: /etc/lms/lms.ini);
-q, --quiet suppress any output, except errors;
-h, --help print this help and exit;
-v, --version print version info and exit;
-f, --fakedate=YYYY/MM/DD override system date;
EOF
exit 0;
}
if($version)
{
print STDERR <<EOF;
lms-sendinvoices, version $_version
(C) 2001-2006 LMS Developers
EOF
exit 0;
}
if(!$configfile)
{
$configfile = "/etc/lms/lms.ini";
}
if(! -r $configfile)
{
print STDERR "Fatal error: Unable to read configuration file $configfile, exiting.\n";
exit 1;
}
if(!$quiet)
{
print STDOUT "lms-sendinvoices, version $_version\n";
print STDOUT "(C) 2001-2006 LMS Developers\n";
print STDOUT "Using file $configfile as config.\n";
}
my $ini = new Config::IniFiles -file => $configfile;
print @Config::IniFiles::errors;
my $dbtype = $ini->val('database', 'type') || 'mysql';
my $dbhost = $ini->val('database', 'host') || 'localhost';
my $dbuser = $ini->val('database', 'user') || 'root';
my $dbpasswd = $ini->val('database', 'password') || '';
my $dbname = $ini->val('database', 'database') || 'lms';
my $dbencoding = $ini->val('database', 'server_encoding') || 'UTF-8';
my $filetype = $ini->val('invoices', 'type') || '';
my $lms_url = $ini->val('sendinvoices', 'lms_url') || 'http://localhost/lms/';
my $lms_user = $ini->val('sendinvoices', 'lms_user') || '';
my $lms_password = $ini->val('sendinvoices', 'lms_password') || '';
my $debug_email = $ini->val('sendinvoices', 'debug_email') || '';
my $sender_name = $ini->val('sendinvoices', 'sender_name') || '';
my $sender_email = $ini->val('sendinvoices', 'sender_email') || '';
my $mail_subject = $ini->val('sendinvoices', 'mail_subject') || 'Invoice No. %invoice';
my $smtp_user = $ini->val('sendinvoices', 'smtp_user') || '';
my $smtp_pass = $ini->val('sendinvoices', 'smtp_pass') || '';
my $smtp_host = $ini->val('sendinvoices', 'smtp_host') || '';
#my $mail_body = $ini->val('sendinvoices', 'mail_body') || 'Attached file with Invoice No. %invoice';
my $dst_file = '/tmp/tmp/faktura.pdf';
if(!$sender_name)
{
print STDERR "Fatal error: sender_name unset! Can't continue, exiting.\n";
exit 1;
}
if(!$sender_email)
{
print STDERR "Fatal error: sender_email unset! Can't continue, exiting.\n";
exit 1;
}
if(!$smtp_host || !$smtp_user || !$smtp_pass)
{
print STDERR "Fatal error: I need params for SMTP connection! Can't continue, exiting.\n";
exit 1;
}
my $dbase;
my $utsfmt;
if($dbtype eq "mysql")
{
$dbase = DBI->connect("DBI:mysql:database=$dbname;host=$dbhost","$dbuser","$dbpasswd", { RaiseError => 1 });
$utsfmt = "UNIX_TIMESTAMP()";
}
elsif($dbtype eq "postgres")
{
$dbase = DBI->connect("DBI:Pg:dbname=$dbname;host=$dbhost","$dbuser","$dbpasswd", { RaiseError => 1 });
$utsfmt = "EXTRACT(EPOCH FROM CURRENT_TIMESTAMP(0))";
}
else
{
print STDERR "Fatal error: unsupported database type: $dbtype, exiting.\n";
exit 1;
}
#przestawiamy format faktur w bazie na PDF - w biurze uzywamy HTML'a
my $dbq = $dbase->prepare("UPDATE uiconfig SET value='standard' WHERE section='invoices' AND var='template_file'");
$dbq->execute();
$dbq = $dbase->prepare("UPDATE uiconfig SET value='pdf' WHERE section='invoices' AND var='type'");
$dbq->execute();
$dbq = $dbase->prepare("SELECT value FROM uiconfig WHERE section='invoices' AND var='type' AND disabled=0");
$dbq->execute();
if(my $row = $dbq->fetchrow_hashref())
{
$filetype = $row->{'value'};
}
my $fencoding = 'quoted-printable';
my $ftype = 'text/html';
my $fext = 'html';
if($filetype eq 'pdf')
{
my $ftype = 'application/octetstream';
my $fencoding = '';
my $fext = 'pdf';
}
sub localtime2()
{
if($fakedate)
{
my @fakedate = split(/\//, $fakedate);
return localtime(timelocal(0,0,0,$fakedate[2],$fakedate[1]-1,$fakedate[0]));
}
else
{
return localtime();
}
}
my $converter = Text::Iconv->new($dbencoding, "UTF-8");
$sender_name = '=?UTF-8?Q?'.encode_qp($sender_name, '').'?=';
my $month = sprintf("%d",strftime("%m",localtime2()));
my $day = strftime("%e",localtime2());
my $year = strftime("%Y",localtime2());
my $daystart = strftime("%s", 0, 0, 0, $day, $month - 1, $year - 1900);
my $dayend = strftime("%s", 59, 59, 23, $day, $month - 1, $year - 1900);
$dbq = $dbase->prepare('SELECT documents.id AS id, number, cdate, email, documents.name AS name, customerid, template
FROM documents
LEFT JOIN customers ON customers.id = customerid
LEFT JOIN numberplans ON numberplanid = numberplans.id
WHERE deleted = 0 AND type = 1 AND email != \'\' AND cdate >= '.$daystart.' AND cdate <= '.$dayend);
$dbq->execute();
while(my $row = $dbq->fetchrow_hashref())
{
my $ua = LWP::UserAgent->new;
$ua->timeout(240);
my $response = $ua->get($lms_url.'/?m=invoice&fetchsingle=1&override=1&id='.$row->{'id'}.'&loginform[login]='.$lms_user.'&loginform[pwd]='.$lms_password);
my $custemail = $debug_email || $row->{'email'};
my $invoice_number = $row->{'template'} || '%N/LMS/%Y';
$invoice_number =~ s/%(\d*)N/sprintf"%0${1}d",$row->{'number'}/e;
$invoice_number = strftime($invoice_number, localtime($row->{'cdate'}));
my $subject = $mail_subject;
$subject =~ s/%invoice/$invoice_number/g;
my $msgid = $row->{'id'};
#zapisujemy fakturkê do pliku
open(DSTFILE, ">$dst_file") or die("nie udalo sie otworzyc pliku $dst_file do zapisu");
print DSTFILE $response->content;
close (DSTFILE);
chown 0,0, $dst_file;
chmod 0700, $dst_file;
my $status = Mail::SendEasy::send(
smtp => $smtp_host ,
user => $smtp_user ,
pass => $smtp_pass ,
from => $sender_email ,
from_title => $sender_name ,
reply => $sender_email ,
error => $sender_email ,
to => $custemail ,
subject => '=?UTF-8?Q?'.encode_qp($subject, '').'?=',
anex => $dst_file ,
msg => "Dzieñ dobry,\n\nw za³±czniku do tej wiadomo¶ci znajduje siê elektroniczny obraz faktury VAT.\n\nDo obejrzenia faktury konieczny jest czytnik PDF - np. program Foxit Reader lub Adobe Acrobat Reader.\n\nZ góry dziêkujemy za terminowe uregulowanie p³atno¶ci.\n\n--\npozdrawiamy, " ,
# html => "<b>Tutaj mo¿na wkleiæ co¶ w HTML'u</b>" ,
msgid => $msgid ,
) ;
if ($status) { print STDOUT "Wyslano mail do $custemail\n"; }
if (!$status) { Mail::SendEasy::error ;}
}
##ustawiamy format faktur z powrotem na HTML
$dbq = $dbase->prepare("UPDATE uiconfig SET value='html' WHERE section='invoices' AND var='type'");
$dbq->execute();
$dbq = $dbase->prepare("UPDATE uiconfig SET value='invoice.html' WHERE section='invoices' AND var='template_file'");
$dbq->execute();
$dbq->finish();
$dbase->disconnect();
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
Niestety to nie to, skopiowanie naglowka skryptu nie pomoglo.
wczesniej porownywalem i nie widzialem roznic.
--
Pozdrowienia,
Rafał
W Twoim liście datowanym 18 grudnia 2007 (11:29:02) można przeczytać:
JU> a jak go wywolam to mowi :
JU> /lms/bin# ./lms-sendinvoices
JU> : bad interpreter: Nie ma takiego pliku ani katalogu
JU> nie pomaga tez pelna sciezka wywolania :
JU> :~# /var/www/lms/bin/lms-sendinvoices
JU> : bad interpreter: Nie ma takiego pliku ani kataloguerl
JU> czy to problem powloki, czy wewnatrz skryptu czegos brakuje
JU> oryginalny skrypt lms-sendinvoice dziala
JU> ______________________
JU> Skopiuj pierwszą linijkę z oryginalnego skryptu do tego nieoryginalnego.
JU> Umieść ją również jako pierwszą (zastąp istniejącą) i Ci zadziała ;-)
JU> -JU-
JU> _______________________________________________
JU> lms mailing list
JU> lms(a)lists.lms.org.pl
JU> http://lists.lms.org.pl/mailman/listinfo/lms
--
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
a jak go wywolam to mowi :
/lms/bin# ./lms-sendinvoices
: bad interpreter: Nie ma takiego pliku ani katalogu
nie pomaga tez pelna sciezka wywolania :
:~# /var/www/lms/bin/lms-sendinvoices
: bad interpreter: Nie ma takiego pliku ani kataloguerl
czy to problem powloki, czy wewnatrz skryptu czegos brakuje
oryginalny skrypt lms-sendinvoice dziala
______________________
Skopiuj pierwszą linijkę z oryginalnego skryptu do tego nieoryginalnego.
Umieść ją również jako pierwszą (zastąp istniejącą) i Ci zadziała ;-)
-JU-
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
Dzień Dobry
Wgralem do katalogu /lms/bin plik lms-sendinvoice
sprawdzam i jest tam , prawa ma wszelkie
/lms/bin# ls -al lms-sendinvoices
-rwxrwxrwx 1 www-data www-data 8405 2007-12-18 09:51 lms-sendinvoices
a jak go wywolam to mowi :
/lms/bin# ./lms-sendinvoices
: bad interpreter: Nie ma takiego pliku ani katalogu
nie pomaga tez pelna sciezka wywolania :
:~# /var/www/lms/bin/lms-sendinvoices
: bad interpreter: Nie ma takiego pliku ani kataloguerl
czy to problem powloki, czy wewnatrz skryptu czegos brakuje
oryginalny skrypt lms-sendinvoice dziala
--
Pozdrowienia,
Rafał
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
> > Do routingu uzywam skryptow B@roo (inet.one.pl), mialem skonfigurowane
> [...]
>
> co robią te skrypty dokladniej ?
>
Routing ogolnie :)
Chyba jeden z dwoch najbardziej znanych gotowcow, drugi to niceshaper..
--
Pozdrawiam,
Krzysiek Szczuka
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
> spróbuj
>
> alter table customers character set utf8 collate utf8_polish_ci;
> alter table rtmessages character set utf8 collate utf8_polish_ci;
>
> Pewnie możnaby to też załatwić przez zmiany w my.cnf, ale nie jestem
> pewien. Jak pomoże, to najlepiej zrobić tak dla wszystkich tabel.
>
Tak pomogło. Wielkie dzięki jednak trzeba było jeszcze zmienić kodowanie dla każdego pola w tabeli.
--
Pozdrawiam Maxwel
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms
Co może być przyczyną takiego błędu ?
CREATE ALGORITHM = UNDEFINED DEFINER = `root`@ `localhost` SQL SECURITY
DEFINER VIEW `lms1-kopia2`.`customersview` AS SELECT `c`.`id` AS `id` ,
`c`.`lastname` AS `lastname` , `c`.`name` AS `name` , `c`.`status` AS
`status` , `c`.`email` AS `email` , `c`.`address` AS `address` ,
`c`.`zip` AS `zip` , `c`.`city` AS `city` , `c`.`ten` AS `ten` ,
`c`.`ssn` AS `ssn` , `c`.`regon` AS `regon` , `c`.`rbe` AS `rbe` ,
`c`.`icn` AS `icn` , `c`.`info` AS `info` , `c`.`notes` AS `notes` ,
`c`.`serviceaddr` AS `serviceaddr` , `c`.`creationdate` AS
`creationdate` , `c`.`moddate` AS `moddate` , `c`.`creatorid` AS
`creatorid` , `c`.`modid` AS `modid` , `c`.`deleted` AS `deleted` ,
`c`.`message` AS `message` , `c`.`pin` AS `pin`
>FROM `lms1-kopia2`.`customers` `c`
WHERE NOT (
EXISTS (
SELECT 1 AS `1`
>FROM (
`lms1-kopia2`.`customerassignments` `a`
JOIN `lms1-kopia2`.`excludedgroups` `e` ON ( (
`a`.`customergroupid` = `e`.`customergroupid`
) )
)
WHERE (
(
`e`.`userid` = `lms1-kopia2`.`lms_current_user` (
)
)
AND (
`a`.`customerid` = `c`.`id`
)
)
)
)
MySQL zwrócił komunikat: Dokumentacja
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'localhost` SQL SECURITY DEFINER VIEW
`lms1-kopia2`.`customersview` AS select' at line 1
_______________________________________________
lms mailing list
lms(a)lists.lms.org.pl
http://lists.lms.org.pl/mailman/listinfo/lms