Using Sendmail genericstable to map users to different domains

To run multiple domains on one machine, I haven’t found it possible to selectively use domain masquerading to set the correct domain name for email accounts that are part of each domain. However, the genericstable approach allows you to remap email addresses to alternative addresses as emails are sent:

Add these statements to your /etc/mail/sendmail.mc file to enable genericstable:

FEATURE(`genericstable',`hash -o /etc/mail/genericstable.db')dnl

GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl

Create a /etc/mail/generics-domains file that contains a list of the domains that are to be processed when remapping addresses.

For example:

example1.com

example2.com

Create the /etc/mail/genericstable file. For example:

username       username@different-domain.com

Rebuild the genericstable.db file:

makemap hash /etc/mail/genericstable.db < /etc/mail/genericstable

Rebuild your sendmail config using m4 (see other post here).

Restart your sendmail server.

Linux system admin using Webmin

Webmin is a web front-end for administrating a Linux system. It gives incredibly simple web based access to tweak and configure the system through your browser.

Webmin is available from: www.webmin.com

Joe Cooper has a great user guide to using Webmin on his site here

Configuring Apache2.0 to use SSL

I followed this site to get the basics up and running, in particular how to generate self-signed certificates: Raible’s Wiki: ApacheSSL

The actual configuration of my Virtual Hosts in the httpd.conf file was more trial and error. There is plenty of info about not mixing name and ip based Vitual Hosts, but I couldn’t find a good working example. It turns out that this configuration works fine:

<code>
NameVirtualHost x.x.x.x:80

#Use SSL for this Virtual Host
&lt;VirtualHost x.x.x.x:443&gt;
   SSLEngine On
   SSLCertificateFile /path_to/server.crt
    SSLCertificateKeyFile /path_to/server.key
    DocumentRoot /doc_root_for_ssl_protected_files
    ServerName server.name.com
&lt;/VirtualHost&gt;

&lt;VirtualHost x.x.x.x:80&gt;
    DocumentRoot /doc_root_for_files_on_port_80/
    ServerName otherserver.server.com
    DirectoryIndex index.jsp index.html
&lt;/VirtualHost&gt;


&lt;VirtualHost x.x.x.x:80&gt;
    DocumentRoot /doc_root_for_other_files_on_port_80/
    ServerName otherserver2.server.com
    DirectoryIndex index.jsp index.html
&lt;/VirtualHost&gt;

#ssl config
SSLMutex sem
SSLRandomSeed startup builtin
SSLSessionCache none

ErrorLog logs/ssl.log

</code>