From 26e6267b98a508aee9626f3a8f176f3801a19a52 Mon Sep 17 00:00:00 2001 From: Eleanor Dicharry Date: Thu, 19 Feb 2026 11:24:14 -0700 Subject: [PATCH 1/2] Add a simple script to serve the database locally. This script appropriately sets the Content-Type header on responses for clients who interpret that header. --- tools/run_local_server.py | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 tools/run_local_server.py diff --git a/tools/run_local_server.py b/tools/run_local_server.py new file mode 100755 index 0000000..b6061b4 --- /dev/null +++ b/tools/run_local_server.py @@ -0,0 +1,54 @@ +#!/usr/bin/env python3 + +""" +This script serves as a simple test server for the ISPDB. + +NOTE: This should *not* be used as a production server. It lacks any security +considerations and could compromise the hosting system if hosted publicly. This +script is intended for deploying ISPDB for local testing only. + +The benefit of using this script over serving the directory with the built-in +`http.server` module is that this script sets the response `Content-Type` header +appropriately. + +To run this script, execute the following commands: + +``` +$ cd /path/to/autoconfig # assumed to be the location where this repository is checked out. +$ mkdir local_mirror +$ python tools/convert.py -a -d local_mirror ispdb/* # Process the input files to the directory to serve. +$ cd local_mirror +$ python ../tools/run_local_server.py +``` +The local ISPDB instance will be available on `http://localhost:8000/` +""" + +from http.server import BaseHTTPRequestHandler, HTTPServer +import os + +class XMLServerHandler(BaseHTTPRequestHandler): + def do_GET(self): + # Get the requested path and strip the leading '/' + path = self.path[1:] + + if os.path.isfile(path): + # Set the Content-Type header to send with the file. + self.send_response(200) + self.send_header('Content-Type', "application/xml") + self.end_headers() + with open(path, 'rb') as file: + self.wfile.write(file.read()) + else: + self.send_response(404) + self.end_headers() + self.wfile.write(b"File not found") + +def run_server(server_class=HTTPServer, handler_class=XMLServerHandler): + server_address = ('', 8000) + httpd = server_class(server_address, handler_class) + print('Server running on port 8000...') + httpd.serve_forever() + +if __name__ == "__main__": + run_server() + From 37bfe6ed481b6282dcea5031441a8ece802a380f Mon Sep 17 00:00:00 2001 From: Eleanor Dicharry Date: Tue, 20 Jan 2026 15:59:49 -0700 Subject: [PATCH 2/2] Add `graph` incoming server type for Office365. --- ispdb/office365.com.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ispdb/office365.com.xml b/ispdb/office365.com.xml index e37e142..6d1652e 100644 --- a/ispdb/office365.com.xml +++ b/ispdb/office365.com.xml @@ -25,6 +25,22 @@ true + + %EMAILADDRESS + OAuth2 + https://outlook.office365.com/ews/exchange.asmx + + + %EMAILADDRESS + OAuth2 + https://outlook.office365.com/owa/ + + + %EMAILADDRESS% + OAuth2 + https://graph.microsoft.com/v1.0 + + outlook.office365.com 443