| 1 | # UVconfig: Reads config files and tests configuration |
| 2 | # Used by all components |
| 3 | |
| 4 | package UVconfig; |
| 5 | |
| 6 | use strict; |
| 7 | use Net::Domain qw(hostname hostfqdn hostdomain); |
| 8 | use UVmessage; |
| 9 | use vars qw(@ISA @EXPORT $VERSION $usevote_version %config %messages |
| 10 | @rules @groups $bdsg_regexp $bdsg2_regexp %ids %functions); |
| 11 | |
| 12 | require Exporter; |
| 13 | @ISA = qw(Exporter); |
| 14 | @EXPORT = qw($usevote_version %config %messages @rules @groups |
| 15 | $bdsg_regexp $bdsg2_regexp %ids %functions); |
| 16 | |
| 17 | # Module version |
| 18 | $VERSION = "0.18"; |
| 19 | |
| 20 | # Usevote version |
| 21 | $usevote_version = "UseVoteGer 4.12"; |
| 22 | |
| 23 | sub read_config { |
| 24 | |
| 25 | my ($cfgfile, $redir_errors) = @_; |
| 26 | |
| 27 | # Default configuration options (overwritten in usevote.cfg) |
| 28 | %config = (votefile => "votes", |
| 29 | votename => "unkonfiguriertes Usevote", |
| 30 | sampleballotfile => "ballot.sample", |
| 31 | resultfile => "ergebnis.alle", |
| 32 | rulefile => "usevote.rul", |
| 33 | badaddrfile => "mailpatterns.cfg", |
| 34 | messagefile => "messages.cfg", |
| 35 | idfile => "scheinkennungen", |
| 36 | requestfile => "anforderung", |
| 37 | errorfile => "errors.log", |
| 38 | lockfile => "usevote.lock", |
| 39 | replyto => 0, |
| 40 | personal => 0, |
| 41 | proportional => 0, |
| 42 | bdsg => 0, |
| 43 | onestep => 0, |
| 44 | multigroup => 0, |
| 45 | voteack => 1, |
| 46 | voteaccount => "<> (unkonfiguriertes Usevote)", |
| 47 | mailfrom => "<> (unkonfiguriertes Usevote)", |
| 48 | envelopefrom => "<>", |
| 49 | mailboxtype => "mbox", |
| 50 | mailstart => "^From ", |
| 51 | archivedir => "fertig", |
| 52 | tmpdir => "tmp", |
| 53 | templatedir => "templates", |
| 54 | formats => "UVformats.pm", |
| 55 | domailfile => "tmp/domail", |
| 56 | controlfile => "tmp/ack.control", |
| 57 | mailcmd => "sendmail -oi -oem", |
| 58 | mailcc => "", |
| 59 | sleepcmd => "sleep 1", |
| 60 | clearcmd => "clear", |
| 61 | diff => "diff", |
| 62 | pager => "less", |
| 63 | pop3 => 0, |
| 64 | pop3server => "localhost", |
| 65 | pop3port => 110, |
| 66 | pop3user => "default", |
| 67 | pop3pass => "default", |
| 68 | pop3delete => 0, |
| 69 | pop3uidlcache => "uidlcache", |
| 70 | pop3server_req => "localhost", |
| 71 | pop3port_req => 110, |
| 72 | pop3user_req => "default", |
| 73 | pop3pass_req => "default", |
| 74 | pop3delete_req => 0, |
| 75 | pop3uidlcache_req => "uidlcache_req", |
| 76 | pop3server_bounce => "localhost", |
| 77 | pop3port_bounce => 110, |
| 78 | pop3user_bounce => "default", |
| 79 | pop3pass_bounce => "default", |
| 80 | pop3delete_bounce => 0, |
| 81 | pop3uidlcache_bounce => 'uidlcache_bounce', |
| 82 | smtp => 0, |
| 83 | smtpserver => 'localhost', |
| 84 | smtpport => 25, |
| 85 | smtphelo => hostfqdn(), |
| 86 | fqdn => hostfqdn(), |
| 87 | smtpauth => 0, |
| 88 | smtpuser => '', |
| 89 | smtppass => '', |
| 90 |