Package: onionrouter
Python Onion Routed Mail DeliveriesFree software: GNU General Public License v3Documentation:https://onionrouter.readthedocs.io.What is this ?This python script implements dynamic SRV lookups to be fed to postfix as TCP transport map replies. More information on mail delivery over onion services can be found athttps://github.com/ehloonion/onionmx.An alternative implementation in Go can be found athttps://git.autistici.org/ale/postfix-onion-transportFeaturesInteractive/Client/Daemon/Debug modesConfigurable SRV lookup stringDomain whitelistingLazy rerouting using static mappingsHow to runThere are two ways to install onionrouter, automatically using pip or cloning the repository and manually installing the needed packages on Debian. Currently onionrouter has only been tested on Debian Jessie.Using pip$sudopipinstallonionrouterTest functionality$onionrouter--helpManual installation on Debian JessieClone repository$gitclonehttps://github.com/ehloonion/onionrouter.gitInstall Debian packagesonionrouter has only been tested on Debian Jessie. Install the following packages:$sudoaptinstallpython-dnspythonpython-yamlTest functionality$cdonionrouter$./onionrouter_run--helpConfiguration and other optionsCopy or update the onionrouter.ini file and with your settings (reference file is in onionrouter/configs folder if you cloned the git repo or in /etc/onionrouter/ if you installed the package)Edit the configuration fileUnder theDOMAINsection replace the value of thehostnamekey with your local domain to be whitelisted from lookups. To add multiple local domains, separate them with comma ‘,’Under theRESOLVERsection put in theresolver_ipfield your preferred resolver (default is 127.0.0.1). To use multiple resolvers, separate them with comma ‘,’Under theRESOLVERsection put in theresolver_portfield the port that your resolver listens to (default is 53)onionrouter by default queries the destination domain for a specific SRV record,_onion-mx._tcp.and if it finds a .onion address in the reply it gives it back to postfix to be used by the smtptor service defined in master.cf. If no valid SRV record is found the mail is passed to smtp service. This gives us dynamic SRV lookups that lead to SMTP over onion addresses!To change the SRV record the scripts looks for, edit the config file mentioned above and change under theDNSsection thesrv_recordfield with the SRV record you have setup (default is _onion-mx._tcp.)To change the service that will be used when a .onion address is found, edit the config file mentioned above and change under theREROUTEsection theonion_transportfield with the service you want to be used (default is smtptor)Toblacklist/ignoredomains in case you have a custom routing rule, or a black list of domains, add those domains under theIGNOREDsection in thedomainsfield. For multiple domains, separate them with comma ‘,’.Execution optionsonionrouter by default runs in server mode and acts as a daemon waiting for connections.Daemon mode can be configured with the following options:–port PORTor-p PORTto define port for daemon to listen (default 23000)–host HOSTor-l HOSTto define host for daemon to listen (default 127.0.0.1)Other options are supported as well:–mappings MAPPINGSto define absolute path to static mappings folder (everything inside will be parsed as a yaml file) or yaml file–config CONFIGto define the absolute path to config folder (must contain a onionrouter.ini file inside) or config file–clientor-cto connect to the daemon and interact with. Use the host and port options to define the options for the connection to the daemon–debugor-dto start the daemon in debug mode. In this mode, daemon will also print (besides replying) the queries and answers Use the host and port options to define the options for the daemon–interactiveor-ito run onionrouter in interactive input mode for debugging or testing purposes without daemonHow to runCurrently onionrouter runs in the foreground, so you need to either run it via a systemd unit file or through some other daemonizing method (eg screen/tmux/etc). An example systemd unit is included in thecontribdirectory, modify it to your liking.$./onionrouter_run--config/srv/onionrouter/onionrouter/configs/onionrouter.ini--mappings/srv/onionrouter/onionrouter/configs/map.yml-p23002--debug