aboutsummaryrefslogtreecommitdiff
path: root/mflib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-03-19 00:13:37 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-03-19 00:13:37 +0000
commit8d9cffd85d23a38fd3f794c594c1779401906688 (patch)
tree47acca346cd06cb9d9a52b8bad88e328330bc8ce /mflib
parent8500d9de5b108aba5221bd3d92a2743b050ddf19 (diff)
downloadmailfromd-8d9cffd85d23a38fd3f794c594c1779401906688.tar.gz
mailfromd-8d9cffd85d23a38fd3f794c594c1779401906688.tar.bz2
Implement db_name
git-svn-id: file:///svnroot/mailfromd/trunk@1294 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'mflib')
-rw-r--r--mflib/mx.mf12
1 files changed, 5 insertions, 7 deletions
diff --git a/mflib/mx.mf b/mflib/mx.mf
index 509e8d29..9e7b9ed3 100644
--- a/mflib/mx.mf
+++ b/mflib/mx.mf
@@ -52,19 +52,15 @@
# has to be set to point to the same "dns" format database file,
# that has bee configured using '#pragma database dns file' option.
-#include_once "dns.mf"
+#include_once <dns.mf>
-# TODO for Sergey: predefined variable as counterpart mirroring setup
-# of '#pragma database dns file' would suffice here.
-# I really hate to have basic config. parameters scattered
-# around this way (see comment above 'set db' below).
-set db "/var/run/mailfromd/dns.db"
+#pragma regex push +extended
func mxof(string domain) returns s
do
set dumb hasmx $1 # assure %db is populated with MX records
set mxservers ""
- if dbget(%db, "MX " %domain, "", 1) matches '^[0-9]+ (.*)'
+ if dbget(db_name("dns"), "MX " %domain, "", 1) matches '^[0-9]+ (.*)'
set mxservers "\1"
fi
return %mxservers
@@ -86,3 +82,5 @@ func has_same_mx(string domain1, string domain2) returns n
do
return (mxof $1 = mxof $2)
done
+
+#pragma regex pop \ No newline at end of file

Return to:

Send suggestions and report system problems to the System administrator.