12

Yes, this question has been answered in a variety of ways, none of which, are answered in a way that fit my needs. So, therefore I'm asking mine specific to my situation.

I've tried, probably 5 or 6 different ways for setting up a mail (SMTP) server on my spare computer at home that I've also set to run my website. My ISP blocks several ports like 80 and 25 that allow for hosting web servers, mail servers, ftp servers. etc. Luckily, my domain registrar had a way to forward my traffic to a specific port where then I used some options in my router to do port translation and redirect traffic from one port specified in my account settings on my registrar's site to go to port 80 on my web server computer, which worked just fine, and my website is up.

However, I've come to find out that by default, when setting up an MX record so I can set up a mail server, their system by default sends traffic to port 25. (So rather than the web server pointer that I can specify: 012.345.678.910:8080, the MX record has to be something like mail.mydomain.com or simply mydomain.com. There is no way in their options (currently) to specify a port like you can for the website. So, I guess this is a 2 part question. 1. Did I just happen to choose a crappy domain registrar; or specifically, is this a capability offered by default by a lot of other domain registrar's that I'm just missing out on? and 2. Is there any other way to make this happen? My ISP charges and arm and a leg for Business accounts that unlock port 25, and I'd like to not have to go that route. I understand you can set your SMTP server to listen and send out traffic on a different port, but that does me no good if my domain registrar's MX record is still forwarding to port 25 for incoming mail. Any help or advice on this matter would be greatly appreciated. Thanks.

EDIT:

I left out the obvious possibility that I could be messing up my setup in regard to the fact that I've never successfully set up an SMTP server before so I'm quite new to this. With that sad, could I be confused on how mail servers operate, is there a difference or possibility of an ISP blocking incoming traffic on a port vice outgoing? What I mean is, am I confused in that if I've set up everything properly, should I be able to receive (listen) or port 25 no matter what, and then have to send outgoing mail out on an unblocked smtp port?

I've yet to try sending out mail from my server due to the fact that I don't want to have things set up wrong and then get my IP blacklisted, so I've only tried experimenting with trying to receive email and as I've said, I've tried about 5 or 6 (all very confusing and seemingly incomplete or not very detailed) tutorials on how to set up an SMTP server, and I have yet to get incoming mail either. As a personal note, it seems weird to me that out of the several tutorials I've searched and read, that not one bares nearly any similarity to the next with regard to the first part of installing postfix; from there, it all becomes different. This doesn't help me understand what I could be doing wrong if indeed that is what is happening. Finally just for continuity, I did go to http://port25.icannotconnect.com/ and it did indeed say "BLOCKED".

Thanks again.

10 Answers 10

4

There is a free service at rollernet.us that you can use to redirect your incoming mail to another port, say 26, on your smtp server. This is for low volume service; if you are receiving many or large emails then you will get temporarily suspended. Also (I have not tried this) ghettosmtp.com claims to offer this service. You can Google smtp port redirect to find commercial services for less than $100 per year.

1
  • sadly, true. Note: Rollernet is primarily commercial, and I have no complaint.
    – rleir
    Apr 23, 2017 at 22:42
2

Interesting question. You seem to basically understand how SMTP works as far as MX records, IP addresses, and port 25 (which is the standard port that SMTP servers accept connections on from other SMTP servers).

I think what you are referring to that your domain registrar does with your web site is basically an HTTP redirect. It sounds like you must have the A record for your domain pointing to the IP address of a web server at your registrar, and this web servers does an HTTP (301 or 3012) redirect to your home IP address on port 8080. Unfortunately, there is not a similar type of redirect in the SMTP protocol.

As a workaround that would be considerably less that an extra $50/month, you might want to setup a mail server on a Linux cloud server. Linux cloud servers at Rackspace start at around $16/month, and you would have a static IP without any blocked ports: http://www.rackspace.com/cloud/servers/

1
  • 2
    I accepted your answer on the basis that you did answer that there is no workaround for this. Thank you for answering, regardless of the fact that it wasn't the answer I was hoping for. haha. I might look into hosting later, but for now, as I stated earlier, the reason for hosting on my home computer is for personal experimentation and education.
    – TekGiant
    Aug 25, 2013 at 18:23
2

If you use Exim as your MTA, one approach would be:

  • Set up a shell-less account (i.e. chsh to /bin/false) on any UNIX server running a SSH daemon.
  • Set up an autossh service on your mail server, with a DynamicForward listening on a local port
  • Use socks_proxy in Exim (on the SMTP transport) to cause it to tunnel all outgoing SMTP/submission connections through the SSH tunnel.

The advantage of using this over a smart host (as described in the other answers) is that, assuming the destination mail server has TLS enabled, there is no intermediary through which your mail passes as plain text, and therefore no intermediary has a chance to snoop on or tamper with your mail.

1

I operate a remote linux server running sendmail. Ports 25, 465 and 587 are blocked so there was no way to bypass the block without taking drastic measures. I tried a random port and it worked well except that it had to run in open mail relay mode and many mail servers rejected my email based on this fact.

The solution was to build my own email transport sytem in PERL, which triggers sendmail while operating as a daemon on my linux box. I set my email client to use the same high range port for smtp. Now everything is under my direct control and it has been working perfectly since late 2014.

While, this is not a solution that fits your critera, it may help someone else and l'll just make two more comments.

1) Each VPS I have costs only $20.00 per year so its very affordable; and

2) You'll have better web performance if your site is housed in a data center.

1
  • 1
    How did you do it? Do you have your own email transport sytem uploaded somewhere to download? Mar 5, 2017 at 4:02
1

Probably the best way to do this is setting up a web-hosting. However, as you do not want to do that, there can be another way if any of your friend's ISP allow the port 25. In that case you can setup a socket (or any other) connection to your friend's network. There should be a setup for translation/relay. In that way you should be able to use that port via your friend's network. However, it's a long shot and probably won't be much helpful either.

0

You might be able to get your ISP to give you a Static IP without signing up for a "business account". Who is your ISP? You can get Qwest-Centurylink to give you a Static IP for like, an extra $5 a month on your ordinary residential account, which is bad, but was the best I could do for myself.

Ordinary service agents might try to sell you a "business account" if you say the word "SERVER", which in their minds = a business. So don't say this word, "SERVER", when talking to them, or you'll put their brain into "MUST SELL EXPENSIVE BUSINESS ACCOUNT" mode.

You can only trust a actual network technician if you are lucky enough to get transfered to one, the actual guy who will setup their machine to deliver your unblocked static ip. That guy is the ONLY guy at the telecom company who knows as much as you & me about what is truly needed for you.

You have to be sure to tell an ordinary service agent to make a note "not to block any ports" when they setup your Static IP, or they might. I think that might be a common request for ISPs from people who need Static IP's for their game-voice-chat services, but I'm not sure.

You could use some other DNS service to host your DNS records, not your registrar. Maybe

http://dyn.com/support/how-do-i-delegate-my-domain/

or

http://www.opendns.com/

I think there was at least one other free service whose name I can't recall, good for 2-5 free domain names worth of DNS records serving. You may want to google around to see if any new free DNS hosts exist.

You might try setting up a proxy somewhere outside your LAN, that will do the port translation for you. Or rather, deliver the traffic through the secure tunnel to the proxy, no "port translation" required. Or just host a mail server outside your LAN somewhere, why bother with a proxy? A pineapple from HAK5 could proxy for you, or any Linux device configured properly. Do you control a DNS server outside your home, such as at work or a school?

Programmer's clubs & Linux user groups in your area will be YOUR BEST FRIEND here, after you make a friend or two there. Ask somebody if they'd help you out by hosting your mail server on a box they have somewhere, serving up your DNS records, or putting a proxy on one of their boxes for you.

3
  • Ok, so as a beginning note to my response. I've already set up my Gmail account to be able to send and receive mail from my domain in the mean time, so using another a mail hosting service is pointless, and serves no purpose for my goal, which is mainly educational. I want to be able to successfully set up a completely working mail server on my own home computer, and have a functional web interface like roundcube or squirrelmail working. If hosting on someone else's box was an option, I wouldn't have bothered hosting my website on my own computer in the first place.
    – TekGiant
    Aug 9, 2013 at 3:05
  • Additionally, I did talk to a Tier 2 network tech from my ISP. Static IP's and the unblocking of ports is not allowed on any Residential account. Business accounts are about $50 more a month than an already $70/month Residential account.
    – TekGiant
    Aug 9, 2013 at 3:07
  • What city do you live in? I'd look really hard to try to switch ISP's if I was in your shoes.
    – Ace Frahm
    Aug 18, 2013 at 17:20
0

You can use Dynu's email store and forward service. They will receive emails for your domain name and forward them to your email server on an alternate port(say port 26). This way you can host and manage your own email server at home and it solves the problem of your ISP blocking inbound SMTP 25.

For the service to work, you need to set their MX records as primary and yours secondary and specify your email server name and port. Hope this can be helpful.

-3

requirements :

  1. 1 friend that their isp doesn't block port 25.
  2. 1 Mikrotik set up openvpn server to give the client a static private ip and port forward tcp 25,80 to that ip, and put it at your friends house this will have to be their Router., use a dynamic dns updater of somekind if they have a dynamic ip. Their are scripts to put on the mikrotik.
  3. download and configure openvpn for your server. openvpn is supported on all Operating Systems.

The only problem with this is the fact that all of your servers Internet traffic will be tunneled to your friend's house

-3

A note about email from your own server through a home ISP connection.

-ISP blocks common ports needed to send/get email, dns and port translation can get around this

-Most email servers quarantine or block email from residential ISP network ranges, so even if you did send through your ISP it would end up in someones spam quarantine.

-Preventing abuse, virus, and attempting spam control can consume hours each week.

It is so impractical. Business ISP connections cost more and allow this.

-4

Do you have any unsecured WIFI connections in your area ;) Otherwise, use your ISP's SMTP server settings and put this to rest. Only other simple option I can think of is to put an offsite contact page (free hosting site) into an iframe.

Not the answer you're looking for? Browse other questions tagged or ask your own question.