# HG changeset patch # User meillo@marmaro.de # Date 1274268785 -7200 # Node ID 3cb6f383f07ed609c02e75a5fc398e8b2bb28acb # Parent f0334dc87e1d043e6f21636ccab3fe70085c6114 fixed tests/local.sh commented unnecessary lines in config only out (should be polished) {log,mail,spool}_dir require absolute paths diff -r f0334dc87e1d -r 3cb6f383f07e src/masqmail.c --- a/src/masqmail.c Mon May 17 13:16:07 2010 +0200 +++ b/src/masqmail.c Wed May 19 13:33:05 2010 +0200 @@ -629,6 +629,13 @@ if (debug_level >= 0) /* if >= 0, it was given by argument */ conf.debug_level = debug_level; + /* It appears that changing to / ensures that we are never in + a directory which we cannot access. This situation could be + possible after changing identity. + Maybe we should only change to / if we not run as user, to + allow relative paths for log files in test setups for + instance. + */ chdir("/"); if (!conf.run_as_user) { diff -r f0334dc87e1d -r 3cb6f383f07e tests/Makefile --- a/tests/Makefile Mon May 17 13:16:07 2010 +0200 +++ b/tests/Makefile Wed May 19 13:33:05 2010 +0200 @@ -2,10 +2,11 @@ # heavily based on Makefile.am written by oliver kurth all: test.conf local.sh smtpout.sh - + mkdir -p ./input ./lock test.conf: conf.templ - sed s/SMTP_HOST/`hostname`/ conf.templ > test.conf + # fails if the current path contains `^'. + sed "s/SMTP_HOST/`hostname`/; s^PWD^`pwd`^" conf.templ > test.conf local.sh: test.templ sed s/RECV_HOST/localhost/ test.templ > local.sh @@ -17,3 +18,4 @@ clean: rm -f test.conf local.sh smtpout.sh + rm -rf ./input ./lock diff -r f0334dc87e1d -r 3cb6f383f07e tests/conf.templ --- a/tests/conf.templ Mon May 17 13:16:07 2010 +0200 +++ b/tests/conf.templ Wed May 19 13:33:05 2010 +0200 @@ -26,7 +26,7 @@ do_queue = false # The name with which MasqMail identifies itself to others: -host_name="blue.patchwork.net" +host_name="SMTP_HOST" # Hosts considered local: #local_hosts="localhost;blue.patchwork.net;blue" @@ -42,25 +42,25 @@ # send messages to this port: # probably this will also be configurable on host basis -remote_port=25 +#remote_port=25 # where MasqMail stores its spool files and other stuff: #spool_dir="/var/spool/masqmail" -spool_dir="." +spool_dir="PWD" # where local mail will be written to: #mail_dir="/var/spool/mail" -mail_dir="." +mail_dir="PWD" # use syslogd for logs? use_syslog=false # directory for log files if not using syslogd: #log_dir="/var/masqmail" -log_dir="." +log_dir="PWD" # special routes: -connect_route.GWDG = "src/gwdg.route" -connect_route.Argon = "src/argon.route" +#connect_route.GWDG = "src/gwdg.route" +#connect_route.Argon = "src/argon.route"