Results 1 to 10 of 10

Thread: Help with hosting my own email, "from scratch"?

  1. #1
    Join Date
    Jun 2013
    Beans
    3

    Help with hosting my own email, "from scratch"?

    Hello! I was wondering if someone could telll me or point me to a guide to hosting email at my domain. I have found many posts about how to do it with Google Apps, but that's not what I want. I would like to have it set up to where I completely control it and do not have to buy email services from anyone. What kinds of things would I need to know, and how would I set it up.

  2. #2
    Join Date
    Dec 2007
    Beans
    416

    Re: Help with hosting my own email, "from scratch"?

    You will need:
    1. mail delivery agent (MDA)
    2. mail transfer agent (MTA)
    3. mail user agent (MUA)

    Dovecot is a popular program that includes MDA functionality
    https://help.ubuntu.com/community/Dovecot

    Postfix is a popular MTA
    https://help.ubuntu.com/community/Postfix

    MUAs can be a web-based login, or a program such as Evolution, Thunderbird, Outlook. For a web-based login, you could look at squirrelmail or roundcube
    https://help.ubuntu.com/community/Squirrelmail
    https://help.ubuntu.com/community/Roundcube

  3. #3
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,619
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Help with hosting my own email, "from scratch"?

    Other important things you would need:

    A service with a publicly-visible Internet address that can accept incoming traffic on port 25 and send out such traffic as well. Usually a server on a residential connection will not be able to exchange mail reliably because of restrictions imposed by ISPs. I use a Linode VM as my mail server.

    You'll also need to create an MX record for your domain that points to your server. While it's still considered good practice to have a backup MX server, it's less common these days.

    Then you have the issue of spam and virus filtering. For this I use MailScanner. In fact my preferred mail server configuration runs CentOS 6.x and the complete suite of scanners at MailScanner. Justin offers a prepackaged version on the site that installs all three of MailScanner, spamassassin and ClamAV automatically. Since it's designed to run on RedHat-flavored machines, I use CentOS as the operating system, not Ubuntu. I continue to use sendmail as my MTA, but Postfix is supported as well.

    Next, how many mailboxes will there be? If we're a talking a couple dozen accounts at most, it's easiest to create each account as a Linux user and let the mail be delivered to /var/spool/mail/username. Elaborate methods that use Maildir formats and MySQL account databases are overkill for a simple mail server.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  4. #4
    Join Date
    Feb 2008
    Location
    Planet earth, for now.
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: Help with hosting my own email, "from scratch"?

    Thread reopened.
    Last edited by Bucky Ball; July 2nd, 2013 at 09:10 PM.

  5. #5
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help with hosting my own email, "from scratch"?

    Quote Originally Posted by SeijiSensei View Post
    A service with a publicly-visible Internet address that can accept incoming traffic on port 25 and send out such traffic as well. Usually a server on a residential connection will not be able to exchange mail reliably because of restrictions imposed by ISPs. I use a Linode VM as my mail server.
    I do the same except at another VPS provider. I don't have port 25 open, though as I use port 587 for SMTP, is that a problem ? postfix is listening on both, but I believe I firewalled port 25.

    @OP: Read this:
    https://help.ubuntu.com/community/Po...xClamSmtpHowto
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  6. #6
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,619
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Help with hosting my own email, "from scratch"?

    How do you accept incoming mail? My understanding is that 587 is the "mail submission" port, designed for client software to submit outbound mail to a server using the SMTP protocol. But communication between mail servers occurs over the traditional SMTP port, 25.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #7
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help with hosting my own email, "from scratch"?

    Quote Originally Posted by SeijiSensei View Post
    How do you accept incoming mail? My understanding is that 587 is the "mail submission" port, designed for client software to submit outbound mail to a server using the SMTP protocol. But communication between mail servers occurs over the traditional SMTP port, 25.
    I'm not sure. I've tested it with Gmail and it worked fine via port 587, but I think that is how gmail has their stuff configured.

    I just opened port 25 up again and Outlook.com works and so does Yahoo.

    Methinks I'll be leaving it open. Thanks!
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  8. #8
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,619
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Help with hosting my own email, "from scratch"?

    You're not talking about using the clients at a place like Yahoo to manage a mailbox on your server, right? You are talking about sending a message from Yahoo with an @yahoo.com From address to an address in a domain for which your server is the MX, yes?

    With sendmail, you get log messages that look like this:
    Code:
    Jul  3 13:17:24 xxxxx sendmail[29689]: r63HHLk7029689: from=<someone@yahoo.com>, size=267838, class=0, nrcpts=1, msgid=1372871757.78624.YahooMailNeo@web142602.mail.bf1.yahoo.com>, proto=ESMTP, daemon=MTA, relay=[10.1.1.12]
    The message originated on web142602...yahoo.com and arrived on a server I manage using ESMTP over port 25.

    Any server advertised as the MX for a domain needs to accept mail on port 25.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  9. #9
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    8,619
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Help with hosting my own email, "from scratch"?

    You're not talking about using the clients at a place like Yahoo to manage a mailbox on your server, right? You are talking about sending a message from Yahoo with an @yahoo.com address to an address in a domain for which your server is the MX, yes?

    With sendmail, you get log messages that look like this:
    Code:
    Jul  3 13:17:24 xxxxx sendmail[29689]: r63HHLk7029689: from=<someone@yahoo.com>, size=267838, class=0, nrcpts=1, msgid=1372871757.78624.YahooMailNeo@web142602.mail.bf1.yahoo.com>, proto=ESMTP, daemon=MTA, relay=[10.1.1.12]
    The message originated on web142602...yahoo.com and arrived on a server I manage using ESMTP over port 25.

    Any server advertised as the MX for a domain needs to accept mail on port 25. That's one of the things that makes it so hard to manage a mail server. Grandmas in Palm Beach have compromised computers that pump out spam every day. Sure the disk drive is flashing like crazy, but that's not something they'd notice. If the machine is connected at night, the bot can schedule itself to run then so no one notices.
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  10. #10
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help with hosting my own email, "from scratch"?

    Quote Originally Posted by SeijiSensei View Post
    You're not talking about using the clients at a place like Yahoo to manage a mailbox on your server, right? You are talking about sending a message from Yahoo with an @yahoo.com address to an address in a domain for which your server is the MX, yes?
    Nah, I logged into a yahoo account and sent a test email. So far it seems to work. That must explain my lack of spam too.

    With sendmail, you get log messages that look like this:
    Code:
    Jul  3 13:17:24 xxxxx sendmail[29689]: r63HHLk7029689: from=<someone@yahoo.com>, size=267838, class=0, nrcpts=1, msgid=1372871757.78624.YahooMailNeo@web142602.mail.bf1.yahoo.com>, proto=ESMTP, daemon=MTA, relay=[10.1.1.12]
    The message originated on web142602...yahoo.com and arrived on a server I manage using ESMTP over port 25.
    The logs I'm seeing look different, but similar:
    Code:
    Anonymous TLS connection established from co9ehsobe002.messaging.microsoft.com[207.46.163.25]: TLSv1 with cipher AES128-SHA
    I'm running postfix, though.
    .
    EDIT: Rejection entry looks like this:

    Code:
    postfix/smtpd[10226]: NOQUEUE: reject: RCPT from p12.sdc.mail.turner.com[157.166.252.165]: 550 5.1.1 <user@somerandomdomain.COM>: Recipient address rejected: User unknown; from=<owner-ADULTSWIM-COMEDY*user**somerandomdomain*-COM@EMA3LSV04.TURNER.COM> to=<jpond@somerandomain.com> proto=ESMTP helo=<p12.sdc.mail.turner.com>
    Any server advertised as the MX for a domain needs to accept mail on port 25. That's one of the things that makes it so hard to manage a mail server. Grandmas in Palm Beach have compromised computers that pump out spam every day. Sure the disk drive is flashing like crazy, but that's not something they'd notice. If the machine is connected at night, the bot can schedule itself to run then so no one notices.
    That's good to know, thanks.
    Last edited by CharlesA; July 3rd, 2013 at 10:40 PM. Reason: added error snippet
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •