Sendmail configured to forward mail to one server

Well in an earlier post I mentioned on my todo list was to setup all my Linux servers to forward emails from all servers onto one ‘collection’ server so I just had to read the emails in one place instead of logon to each server.

As expected it wasn’t that straight forward, but the majority of the goals outlines in that post have now been achieved. I have managed to

  • change all the mailboxes sendmail selivers mail to from MBox format to Maildir format, simply by creating a default postfix configuration file
  • configured sendmail to allow mail to be sent from any server to that one ‘collection’ server, and even to get it to bounce it back on errors, minor fiddling in sendmail.cf and a lot of fiddling in the /etc/hosts files
  • all email automatically forwarded to that one server, through simply changing the mail aliases file so all emails get forwarded
  • installed Dovecot so I can retrieve the emails using POP3 and read/store those emails using Thunderbird on my desktop machine instead of needing to login to the server
  • and setup a deafult .muttrc file so when I do actually login to the server at the command line I can read the Maildir format emails with mutt

While the changes to set all that up were fairly trivial, it did take me quite a while to figure out how to do that, so I have added a reference on how I implemented it in the site Tutorial section in case it’s of use to anyone else. The tutorial is Fedora specific in that my environment was a mixture of FC8 and FC10 servers, in other distributions the configuration files may be in different places and the method of installing software may be different.

The only thing on my todo list I haven’t yet done is setup getmail to pull emails from all my ISP managed POP3 accounts down to that ‘collection’ server automatically. I’m having second thoughts about that as I don’t allow email to be sent from my internal network (from the Linux servers anyway) to the internet so won’t be able to ‘reply to’ emails if I pull them down that way (and yes I do want to delete them from the ISP server if I pull them down). So pherhaps I’ll just set it up for eveything except my main ISP email account (yes if I pull it down to Thunderbird it can send through the ISP account, but the mail headers will have changed as I’m retrieving it from a different userid/email on the ‘collection’ server now, so most spam filters will throw the reply away as coming from a different address). When I’ve decided, or done it, I’ll update the tutorial to include it.

And I’ll add something else to the todo list. SquirrelMail looks interesting, a web browser front end to an IMAP mail server… I might have a play with that as well, or might not simply because as I’ll never allow sendmail on the internal network to send emails to the external network (spam relay, not me) it’s of limited use to me, but it looks interesting. Obviously thats why I chose Dovecot as the IMAP/POP3 server, thinking ahead to that as SquirrlelMail chats to that quite happily. I didn’t really need an IMAP server as I’m normally on the command line so use mutt. But SquirrelMail looks interesting and of course I won’t know that I don’t need it until I have it (just like shopping at sales, get it now and worry about what to use it for later).

But thats for later on as well. I’ve thought of a tweak I want to make to one of my MVS3.8J programs so that top of my “I’ve been sidetracked again” list at the moment.

About mark

At work, been working on Tandems for around 30yrs (programming + sysadmin), plus AIX and Solaris sysadmin also thrown in during the last 20yrs; also about 5yrs on MVS (mainly operations and automation but also smp/e work). At home I have been using linux for decades. Programming background is commercially in TAL/COBOL/SCOBOL/C(Tandem); 370 assembler(MVS); C, perl and shell scripting in *nix; and Microsoft Macro Assembler(windows).
This entry was posted in Unix. Bookmark the permalink.