🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #285045

Re: Adding AnonUsa

#285045
From: Nathan Hale
Date: Sat, 01 Oct 2016 03:02
50 lines
3856 bytes
<snip>
> 
> I made some more changes to my Postfix configuration, and so, things are now no longer routing exclusively through Zax's relay.  Also, finally, got Tor to work for some hidden SMTPs.  It's been a learning curve.

  Here are some instructions from DigitalOcean on how to use a VPS to get around a blocked port 25:

Note: DigitalOcean calls their VPSs 'Droplets'

For this example I'll be using a DigitalOcean assigned IP address 123.45.67.89 as an example, please note that it should be replaced with the Droplet IP in all cases. I'll also use 10.9.8.7 as an example IP for the basement server, please note that should also be replaced in all cases.

    1) On the user's basement server, configure postfix to relay all email through the DigitalOcean server you'll be using. This is done in /etc/postfix/main.cf and with the following parameter:

    relayhost = 123.45.67.89

    You can also use a DNS (domain.com for example) address with this feature, but please note that you must enclose it in square brackets to avoid an MX lookup, which you don't want in this case:

    relayhost = [domain.com]

    2) Set Postfix to use port 2525 (or whatever you'd like). This is done in /etc/services, all you need to do is change the line that says:

    smtp 25/tcp mail

    To:

    smtp 2525/tcp mail

    3) Restart Postfix on the basement server.

    4) On the DigitalOcean VPS Droplet, you'll want to configure Postfix to accept relayed mail from the basement server specifically. This is also done in /etc/postfix/main.cf:

    mynetworks_style = subnet
    mynetworks = 127.0.0.0/8 10.9.8.7/32

    The above will allow relay from both the Droplet's local connections and the basement server. If the basement server doesn't have a static IP, you'll need to set it to accept from the range of IPs available to it via DHCP.  (something like 10.9.8.0/24)

    5) Restart Postfix on the DigitalOcean VPS Droplet.

    6) Now you need to convert all port 2525 connections coming to your DigitalOcean VPS Droplet back to port 25 so the Postfix service on the Droplet will receive them. This is done with an Iptables rule:

    iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 2525 -j REDIRECT --to-port 25

    If you'd like, you can specify that this rule should only apply to traffic from the basement server, but as Postfix is already only configured to accept traffic from the basement server and local mail in mynetworks, you don't really need to.


    Once all that is done, you should be able to send email from the basement server over port 2525 to the Droplet which will then relay it over port 25. All of this but the firewall rules are covered in the Postfix configuration guide here:
    <a href="http://www.postfix.org/BASIC_CONFIGURATION_README.html" target="_self">http://www.postfix.org/BASIC_CONFIGURATION_README.html</a>

Note: Every time you reboot your server, the Iptables rule will be lost and need to be entered again.  To prevent this constant reentry, install iptables-persistent and the entry will be entered into iptables automatically at boot:
apt-get update
apt-get install iptables-persistent
Technical Details
Message-ID: <1a2128d26d9d83c253c68a4992e0e0ad@remailer.org.uk>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
References: <8104ad75-9c73-4376-8b95-e66c832f6ae7@googlegroups.com>

Show Full Headers
Complete Article Headers
Message-ID: <1a2128d26d9d83c253c68a4992e0e0ad@remailer.org.uk>
Subject: Re: Adding AnonUsa
Date: Sat, 01 Oct 2016 03:02:40 +0000
From: Nathan Hale <nobody@remailer.org.uk>
References: <8104ad75-9c73-4376-8b95-e66c832f6ae7@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
Newsgroups: alt.privacy.anon-server
Organization: dizum.com - The Internet Problem Provider
X-Abuse: abuse@dizum.com
Injection-Info: sewer.dizum.com - 194.109.206.211
Lines: 50