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
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
For this example, you are creating the mailing list firstname.lastname@example.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) :
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 email@example.com
If that is the case, then you need to make the following changes to the template data:
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:
location of alias file
After creating the file and updating sendmail.cf, remember to run newaliases. See the next sections
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
# The aliases after installing majordomo
WARNING: the above "define" example should be all on one line. It
appears as two lines above to keep the page narrow.
The key point here is that you add the alias file which you created in the previous
Now you need to generate your new sendmail.cf file:
# Let's assume the following:
# your list name is mountainbikes
# your domain name is mountainbikes.com
# Then you need to make the following changes:
# original text new text
# yourlist mountainbikes
# yourdomain.com mountainbike.com
chown majordom /usr/local/majordomo/lists/yourdomain.com/digests
chown majordom /usr/local/majordomo/lists/yourdomain.com/digests/yourlist-digest
chmod 750 /usr/local/majordomo/lists/yourdomain.com/digests/yourlist-digest
chown majordom /usr/local/majordomo/lists/yourdomain.com/yourlist.archive
chmod 750 /usr/local/majordomo/lists/yourdomain.com/yourlist.archive
Restart sendmail and check for errors
After all of this work, it's time to restart sendmail so it can take notice
of the new aliases you have created.
# killall -HUP sendmail
Check for any errors by doing this:
# tail /var/log/maillog
If it looks something like this, then you're OK
ns sendmail: restarting /usr/sbin/sendmail on signal
ns sendmail: starting daemon (8.9.3): SMTP+queueing@00:15:00
Creating a new list
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
firstname.lastname@example.org. These steps will put all mailing lists relating to a given domain
in the directory
Remember this point when it comes time to configure majordomo in the
chown majordom:majordom yourdomain.org
chown majordom:majordom mountainbikes
chmod 640 mountainbikes
echo 'config mountainbikes mountainbikes.admin' | mail email@example.com
If you are creating virtual domains or if you are not on the box on which
majordomo resides, then you need to specify the domain in the mail message (i.e. firstname.lastname@example.org).