X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=onak-mail.pl.in;h=2083042e86d716ba7bc19fb7c93b599489c4d787;hb=58ed9a0076feb9604154b99da6ed1907ca7df089;hp=68439d242079506fdeaac1eb24be8d9539321086;hpb=d4aa4e6ee07db203ef2a456a2afb9be52da8067c;p=onak.git diff --git a/onak-mail.pl.in b/onak-mail.pl.in index 68439d2..2083042 100644 --- a/onak-mail.pl.in +++ b/onak-mail.pl.in @@ -21,7 +21,7 @@ my %config; # upgrades. # sub readoldconfig { - open(CONFIG, "@CONFIGOLD@") or + open(CONFIG, "@CMAKE_INSTALL_FULL_SYSCONFDIR@/onak.conf") or die "Can't read config file: $!"; while () { @@ -57,25 +57,25 @@ sub readoldconfig { # sub readconfig { # Prefer the old style config if it exists. - if (-e "@CONFIGOLD@") { + if (-e "@CMAKE_INSTALL_FULL_SYSCONFDIR@/onak.conf") { &readoldconfig; return; } - open(CONFIG, "@CONFIG@") or + open(CONFIG, "@CMAKE_INSTALL_FULL_SYSCONFDIR@/onak.ini") or die "Can't read config file: $!"; - $section = ""; + my $section = ""; while () { if (/^#/ or /^$/) { # Ignore; comment line. } elsif (/^\[(\w+)\]/) { - section = $1; - } elsif ($section == "main") { + $section = $1; + } elsif ($section eq "main") { if (/^logfile\s*=\s*(.*)/) { $config{'logfile'} = $1; } - } elsif ($section == "mail") { + } elsif ($section eq "mail") { if (/^this_site\s*=\s*(.*)/) { $config{'thissite'} = $1; } elsif (/^maintainer_email\s*=\s*(.*)/) {