aboutsummaryrefslogtreecommitdiff
path: root/mflib
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2007-04-23 13:59:43 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2007-04-23 13:59:43 +0000
commit673d72a4c919c4c8c8465d7207569081b9648e6d (patch)
treea98dd842ff47de1b3afdd86d15386eef59ff2b1e /mflib
parent3158554e485e110c1d449a4c0d85c011244cd61b (diff)
downloadmailfromd-673d72a4c919c4c8c8465d7207569081b9648e6d.tar.gz
mailfromd-673d72a4c919c4c8c8465d7207569081b9648e6d.tar.bz2
Update
git-svn-id: file:///svnroot/mailfromd/trunk@1375 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'mflib')
-rw-r--r--mflib/Makefile.am1
-rw-r--r--mflib/mx.mf86
2 files changed, 0 insertions, 87 deletions
diff --git a/mflib/Makefile.am b/mflib/Makefile.am
index e778e1bb..133a6bb1 100644
--- a/mflib/Makefile.am
+++ b/mflib/Makefile.am
@@ -24,7 +24,6 @@ inc_DATA =\
match_cidr.mf\
match_dnsbl.mf\
match_rhsbl.mf\
- mx.mf\
revip.mf\
safedb.mf\
spf.mf\
diff --git a/mflib/mx.mf b/mflib/mx.mf
deleted file mode 100644
index e6ffb75d..00000000
--- a/mflib/mx.mf
+++ /dev/null
@@ -1,86 +0,0 @@
-/* MX functions.
- Copyright (C) 2006, 2007 Jan Rafaj
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- MA 02110-1301 USA */
-
-# string mxof (string DOMAIN)
-#
-# DOMAIN : domain name to find MX servers for
-#
-# The function returns a string of MX server names for a domain sorted by
-# their preference and name. The names in the list are separated by a
-# a single space. If domain has no MX servers, empty string is returned.
-# Examples:
-#
-# prerequisities used in examples:
-# 1) domain "mafra.cz" with following MXes:
-# 10 smtp2.mafra.cz
-# 20 relay.iol.cz
-# 10 smtp1.mafra.cz
-# 2) domain "idnes.cz" with following MXes:
-# 20 relay.iol.cz
-# 10 smtp1.mafra.cz
-# 10 smtp2.mafra.cz
-# 3) domain "gnu.org" with following MXes:
-# 10 mx10.gnu.org
-# 20 mx20.gnu.org
-# 4) domain "org.pl" without MXes
-#
-# mxof("mafra.cz") => "smtp1.mafra.cz smtp2.mafra.cz relay.iol.cz"
-# mxof("idnes.cz") => "smtp1.mafra.cz smtp2.mafra.cz relay.iol.cz"
-# mxof("gnu.org") => "mx10.gnu.org mx20.gnu.org"
-# mxof("org.pl") => ""
-#
-# Returns: single space-separated string consisting of MX servers for given
-# domain. Servers are sorted according to their name and priority
-# (in this order). If a domain has no MX servers, empty string
-# is returned.
-# Remark: due to current limitations in mailfromd, the variable "db" below
-# has to be set to point to the same "dns" format database file,
-# that has bee configured using '#pragma database dns file' option.
-
-#require dns
-
-#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_name("dns"), "MX " %domain, "", 1) matches '^[0-9]+ (.*)'
- set mxservers "\1"
- fi
- return %mxservers
-done
-
-# number has_same_mx(string DOMAIN1, string DOMAIN2)
-# Returns true, if domains DOMAIN1 and DOMAIN2 share exactly the same
-# MX servers. Otherwise, false is returned.
-# Examples:
-#
-# prerequisities used in examples:
-# (the same as in case of 'mxof()' function above)
-#
-# has_same_mx("mafra.cz", "idnes.cz") => 1
-# has_same_mx("gnu.org", "idnes.cz") => 0
-# has_same_mx("gnu.org", "org.pl") => 0
-#
-func has_same_mx(string domain1, string domain2) returns n
-do
- return (mxof $1 = mxof $2)
-done
-
-#pragma regex pop

Return to:

Send suggestions and report system problems to the System administrator.