Providing practical examples since 1998

Things look quiet here. But I've been doing a lot of blogging at
dan.langille.org because I prefer WordPress now.
Not all my posts there are FreeBSD related.
I am in the midst of migrating The FreeBSD Diary over to WordPress
(and you can read about that here).
Once the migration is completed, I'll move the FreeBSD posts into the
new FreeBSD Diary website.

As with everything, I don't figure these things out on my own. I use what
someone else has already written. In this case, I've used the majordomo FAQ which
contains a section on virtual
domains. From there, it refers to Ernest
Mueller's extremely useful article on Configuring Virtual
Domains.

Assumption

I will assume you have already configured sendmail to handle virtual domains.
I used Jim Mock's article on sendmail Virtual
Hosting. I found it very easy, using that article, to add virtual sendmail
domains to my machine. I will also assume you have already installed
majordomo.

For this example, you are creating the mailing list yourlist@yourdomain.org.

A new majordomo configuration file

I created a new config file for the virtual domain yourdomain.org (if you already have
other virtual domains sitting around, you could use that majordomo configuration file as a starting point) :

If you have a digest version of your list, you'll need one of the above sections for
the list and another one for the digest.

After you add these entries, you need to build the virtual user database. To do
so, run the following command:

makemap hash /etc/mail/virtusertable < /etc/mail/virtusertable

A new majordomo alias file

We will now create an alias file which defines both mojordomo for this domain and
the mailing list. This file defines aliases for a digest. A template is
example in a separate file because the lines are very long. Use the template text
available from sample/majordomo.alias.txt.

As you example that template, let's assume the following:

your list name is mountainbikes

your domain name is mountainbikes.com

the list owner is blarf@anotherdomain.com

If that is the case, then you need to make the following changes to the template data:

original text

new text

yourlist

mountainbikes

yourdomain.com

mountainbike.com

yourdomain-com

mountainbike-com

owner@ownerdomain.com

blarf@anotherdomain.com

This file goes in /etc/mail. Name it aliases.majordomo.yourdomain.com.

You will also need to add this file to /etc/mail/sendmail.cf, or, if you are using it,
your sendmail.m4 file (see following sections for details). Here's an example:

After creating the file and updating sendmail.cf, remember to run newaliases. See the next sections
for details.

Tell sendmail about the majordomo aliases

Now that we have created these majordomo aliases, we need to make sure that sendmail
knows about them. We do that by modifying the our .mc file.
Instructions for modifying your .mc file are included in the upgrading sendmail article. In short,
here's what you do:

# cd /usr/ports/mail/sendmail-8.9.3/cf/cf/

.mc files are normally of the form hostname.mc, where hostname is the name of your
machine. If you don't have a .mc file, you are welcome to use samples/hendrix.mc from my
system. You will need to edit this file and ensure the following appears in that
file:

For this example, I'll be using my creation of the New Zealand FreeBSD User Group (nzfug)
mailing list. The address we want to use for subscribing is
majordomo@yourdomain.org. These steps will put all mailing lists relating to a given domain
in the directory
/usr/local/majordomo/lists/yourdomain.org.
Remember this point when it comes time to configure majordomo in the
following sections.