Find the answer to your Linux question:
Results 1 to 6 of 6
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2017
    Posts
    3

    Question Best way to read "/var/spool/mail/root" from multiple servers


    Hello, we have a bunch of linux servers, both physical and virtual, different distros, old and new. I'm trying to come up with a solution to read "/var/spool/mail/root" from those servers. I thought about two ways to accomplish this, I will share them with you, I would love to see your insights about them or maybe a different approach.

    1. One of those servers is our mail server, so other servers could just forward that mail to my e-mail address there. It has Postfix and Cyrus.
    What software would other severs require for this to work? It would need to support SASL AUTH and send to port 587 as I don't want to add some exceptions so they can send without auth on port 25.

    2. Read them remotely using a mail program. I use Thunderbird and I read that it supports reading those files but only on local PC, not remotely. Is there some way to set this up, by some pop3/imap software?

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    4,087
    What you're suggesting is the right way to do this - the server that is your central mail host would just become your email server.

    There are plenty of documents on the Internet that walk through setting up your mail server's MTA - just pick the one you want to use, probably Postfix though as that's already installed. Internet documentation for this will describe the process far better than I can do it (and my email server runs Sendmail, so I'm not so familiar with Postfix).

    Just make sure you put this machine's FQDN/IP into the MX record for local machines in your internal DNS, and point all your other server to this machine for their system-level emails. I think this is done by updating the /etc/aliases file, but tbh, it's been a while since I touched this (several years) and once it's done it never needs changing. And make sure the machine is locked down through the firewall so nobody outside can send emails to your internal users (unless you -want- them to, of course).

    Other things you might want to consider...

    You could set up your email machine in a virtual machine running on one of your servers, this might make backups/reinstalls much easier, and it'd mean you can move your mail server to another server easily if you're going to carry out maintenance on the server that hosts it most of the time.

    As email machines are notorious as targets for attacks, you might want to run as few other services on that machine as possible.

    Once its going, and your IMAP4 service is up and running too, you can extend your mail features by standing up a web server (possibly another virtual machine) and run a web mail service like squirrelmail or roundcube on it (or, potentially, both...). Again, lock these down through your firewalls.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Just Joined!
    Join Date
    Sep 2017
    Posts
    3
    As I wrote before, one of those servers is our mail server. We don't use any external mail provider/server/exchange/whatever, it has dedicated ip address, our domain points to it, etc etc., so there is no need to setup a new one as you describe.
    I saw few guides about forwarding to external address but they all assumed that receiving server doesn't use SASL and/or is setup without properly checking origin of receiving mail message. And I don't want to make any exceptions, so if I would go "route number 1" I would need to use a program that would support SASL and authenticate with login&pass before sending. But I couldn't find any guide with that in mind.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    2,185
    Set up mailx and all messages will go to your server.

  6. #5
    Just Joined!
    Join Date
    Sep 2017
    Posts
    3
    Thanks, I will give it a try.

  7. #6
    Linux Guru Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    2,185
    -->
    As you could have guessed you are not the first admin having this problem.
    Once upon time UNIX got networked. One of the first problems administrators faced was getting email from all nodes into a central email server. So Mail was invented. Later it developed into mailx. Many Linux distributions include mailx with distro core, so there is even no need to install it.

Posting Permissions

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