"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/fuglu/extensions/dnsquery.py" between
fuglu-0.10.8.tar.gz and fuglu-1.0.0.tar.gz

About: FuGlu is a mail scanning daemon for Postfix written in Python. It acts as a glue application between the MTA and spam checkers and antivirus software.

dnsquery.py  (fuglu-0.10.8):dnsquery.py  (fuglu-1.0.0)
skipping to change at line 18 skipping to change at line 18
# http://www.apache.org/licenses/LICENSE-2.0 # http://www.apache.org/licenses/LICENSE-2.0
# #
# Unless required by applicable law or agreed to in writing, software # Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, # distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
# #
# #
# #
STATUS = "not loaded"
import ipaddress
STATUS = "not loaded"
try: try:
from dns import resolver from dns import resolver
HAVE_DNSPYTHON=True HAVE_DNSPYTHON=True
STATUS = "available" STATUS = "available"
except ImportError: except ImportError:
resolver = None resolver = None
HAVE_DNSPYTHON=False HAVE_DNSPYTHON=False
HAVE_PYDNS=False HAVE_PYDNS=False
if not HAVE_DNSPYTHON: if not HAVE_DNSPYTHON:
skipping to change at line 100 skipping to change at line 102
mxrecs.sort() # automatically sorts by priority mxrecs.sort() # automatically sorts by priority
return [x[1] for x in mxrecs] return [x[1] for x in mxrecs]
except Exception: except Exception:
return None return None
return None return None
def revlookup(ip): def revlookup(ip):
a = ip.split('.') ipaddr = ipaddress.ip_address(ip)
a.reverse() revip = ipaddr.reverse_pointer
revip = '.'.join(a)+'.in-addr.arpa'
return lookup(revip, qtype=QTYPE_PTR) return lookup(revip, qtype=QTYPE_PTR)
 End of changes. 3 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)