1. Home
  2. Computing & Technology
  3. Focus on Linux

Linux on the Road

From Authors, for About.com

15.3.1. Introduction

A short introduction about how to setup email on a laptop used at home (dial-up) and work (ethernet) by Peter Englmaier <ppe_AT_pa.uky.edu>:

15.3.1.1. Features

As a laptop user, I have special demands for my email setup. The setup described below, enables me to:

  • Read my email from home using a POP email server, which is supplied by my university, but could also be setup on a work place computer.

  • Write email from home with the right return address in the email (which does not mention my computer name).

  • Read/write my email while working on a workstation without access to my laptop or the POP email server (as a backup).

  • Read my email while working on my laptop connected to the ethernet of our institut.

  • Direct email while connected via ethernet (faster than the fetchmail method).

  • Indirect email (over pop mail server) while not connected to the ethernet at work (either at home via modem or somewhere else via ethernet).

  • Use any emailer, e.g. elm or the simple mail command.

  • Sort incoming email, delete spam, split email-collections (digests) into seperate emails

The configuration is based on sendmail , fetchmail , and a remote pop account for email.

15.3.1.2. Configuration of sendmail

This is the most complicated part. Having installed the sendmail-cf package, I created a file named /usr/lib/sendmail-cf/laptop.mc :


   

divert(-1)
include('../m4/cf.m4')
define('confDEF_USER_ID',''8:12'')
define('confBIND_OPTS','-DNSRCH -DEFNAMES')

# here you define your domain
define('confDOMAIN_NAME',''pa.uky.edu'')
OSTYPE('linux')
undefine('UUCP_RELAY')
undefine('BITNET_RELAY')

# there we send outgoing email
define('SMART_HOST','server1.pa.uky.edu')

# there we send mail to users my laptop does not know
define('LUSER_RELAY','server1.pa.uky.edu')

# again the domain, we want to be seen as
MASQUERADE_AS(pa.uky.edu)
FEATURE(allmasquerade)
FEATURE(nouucp)
FEATURE(nodns)
FEATURE(nocanonify)
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(procmail)
MAILER(smtp)
HACK(check_mail3,'hash -a@JUNK /etc/mail/deny')
HACK(use_ip,'/etc/mail/ip_allow')
HACK(use_names,'/etc/mail/name_allow')
HACK(use_relayto,'/etc/mail/relay_allow')
HACK(check_rcpt4)
HACK(check_relay3)

This looks more complicated as it is. All it does is, that it redirectes outbound mail to server1 (SMART_HOST) and also mail for local users which are not known (LUSER_RELAY). That way, I can write email to my colleques without using their full email address. More important: the From line in my email points back to my MASQUARADE_AS domain and not directly to my laptop. If this where not the case, email returned with the reply button might not reach me. You must restart sendmail for changes to take effect. Note: this configuration is for Redhat 5.2 systems. You may have to change some details.

Now, all what is needed is to generate the /etc/sendmail.cf file m4 laptop.mc >/etc/sendmail.cf and to add all possible domain names my laptop should respond to in /etc/sendmail.cw :


   

# sendmail.cw - include all aliases for your machine here.
laptop
laptop.pa.uky.edu
128.17.18.30
guest1
guest1.somewhere.org

It is important to have all aliases in this file, otherwise sendmail will not accept the mail (and will reply we don't relay to the sender). Finally, you must now test the setup by sending email,

* License

* Linux on the Road Index

Explore Focus on Linux

More from About.com

  1. Home
  2. Computing & Technology
  3. Focus on Linux
  4. Linux Documentation
  5. Linux on the Road
  6. Linux on the Road - E-Mail

©2008 About.com, a part of The New York Times Company.

All rights reserved.