Koozali.org: home of the SME Server

How to setup SME Email Server for MyCompany.com using a Dynamic IP Address

Offline newtonviet

  • 1
  • +0/-0
I am new to SME but found this very good solution. I have been able to configure most of the functions like printer, files sharing and now want to setup an Email Server for MyCompany.com using a Dynamic IP Address.

Company Profile:

MyCompany.com is small 5-person company experiencing a moderate growth rate. We expect to add 5 more employees in the coming months. The requirements are:
• The ability for each employee to access their own email from their desktops.
• The ability to add new users quickly and inexpensively.
• Virus protection for all users.
• Reduce Spam to employees.
• Access company email via a Web browser from anywhere on the Internet.

Context:
At the time of initial installation, Mycompany.com has 5 employees:

1. Chris: Admin
2. Jennifer, Jakub, Christina and Philip.

Each employee has a computer that is connected to a small local network (LAN). Only a single computer in the office has access to the Internet via a single ADSL connection to the local Internet Service Provider. In addition, all email accounts, as well as the web site for “mycompany.com“ are being hosted by our local Internet Service Provider.
In the near future, mycompany.com is planning to add 5 new employees with plans to add several more users in the future. It has become apparent to everyone that each user needs immediate access to his/her email account, as well as browsing access to the World Wide Web.

Mycompany.com currently has 8 virtual email addresses and 7 POP accounts as follows:
Mycompany.com currently has 8 virtual email addresses and 7 POP accounts as follows:
• chris@mycompany.com
• jennifer@mycompany.com
• jakub@mycompany.com
• sales@mycompany.com (forwards to chris@mycompany.com)
• info@mycompany.com
• support@mycompany.com
• christina@mycompany.com, and;
• philip@mycompany.com

The schematic diagram of our system is:



Requirement:

We need to setup SME Email server with “Remote Account” feature for mycompany.com that allow our email server to remotely connect to our only one POP account located in the ISP server and pull all incoming emails into the appropriate user's local mailbox. The employees at mycompany.com can also send email directly through our Mail Server or using our ISP by SMTP relay.
Reason to have only one POP Mail Account:
Currently, our ISP charges them $30 USD per POP account per year, thus their 7 POP boxes currently cost mycompany.com $210 dollars annually.
Instead of setting up our Mail Server to pull emails from the 7 separate POP accounts costing mycompany.com $210 per year, we set up a single POP account for mycompany.com at our ISP seerver, create a “wildcard” alias for it that will result in anything@mycompany.com being forwarded to the single POP account, and close all of the other POP accounts. Now that “everything@mycompany.com” is being sent to a single POP account, Chris can now use our mail server to connect to the ISP POP account, download all of the messages, and forward them to the appropriate users.
Several weeks later, Chris determines that the email address “accounting@mycompany.com” needs to be added for accounting purposes. Chris adds the account to our mail server, and “accounting@mycompany.com” is live and working immediately without the need to contact our ISP or pay an additional $30 per year.

Please give us advice and detailed instructions with Linux Code or better the configuration files to do this job. Thank you.
« Last Edit: November 17, 2007, 09:09:14 AM by newtonviet »

Offline raem

  • *
  • 3,972
  • +4/-0
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #1 on: November 17, 2007, 09:52:29 AM »
newtonviet

A link to the manual(s) & FAQ & Howtos is at the top of the Forum page. Email setup should be answered there.

Just setup your sme server as a full smtp mail server and host your domain and allow the sme servers mail server to receive all email for your domain, and any users you add in the future.
Try to avoid Fetchmail if you can, just have your mail forwarded from the existing POP account or do away with it entirely.

You will need to use a dynamic DNS service eg dyndns.org, if you use one of their domains it is free, if you need to use your own registered domain then there is a small charge.
When sme server is configured as a Gateway Server it supports dyndns & updates your IP automatically at dyndns as it changes.

sme should do what you want "out of the box" but you do need to read the manuals.
...

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #2 on: February 18, 2008, 09:09:26 AM »
Hi RayMitchell

Why do you say, "avoid fetchmail if you can"? Many of our clients use ADSL, which has dynamic IP's, and even if they use DynDNS to map their IP's to a domain name, the services (power & internet connectivity) in our country isn't the greatest so they're bound to have downtime / disconnections from time to time. I find fetchmail to be very reliable. What "pitfalls" have you come across with Fetchmail?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #3 on: February 18, 2008, 10:55:38 AM »
SoftDux

Search the forums on fetchmail for various answers.

...

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #4 on: February 18, 2008, 03:08:29 PM »
Yes, I've seen all the problems with fetchmail by doing a search, but then again people have problems with EVERYTHING, and one cannot avoid everything cause someone else has a problem with it. I've been using fetchmail since 1999 without any problems, and I know many many people who use it as well. Just cause someone had a problem (normally user or network errors), doesn't mean one has to avoid it?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #5 on: February 19, 2008, 04:28:25 AM »
SoftDux

I'm not referring to network or users errors.
Fetchmail is inherently flawed and as you have read, people have problems with it.
I did say "avoid it if you can", rather than do not ever use it.
Running a smtp mail server is viable in most situations, so if there is a viable alternative that is clearly better and does not have inherent flaws, then it makes sense to use that instead.

All mail servers should "support" power outages (server downtime) of a few hours or more, so I do not see that as being an excuse for not running a smtp mail server. Mail will be queued at other mail servers for delivery later and when your smtp mail server comes back on line, the mail will be accepted on the next delivery retry.
...

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #6 on: February 19, 2008, 04:22:38 PM »
ok, what you're saying make a lot of sense. Due to various factors I was foced to reinstall my own SME (replaced HDD's with bigger ones), so I've also now changed my LAN's domain name, and will give this a shot. I think the DynDNS thing can be a problem, but I suppose one just use the DynDNS name as the primary MX, and then the dedicated server in the DC as the secondary MX?

Let's use my domain as an example, softdux.com (this is a FQDN on the internet), so anyone can email {some_user}@softdux.com, so now I've setup my SME domain as office.softdux.com, and the server itself as intrant.office.softdux.com (thus my own PC will be pc.office.softdux.com & another pc is laptop.office.softdux.com)

Now, I setup my DynDNS domain, let's call it myoffice.dyndns.org, which points to our dynamic IP (which changes daily), right?
Now, I configure the DNS on my dedicated server, (which hosts our domain & email currently) to use myoffice.dyndns.org as the primart MX (say MX=5), and then the dedi itself as secondary (MX=10), is this right?


P.S. There's no real point in trying to "hide" a domain, they exist, and they're supposed to be found for business :)

Offline raem

  • *
  • 3,972
  • +4/-0
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #7 on: February 20, 2008, 07:44:12 AM »
SoftDux

I assume you are using an Internet connection with a dynamic IP and your server is in server gateway mode.
Therefore your main domain on the sme server should be mydomain.dyndns.org and you should configure the dyndns account name and password in the Configure this server screens, so the IP is kept automatically up to date. It does work quite well by the way.

Any additional domains should be configured as (virtual) domains in the Domains panel eg softdux.com.
You should only have (and you only need to have) one mx record, as backup records will allow spammers to circumvent spam filtering.

The sme server will receive email for any domains configured on sme.

For your softdux.com domain (& any others) change external DNS records to point the mx record at mail.mydomain.dyndns.org an dto forward web requests.
You can also use the paid for service at dyndns.com to allow your "real" domains to work with dynamic IP's, and avoid the need to have a mydomain.dyndns.org domain.

There was a very recent post that covered this same subject, so search.

...

Offline SoftDux

  • *****
  • 240
  • +0/-0
    • http://www.SoftDux.com
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #8 on: February 20, 2008, 01:06:28 PM »
Thanx for the info.

I have an ADSL modem which establish the ADSL connection and manage the DynDNS stuff, and SME is in server-gateway mode.

Currently, my SME / LAN domain (as above), is intranet.softdux.com, and when I send an email, it sends it as admin@mydomain.softdux.com, which doesn't work since that domain isn't actually a FQDN on the internet itself.

What I want to accomplish is this:

user1@softdux.com emails user2@softdux.com - this mail will be handled by SME itself
user1@softdux.com then emails someuser@otherdomain.com - this get's handled by my softdux.com internet mailserver, which then delivers it to the relevant mailserver for that domain, for example otherdomain.com


So, I'm thinking of changing my SME domain to softdux.com, but this gives me new problems, cause then www.softdux.com points to the SME server itself, and not my actual website. And ll the PC's on my LAN will be pc1.softdux.com - which I don't need / want?

Using DynDNS for my internal LAN doesn't seem to work well either, cause then emails will orginate from user1@mydomain.dyndns.org - which doesn't lok that professional. I know about their paid service, but if I can do this without running that extra costs, it would be great.

So, how do I make it so that mail will orginate from user1@softdux.com instead of user1@intranet.softdux.com?

Offline raem

  • *
  • 3,972
  • +4/-0
Re: How to setup SME Email Server for MyCompany.com using a Dynamic IP Address
« Reply #9 on: February 21, 2008, 05:48:13 AM »
SoftDux

Quote
I have an ADSL modem which establish the ADSL connection and manage the DynDNS stuff, and SME is in server-gateway mode.

For a start that's wrong, your server should be in server only mode when it is behind a modem which appears to also provide other services eg login client. I suspect that it is really a modem/ router.
You will need to forward ports from the router to sme.

You would be better off disabling all services in the modem/router and configuring it for bridged mode, which just forwards all traffic straight through.
Then configure sme as server gateway, setup your dyndns account details in sme and allow sme to be the login client, DHCP server, etc.

Configure sme with the dyndns domain.
Add all other domains to the Domains panel.
If you have an external website hosted, then you need to configure that in the Hostnames and addresses panel ie point the www content for that domain to the external address.

Configure the return email address domain in your email clients.

Please read the manuals again as you seem to be misunderstanding a lot of basic stuff.
...