From 2097525dc2d8e0d65fe7f2f07be7f642a70cc98c Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 28 Feb 2017 15:02:43 +0100 Subject: gültige Adressaten in optionen.konf ausgelagert MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- optionen.konf | 3 +++ unit1.pas | 35 ++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 optionen.konf diff --git a/optionen.konf b/optionen.konf new file mode 100644 index 0000000..fa5e6e1 --- /dev/null +++ b/optionen.konf @@ -0,0 +1,3 @@ +aufploppen = NEIN +Ton geben = JA +gültiger Adressat = .*@eckner\.net|(ee|intern|vorstand)@wurzel\.org|erich\.eckner@uni-jena\.de|erich\.eckner@gmx\.de|(ioq_(nlo|staff)|alle_mitarbeiter|fsr-physik-newsletter)@listserv\.uni-jena\.de|(sox-users|logwatch-devel)@lists\.sourceforge\.net|gmp-discuss@gmplib\.org|hashcash@freelists\.org|crux(-commits)?@lists\.crux\.nu|radvd-devel-l@lists\.litech\.org|arch-general-request@archlinux\.org|users@httpd\.apache\.org diff --git a/unit1.pas b/unit1.pas index 32a5b48..835bb19 100644 --- a/unit1.pas +++ b/unit1.pas @@ -53,9 +53,20 @@ uses myStringListUnit, lowLevelUnit, process; procedure TForm1.FormCreate(Sender: TObject); var - sl: tMyStringList; - s: string; + sl: tMyStringList; + s,ga: string; begin + ga:='.*@eckner\.net' +'|'+ + '(ee|intern|vorstand)@wurzel\.org' +'|'+ + 'erich\.eckner@uni-jena\.de' +'|'+ + 'erich\.eckner@gmx\.de' +'|'+ + '(ioq_(nlo|staff)|alle_mitarbeiter|fsr-physik-newsletter)@listserv\.uni-jena\.de' +'|'+ + '(sox-users|logwatch-devel)@lists\.sourceforge\.net' +'|'+ + 'gmp-discuss@gmplib\.org' +'|'+ + 'hashcash@freelists\.org' +'|'+ + 'crux(-commits)?@lists\.crux\.nu' +'|'+ + 'radvd-devel-l@lists\.litech\.org' +'|'+ + 'arch-general-request@archlinux\.org'; if fileexists(extractfilepath(application.exename)+'optionen.konf') then begin sl:=tMyStringList.create; sl.loadFromFile(extractfilepath(application.exename)+'optionen.konf'); @@ -78,6 +89,10 @@ begin else if s<>'' then raise exception.create(''''+s+''' ist kein gültiger Wert für ''Ton geben'' (ja|nein)!'); + s:=sl.grepFirst('^gültiger\s+Adressat\s*='); + if s<>'' then + ga:=s; + sl.free; end; @@ -88,19 +103,7 @@ begin pc.host:='eckner.net'; pc.user:='notify@eckner.net'; pc.pass:='C7sd7k8*'; - pc.gueltigerAdressat:='('+ - '.*@eckner\.net' +'|'+ - '(ee|intern|vorstand)@wurzel\.org' +'|'+ - 'erich\.eckner@uni-jena\.de' +'|'+ - 'erich\.eckner@gmx\.de' +'|'+ - '(ioq_(nlo|staff)|alle_mitarbeiter|fsr-physik-newsletter)@listserv\.uni-jena\.de' +'|'+ - '(sox-users|logwatch-devel)@lists\.sourceforge\.net' +'|'+ - 'gmp-discuss@gmplib\.org' +'|'+ - 'hashcash@freelists\.org' +'|'+ - 'crux(-commits)?@lists\.crux\.nu' +'|'+ - 'radvd-devel-l@lists\.litech\.org' +'|'+ - 'arch-general-request@archlinux\.org'+ - ')'; + pc.gueltigerAdressat:='('+ga+')'; pc.port:=995; end; @@ -131,6 +134,8 @@ begin else sl.add('Ton geben = NEIN'); + sl.add('gültiger Adressat = '+copy(pc.gueltigerAdressat,2,length(pc.gueltigerAdressat)-2)); + sl.saveToFile(extractfilepath(application.exename)+'optionen.konf'); sl.free; end; -- cgit v1.2.3-70-g09d2