Providing E-mail Services for a Small Office
For incoming mail we use fetchmail to fetch the mail from the ISP. My cron job makes the internet connection and then runs a line like this:
su -c "/usr/bin/fetchmail -a -f /home/thiftycompany" thriftycompany's .fetchmailrc: poll pop3.someisp.com proto pop3 user thriftycompany
Procmail is defined as the local MDA (mail delivery agent) in the sendmail.cf file:
Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qShP, T=DNS/RFC822/X-Unix, A=procmail -a $h -d $uAll the incoming mail goes to the thriftycompany account, where there is a .procmailrc file set up to parse the incoming “To:” lines and forward to the appropriate users, as seen in Listing 4.
You can also use this procmail filter to filter out ILOVEYOU-type viruses, limit or quarantine attachments and other useful things. Check out the procmail docs for more info on this. Each user's mail is held in a folder under thriftycompany, in the event of accidental erasures, etc. I periodically purge these folders by hand.
My boss has not quite bought into the usefulness of the Internet and requests full tracking of its use. Part of my tracking includes logging of all the incoming and outgoing mail messages—quantity and size—per user. This is done through a shell script run by cron every morning, as shown in Listing 5. The output from this job looks like Listing 6.
That about does it. The tricky part is getting outside folks to address the incoming mail properly. For most mail clients, this just requires making a First Name, Last Name and e-mail address entry in the address book, with the person's proper name and our ISP e-mail address. For those people who have regular correspondents who just can't seem to get it right, I add a procmail rule with the “From:” address to make sure the mail gets to its proper destination. The other suggestion I give users is to send an e-mail to the other party and let them add the return address from that to their address book.
There is a certain amount of maintenance to this system on my part, but it's minimal. In writing this article, I've considered ways to automate these portions too; but for now, it's not really much of a burden.
I check thriftycompany's mail daily to check for messages that fell through the procmail filter. Not a big thing, I could forward this mail to myself, and then I'd see it sooner, or I could set up KBiff (KDE mail notification utility) to watch this mailbox.
Also, I like to purge the individual mail folders under thriftycompany's e-mail account. Again, not a big thing. I'm not hurting for space on this server and our volume is small. There's probably a Perl script out there that I could use to prune messages “n” number of days old.
Currently, when I add a new user, I have to add a new entry to the genericstable file, run makemap, restart sendmail and add an entry to the procmail filter for thriftycompany. I've considered making a shell script to accomplish these steps too, but currently I add a user maybe four times a year.
I hope this article has given you some insight into setting up an e-mail solution for a small company, one not quite ready to make the leap into a full DSL or T1 connection with a domain name. If you need to use the Internet and e-mail to communicate with your customers and vendors, this should give you what you need to get the job done.
Stew Benedict is a Systems Administrator for an automotive manufacturer in Cleveland, Ohio. He also is a freelance consultant, running AYS Enterprises, specializing in printed circuit design, database solutions and utilizing Linux as a low-cost alternative to commercial operating systems and software. He has been using and promoting Linux since 1994. When not basking in the glow of a CRT, Stew enjoys time with his wife, daughter and two dogs at his future (not too much longer!) retirement home overlooking Norris Lake in the foothills of the Smokies in Tennessee.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- My +1 Sword of Productivity
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Doing for User Space What We Did for Kernel Space
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide