+++ /dev/null
-#
-# MailerScript Konfigurationsdatei
-#
-
-[public]
-logfile=/tmp/mailer.log
-sendmail=/usr/lib/sendmail -t
-# sendmail=cat
-
-[db]
-dsn=DBI:mysql:database=nadiraktuell;host=search.nadir.org
-user=aktuell
-passwd=aktuell
-
-[mail]
-table=content_objekt
-
-to=nadir-aktuell-abo@nadir.org
-from=aktuell@nadir.org
-reply-to=aktuell@nadir.org
-
+++ /dev/null
-#!/usr/bin/perl
-
-use DBI;
-use POSIX qw(strftime);
-
-$db_user="bla";
-$db_password="bla";
-$dbi_string="DBI:mysql:hostname=192.168.4.8;database=indy";
-
-die unless ($dbh=DBI->connect($dbi_string,$db_user,$db_password));
-
-
-### prepare
-$mo_insert_q="insert into content_objekt (titel, urheber, freigeschaltet, datum, ishtml, storage_path, thema_id, contentdata, created, lastchange, mail_sent) values (?,?,0,?,0,?,0,?,NOW(),NOW(),0)";
-$mo_insert_sth=$dbh->prepare($mo_insert_q);
-
-# setze datum
-
-$datum = &POSIX::strftime( '%Y%m%d', localtime time );
-$storage_path=&POSIX::strftime( '%Y/%m/%d', localtime time );
-
-
-$headermode=1;
-$titel="";$from="";$contentdata="";
-while (<>) {
- if($headermode==1) {
- if (/^Subject: (.*)/) {
- $titel=$1;
- if (/^Subject: <nadir-aktuell> (.*)/) {
- $titel=$1;
- }
- }
- if (/^From: (.*)/) {
- $from = $1;
- }
- if (/^$/) {
- print "Switched to Body\n";
- $headermode=0;
- }
- }
- else {
- $contentdata = $contentdata . $_;
- }
-}
- print "$datum $storage_path $from $titel \n";
- $mo_insert_sth->execute($titel, $from, $datum, $storage_path, $contentdata);
-
-
-1;
-
+++ /dev/null
-/usr/local/java/jdk/bin/java -classpath /www/nadiraktuell/source:/usr/local/java/freemarker:/usr/local/java/mm.mysql/mysql_uncomp.jar:/usr/local/java/jsdk/lib/jsdk.jar nadir.aktuell.producer.ProducerSMS
+++ /dev/null
-#
-# MailerScript Konfigurationsdatei
-#
-
-[public]
-logfile=/tmp/mailer.log
-
-[db]
-# dsn=DBI:mysql:database=campticker;host=krabat.nadir.org
-dsn=DBI:mysql:database=nadiraktuell;host=192.168.4.8
-user=aktuell
-passwd=aktuell
-
-[mail]
-table=messsages
-
+++ /dev/null
-#!/usr/bin/perl
-
-use DBI;
-
-$0=~m#[^/]+$#;
-$cmdpath=$`;
-if ($cmdpath eq "") { $cmdpath="./"; }
-
-unshift(@INC,$cmdpath."lib");
-require "property.pl";
-require "log.pl";
-
-### configure here
-
-$config_file=$cmdpath."smsreceiver.config";
-
-### no configuration beyond this line
-
-$props=&Property::read($config_file);
-
-### connect logfile
-
-tie *LOGFILE, 'Logfile', $$props{'public'}{'logfile'}, 'SMSRECEIVER';
-
-print LOGFILE "Connecting to ".$$props{'db'}{'dsn'}." as user ".$$props{'db'}{'user'}."\n";
-
-
-### connect to db
-$dbh=DBI->connect($$props{'db'}{'dsn'},$$props{'db'}{'user'},$$props{'db'}{'passwd'});
-if (!defined $dbh) {
- print LOGFILE "Error while connecting DB\n";
- exit(0);
- }
-$table=$$props{'mail'}{'table'};
-
-### prepare
-$mo_insert_q="insert into $table (produced,type_sms,message,created) values (?,?,?,NOW())";
-$mo_insert_sth=$dbh->prepare($mo_insert_q);
-
-$headermode=1;
-while (<>) {
- if($headermode==1) {
- if (/^Subject: (.*)/i) {
- $subject=$1;
- }
- if (/^From: (.*)/i) {
- $from = $1;
- }
- if (/^Content-type:\s+(.*)/i) {
- $content_type=$1;
- }
- if (/^$/) {
- $headermode=0;
- }
- }
- else {
- push(@contentdata,$_);
- }
-}
-
-### filter out mime-crap
-
-if ((defined $content_type)&&($content_type!~m#^text/plain#i)) {
- print LOGFILE "Got mime-mail: $from ($subject) ".localtime(time)."\n";
- print LOGFILE "Content: ".join('',@contentdata)."\n";
- exit();
- }
-
-### try to identify sms
-
-if ($from=~/^\+?\d+\@/) {
- ### coming from an emailaccount with a telefon number as user-part in From:
-
- ### sms is in first line of body
- $text=shift(@contentdata);
-
- $type=1;
- }
-else {
- $text=join('',@contentdata);
- $type=2;
- }
-
-print LOGFILE "$type: $text\n";
-$mo_insert_sth->execute(0,$type,$text);
+++ /dev/null
-#!/usr/bin/perl
-
-### extract
-
-use DBI;
-
-$db_user="root";
-$dbi_string="DBI:mysql:nadiraktuell";
-
-die "parameter [-form] tableName" if ($#ARGV>1 | $#ARGV==-1);
-die unless ($dbh=DBI->connect($dbi_string,$db_user));
-
-$form=0;
-
-if ($#ARGV == 1){
- $form=1;
- $tableName=$ARGV[1];
-}
-else {
- $tableName=$ARGV[0];
-}
-
-$sth=$dbh->prepare(<<EO_QUERY);
-show fields from $tableName
-EO_QUERY
-
-$sth->execute;
-
-if (defined $sth) {
-
- print(<<HEAD);
-<html>
-<head>
-<title>
-nadiraktuell.$tableName
-</title>
-<head>
-
-<body>
-<B>nadiraktuell.$tableName</B><P>
-HEAD
-
-
- if ($form==1) {
- print "<form action=\"/scripts/NadirAktuell\">
-\t<input type=hidden name=module value=$tableName>
- <input type=\"hidden\" name=\"id\" value=\"\${id}\">
- <if new>
- <input type=\"hidden\" name=\"do\" value=\"insert\">
- <else>
- <input type=\"hidden\" name=\"do\" value=\"update\">
- </if>
-
-<table border=\"0\">\n";
- }
-#
-# Schleife
-
- while (@data=$sth->fetchrow_array) {
-
- print "\n<tr>\n<td align=\"right\"><B>$data[0]:</B></td>\n";
- if ($form==1) {
- print "<td><input type=\"text\" size=\"40\" name=\"$data[0]\" value=\"\$\{$data[0]\}\"></td>\n";
- }
- else {
- print "<td><\$\{$data[0]\}></td>\n";
- }
- print "</tr>\n\n";
-
- }
-
- if ($form==1) {
- print "<td colspan=\"2\" align=\"right\">
-<if new>
-<input type=\"submit\" name=\"save\" value=\"einfügen\">
-<else>
-<input type=\"submit\" name=\"save\" value=\"speichern\">
-</if>
-</td>
-</form>
-</table>";
- }
-
-print(<<BODY);
-
-</body>
-</html>
-BODY
-}
-
-$sth->finish;
-$dbh->disconnect;
-
+++ /dev/null
-#!/usr/bin/perl
-
-use DBI;
-
-$0=~m#[^/]+$#;
-$cmdpath=$`;
-if ($cmdpath eq "") { $cmdpath="./"; }
-
-unshift(@INC,$cmdpath."lib");
-require "property.pl";
-require "log.pl";
-require "convert.pl";
-
-### configure here
-
-$config_file=$cmdpath."mail.config";
-# print $config_file,"\n";
-
-### no configuration beyond this line
-
-$props=&Property::read($config_file);
-
-### connect logfile
-
-tie *LOGFILE, 'Logfile', $$props{'public'}{'logfile'}, 'MAIL';
-print LOGFILE "starting: ".localtime(time)."\n";
-
-# print $$props{'db'}{'dsn'},$$props{'db'}{'user'},$$props{'db'}{'passwd'},"\n";
-
-
-### connect to db
-$dbh=DBI->connect($$props{'db'}{'dsn'},$$props{'db'}{'user'},$$props{'db'}{'passwd'});
-if ($dbh->errstr ne "") {
- print LOGFILE "Error while connecting DB - ".$dbh->error."\n";
- exit(0);
- }
-
-### prepare some statements
-
-$select_unsend=$dbh->prepare("select id,ort,titel,urheber,urheber_id,date_format(datum,'%d.%m.%Y') as pdatum,contentdata,abstract,islink,ishtml,link_url from ".$$props{'mail'}{'table'}." where mail_sent=0 and freigeschaltet=1 and adddate(lastchange,interval 30 MINUTE) < current_timestamp()");
-$select_urheber=$dbh->prepare("select name,email,homepage from gruppen where id=?");
-$update_unsend=$dbh->prepare("update ".$$props{'mail'}{'table'}." set mail_sent=1 where id=?");
-
-$select_unsend->execute;
-while ($hash=$select_unsend->fetchrow_hashref) {
- if (open(MAILER,"|".$$props{'public'}{'sendmail'})) {
- print MAILER "To: ".$$props{'mail'}{'to'}."\n";
- print MAILER "From: ".$$props{'mail'}{'from'}."\n";
- print MAILER "Reply-To: ".$$props{'mail'}{'reply-to'}."\n";
- print MAILER "Subject: ".$$hash{'ort'}.": ".$$hash{'titel'}."\n";
-
- print MAILER "\n"; # end of header
-
- print MAILER $$hash{'titel'}."\n";
-
- $urheber="";
- $u_email="";
- $u_homepage="";
- if ($$hash{'urheber'} eq "") {
- if ($$hash{'urheber_id'} != 0) {
- $select_urheber->execute($$hash{'urheber_id'});
- if ($line=$select_urheber->fetchrow_hashref()) {
- $urheber=$$line{'name'};
- $u_email=$$line{'email'};
- $u_hompage=$$line{'homepage'};
- }
- }
- }
- else {
- $urheber=$$hash{'urheber'};
- }
-
- if ($urheber ne "") { print MAILER "Von : ".$urheber."\n"; }
- if ($u_email ne "") { print MAILER "Email: ".$u_email."\n"; }
- if ($u_homepage ne "") { print MAILER "Page : ".$u_homepage."\n"; }
-
- print MAILER "Ort : ".$$hash{'ort'}."\n";
- print MAILER "Datum: ".$$hash{'pdatum'}."\n";
- if ($$hash{'islink'} == 1) {
- print MAILER "\n\n".$$hash{'abstract'}."\n";
- }
- else {
- if ($$hash{'ishtml'}>0) {
- print MAILER "\n\n".&html_to_text($props,$$hash{'contentdata'})."\n";
- }
- else {
- print MAILER "\n\n".$$hash{'contentdata'}."\n";
- }
- }
-
- if ($$hash{'link_url'} ne "") {
- print MAILER "Weiteres: ";
- if (substr($$hash{'link_url'},0,1) eq "/") {
- print MAILER "http://www.nadir.org";
- }
- print MAILER $$hash{'link_url'}."\n";
- }
- ### footer
- print MAILER "\n*** $LIST -- Aboliste mit Nachrichten von http://www.nadir.org\n";
- print MAILER "*** Beitraege: nadir-aktuell\@nadir.org / Redaktion: nadir-aktuell-red\@nadir.org\n";
- print MAILER "*** Unsubscribe: majordomo\@nadir.org mit unsubscribe $LIST im body\n";
-
- close(MAILER);
-
- $update_unsend->execute($$hash{'id'});
- print LOGFILE "[".$$hash{'id'}."] send\n"
- }
- else {
- print LOGFILE "Error cannot open ".$$props{'public'}{'sendmail'}." - $!\n";
- }
- }
-