# mail server? if blocked port 25 possible?

## GoofyHMG

Is it possible to run a mail server on my domain if my ISP blocked port 25  by just using a diferent port? 

Here is what I want to do Im not that new to linux but I dont pretend to know it all. I want to set up squirrel mail to be able to access my mail sent to my domain.  I have a static IP and a registered domain. I already have apache2 php mysql squirrelmail with ssl installed but I just get my isp mail using fetchmail.  I would love to be able to read mail sent to me@mydomain.com.

Any and all  suggestions will be appreciated. I have read very briefly about dovecot qmail but i cant figure it all out there are way too many variables at play. I am drawing a blanc on how the setup could be, and what to install, and how they all communicate with each other. Sorry If I asked this on the wrong forum. If I did, dont hesitate to redirect me to the correct one. I know there is lots of documentation but I want to understand the concept before I go and just type up what I see... Thanks a million...

----------

## adaptr

Several of the dynamic DNS services offer this, dyndns for one.

You can create a free account, and have your registered domain be forwarded to the dyndns domain, which will then translate the SMTP port to one you set up.

----------

## DaveArb

You have a static IP but a blocked port 25, that's a little unusual in my experience. IF your ISP's terms of service do not explicitly forbid you to run a mailserver, you might want to contact them and ask that port 25 be unblocked. They might be willing to do that if asked, and are just blocking to help out the unaware zombiebot operators.

If your ISP's TOS does forbid running a mailserver, you are looking to get service disconnected by running one.

Dave

----------

## GoofyHMG

I use bellsouth as my ISP but I dont know where they get there tech support from. They dont know what port 25 is. They have horrible tech support reading a script they dont understand. When I call they think I am having problems getting my regular bellsouth email whenever I talk to any of them and I have called a bunch of times getting random different support people. I guess I  will have to look through the terms and see if thats the case. 

Either way can anyone still help me understand the concept of how it all goes together like what do I need to run a mail server...

Thanks for the help!

----------

## DaveArb

You need to escalate to talk to someone with $CLUE. Polite but firm generally works for me, but I don't deal with BellSouth. You definitely want to review the TOS before doing this.  :Wink: 

Unless you use a forwarder like adaptr mentioned, you have trouble. You see, if my mailserver wants to send you mail, the _only_ port it is going to attempt to connect on is SMTP, port 25. And that goes for, so far as I know, every other mailserver on the 'net.

Dave

----------

## GoofyHMG

Dave I guess I will just keep trying until I get someone who understands. I was also reading that I could probaly use bellsouths smtp server to send mail  and receive mail from my domain. how would that work?

----------

## HomerSimpson

 *GoofyHMG wrote:*   

> Is it possible to run a mail server on my domain if my ISP blocked port 25  by just using a diferent port? 
> 
> Here is what I want to do Im not that new to linux but I dont pretend to know it all. I want to set up squirrel mail to be able to access my mail sent to my domain.  I have a static IP and a registered domain. I already have apache2 php mysql squirrelmail with ssl installed but I just get my isp mail using fetchmail.  I would love to be able to read mail sent to me@mydomain.com.
> 
> Any and all  suggestions will be appreciated. I have read very briefly about dovecot qmail but i cant figure it all out there are way too many variables at play. I am drawing a blanc on how the setup could be, and what to install, and how they all communicate with each other. Sorry If I asked this on the wrong forum. If I did, dont hesitate to redirect me to the correct one. I know there is lots of documentation but I want to understand the concept before I go and just type up what I see... Thanks a million...

 I am quite tired at the moment so if I am misunderstanding you I apologize.

I have a dynamic IP (although it changes only about 1/yr) and run postfix. Port 25 is forwarded to my computer running postfix. I own a domain and use the registering companies DNS service to have an mx record pointing to my house. I have a lower priority mx record that uses a free dyndns address just in case my ip changes. My local clients on my lan all point to the postfix server for sending mail. Postfix has a feature that allows it to talk to my isp as if it were a client. Earthlink will not allow me to do this as MTA to MTA. I also run courier as my imap server.

With this setup I have my own email server in my house and receive emails at me@mydomain.com. I also use squirrelmail so I can read my email while I am on the road.

The trick was to have postfix use earthlink (my isp) as the MTA. I couldn't send to Earthlink addresses otherwise. The local clients think that postfix is the MTA.

----------

## DaveArb

It looks to me like HomerSimpson has the answer you're looking for. I don't have any experience with dynamic DNS services or smarthosting, unfortunately (or maybe fortunately, for me  :Wink: .)

Dave

----------

## GoofyHMG

That sounds like what I want to do!

So All I need is to install and configure 

Postfix

Courier

squirrelmail 

So when someone sends me a message. it gets to wherever I registered my domain...

from there It redirects it to my ip and my postfix picks it up... please correct me on this im just on a hunch trying to put the puzzle pices together. now once postfix has my mail I sould be able to retrieve it via squirrelmail or outlook on another pc assuming I have courier running...??? In order to send mail I configure postfix to use bellsouth as the mail server or smtp . 

So to sum it all up I believe postfix does all the sending and receiving. 

Courier is just my gateway to be able to imap from outlook or some other external program such as outlook, netscape, thunderbird... not necessarily on another machine... 

and squirrelmail simply uses postfix to retrieve the mail or maybe postfix dumps it in the maildir and squirrelmail picks it up from there?

If you can draw mw a better picture please do

----------

## rex123

At risk of repeating what's already been said...

To receive mail, you need the following:

An MX record, pointing to your IP address. This is best done using dynamic dns.

A mail server, listening on port 25 at that IP address. Postfix will work. I would use exim.

To fetch the received mail to a different computer, you need the following:

An IMAP server or a POP3 server. You are going for Courier IMAP, which will work

Optionally a Webmail client (squirrelmail), which uses IMAP to fetch mail then sends it out via HTTP.

To send mail, you need the following:

A smarthost that will allow you to relay.

When someone sends an e-mail to you@yourdomain.com, an MTA will look up the MX for yourdomain.com, then connect to port 25 on the IP address that is returned, and send the mail.

When you send e-mail from within your LAN, you can optionally use your own MTA as the SMTP server, in which case you will need to configure it to use the official bellsouth smarthost. If you don't do this, your MTA will try to send direct to Internet MX hosts, and the port 25 traffic will be blocked. Note that you can bypass this step by not using your Postfix installation for outgoing mail - simply set up your MUA to use the bellsouth SMTP server directly.

----------

## DaveArb

 *rex123 wrote:*   

> When someone sends an e-mail to you@yourdomain.com, an MTA will look up the MX for yourdomain.com, then connect to port 25 on the IP address that is returned, and send the mail.

 

That ain't gonna work, Earthlink blocks port 25. Ask me about that one, I have one of our employees sitting on an Earthlink line in Atlanta who very legitimately wants to use our mailserver (she works for us after all). I have to set up MSA port 587 so she can do this.

Dave

----------

## HomerSimpson

GoofyHMG, you are close. postfix is what puts the mail in the maildir/mbox format. Courier reads those emails and allows the clients to connect via imap to read the email. Squirrelmail will also connect to the courier imap server (postfix does not. It only send mail). I have no comments on exim vs postfix. I use postfix and never tried exim. Whatever floats your boat. Perhaps exim is better?

DaveArb, it does work. Postfix can't send to an earthlink server as an MTA to MTA but postfix has a setting called "relayhost". In my case, it is set to mail.earthlink.net. To earthlink, postifx looks like a client connection would.

rex123, The advantage, to me, for setting up my local postfix server as my smtp server is that it will deliver my local mail directly. Otherwise the mail goes out externally only to make its way back to your server. Probably not a big deal but it is easily remedied with the relayhost variable.

Good luck!

----------

## DaveArb

 *HomerSimpson wrote:*   

> DaveArb, it does work. Postfix can't send to an earthlink server as an MTA to MTA but postfix has a setting called "relayhost". In my case, it is set to mail.earthlink.net. To earthlink, postifx looks like a client connection would.

 

Yeah, in sendmail it's called a smarthost. Maybe I misunderstood what Rex123 wrote, because to me what he wrote (and I quoted in bold) is a direct connect to a mailserver, not a smarthost. Do you mean that Earthlink's MTA will accept and relay mail for a non-earthlink.com domain for which you've pointed an MX to?

Dave

----------

## GoofyHMG

hey thanks for the help that cleared up a couple of things. I wont be able to try this out till the weekend due to a big project at work taking up my time but I will get back should I have more questions. Once again thanks for the help!!! Realluy appreciate it...  :Very Happy: 

----------

## rex123

A clarification (hopefully):

Earthlink blocks port 25 *outbound*, except to the smarthost/relayhost/whatever you want to call it.

I doubt they block port 25 *inbound*. To run a mailserver, you need to be able to accept incoming connections on port 25. If your ISP is blocking that, then you're doomed. Look back at what I wrote, and it should make sense... mail to you@yourdomain.com is sent to you, not from you.

On another subject, my preference for exim over Postfix is pure prejudice. I've never used postfix, but I'm pretty good at exim.

And on another subject, I agree with HomerSimpson that it's nice to have your own server for outgoing mail (configured to use the smarthost as required). I just thought it was worth pointing out that it isn't actually a requirement.

----------

## DaveArb

 *rex123 wrote:*   

> I doubt they block port 25 *inbound*.

 

My apologies for the misunderstanding. It would be interesting to know if they do block inbound port 25 or not.

Dave

----------

## adaptr

Set up a mail server at home that listens to your Internet connection.

The default Exim install will do fine.

Then, get Internet access on a different computer (not one at your home) and type the following:

```
telnet your.ip.addr.ess 25
```

If it responds then it is not blocked.

I am amazed, by the way, by the variety of responses in this thread - and, as a corollary, by the many misunderstandings that seem to exist about how mail systems work.

----------

## HomerSimpson

I only speak for myself...

I am not an expert. I am simply a person who has done what I believe this guy is trying to do and I'm trying to help him out. I have many posts but the vast majority are questions not answers. I was happy that I might finally be able to help someone out. 

If I am incorrect in my understanding of how a mail system works, please post how a mail system really works. I like to learn. That is why I have a mail server in my house.

GoofyHMG, post back once you get this working to let us know how it turned out.

----------

## rex123

 *HomerSimpson wrote:*   

> [...] If I am incorrect in my understanding of how a mail system works, please post how a mail system really works. I like to learn. [...]

 

Part of the problem is that mail systems are actually rather complicated. But, if it helps, your understanding of a mail system seems to more or less match mine, and I reckon I understand mail systems fairly well.

The most common misunderstandings seem to come in these areas:

- The differences between SMTP, POP, and IMAP (people often seem to muddle them up, like MS Windows and MS Office)

- The relationship between e-mail headers and SMTP conversations (people often assume that mail headers actually have a part to play in the way e-mail is transmitted. This assumption is only sometimes right, and is always contingent)

----------

## WetSpot

I realize this thread aged nicely since last december when it was born.  But, allow me a chance to jump-in with a suggestion.  

Referring back to GoofyHMG's original query....

I had bellsouth, too.  They do not permit users to run servers. Period.  That is buried in their TOS, obscured under a heading like 'late-payments" or something.  And they block port 25 and 80 (maybe others, too)

HOWEVER, In my case (suburban Atlanta) there are alternatives to Bellsouth DSL.  I've got the same 3.0 DSL at the same price with no port blocking on my residential line.  It's a local company, with real -live local people offering competent tech support.  Limited experience so far, but the one guy I did talk to was able to trade war-stories about iptables and was an admirer of Apache Virtual Hosts.

The best part is when I asked if I could forego the $15 shipping fee for the DSL modem if I stopped by their offices and picked it up myself - they said it would be fine.

AND, I got to tell the script-reading dolt at Bellsouth the reason I was cancelling their service was because they blocked 25 & 80 and prohibited customers from hosting their own servers.  Granted my new company partitions the line from Bellsouth to serve me, so Bellsouth gets a cut anyway.  But, the principle is there.

The moral of this story is you can work-around the blocked ports or switch providers and be free, freee, freeee!

----------

## GoofyHMG

I really havent had a chance to mess around with this stuff. Working with a utility in florida has had me quite busy after hurricane katrina. I would however like to know if anyone has a similar case  down here. I really wouldn't mind switching my dsl provider if that is possible. The same situation would exist where bellsouth would lease the lines to the other company but if I can get those ports opened it would be great!! I more or less got the mail server running using the home networking how to. I still cant send or receive mail correctly though. I just havent had a chance to mess with it. I have tried to send various emails and for some reason I only get them when they go to my bellsouth address.. I m not sure why...

When I have a chance I will try to look into this a little further.. If anyone has any tips please dont hesitate. thanks again!!

Mail still isnt comming in though and I do receive it if I set it up on a windows machine so I know incomming is not blocked.

----------

## WetSpot

There's a grillion DSL service related sites on the web.  www.dslreports.com seems to be a decent starting point for finding alternative providers.  

They've got a search your area feature which can locate providers serving your exchange.

Good luck.

----------

## adaptr

 *GoofyHMG wrote:*   

> Mail still isnt comming in though and I do receive it if I set it up on a windows machine so I know incomming is not blocked.

 

No, you actually don't know that - the way you receive mail from your ISP (or, rather the way you get mail from them) is wholly unrelated to running a mail server open to the outside.

You collect mail with a client, not a server.

And even if they allow you to send mail to their mail server (over SMTP port 25) they may still have blocked you from using port 25 to anywhere else..

----------

## smurfd

Hi!

I have exactly the same problem as above.

I can send mails out, through my isps smtp server (using the "relayhost" variable in main.cf)

But, i cant recieve mails. (I Can telnet to my mailserver from within my network but using my dyndns address, ie im comming from the outside sortof) 

I Have had exim configged wich i used to send and recieve mails, using a dyndns address, worked out fine (using my isp:s smtp server)..

and i can recieve mails localy, from users on my mailserver ... but not from the internet...

there must be some trivial error.. cant figgure it out. 

you want my main.cf ?

----------

## splooge

 *smurfd wrote:*   

> Hi!
> 
> I can send mails out, through my isps smtp server (using the "relayhost" variable in main.cf)
> 
> But, i cant recieve mails. (I Can telnet to my mailserver from within my network but using my dyndns address, ie im comming from the outside sortof) 

 

That's not a valid test -- even though you're using your external ip address, you're still coming from your internal network.

 *Quote:*   

> you want my main.cf ?

 

No.

----------

## smurfd

 :Embarassed:   heh my fault, iptables issue from the start  :Wink: 

sorry to take up your time, but thanks for it  :Smile: 

----------

