LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 12-30-2004, 07:05 AM   #1
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Rep: Reputation: 30
Qmail handling multiple domains?


Hi Everyone!!

I need to set up two mailservers over the next couple of months. Due to the fact that I'll be using Qmail I intend on using the infamous lifewithqmail guide to help me get through this.

A quick question before I begin is:

One of my mailservers will be my home mailserver. I'll soon be purchasing a domain and so will my brother. My brother runs a business (for which his domain name will be). What I would like to know is whether or not there is a way I can configure Qmail to handle both of these domains? Thus, serving as a mailserver for user@mydomain.com AND user@brosdomain.com

Is this possible? What would I need to be looking at for such a setup?

The second mailserver is for my work and its primary purpose will be to eliminate the need for inter-office Emails to leave the LAN. I presume this is a trivial ability of mailservers but again where do I need to look to ensure that mail going from user1@mywork.com to user2@mywork.com doesn't leave the lan? It seems pointless that an Email with a 5Mb attachment must leave the building just to go across to the other side of the office.

Thanks for your help.

BTW - both machines will be running OpenBSD 3.5

Gsee
 
Old 01-04-2005, 03:19 AM   #2
mcleodnine
Senior Member
 
Registered: May 2001
Location: Left Coast - Canada
Distribution: s l a c k w a r e
Posts: 2,731

Rep: Reputation: 45
The first part of your question: You can either use the rcpthosts file or virtualdomains. rcpthosts is more of a brute force method and users cannot have similar names (joe@foo.com and joe@bar.com are the same 'real' user "joe". If you use vitualdomains, mail is delieverd to a local user mailbox determined by the entries in the virtualdomains file. For example you could have and entry like
Code:
foo.com:joe1
bar.com:joe2
and mail to joe@foo.com is mailed to 'real' local user joe1, and mail to joe@bar.com is delivered to 'real' user joe2. From there you can use .qmail- files in the domain's home directory (ie: in /home/joe1) to redirect mail to additional recipients. These recipients will have to have a local username as well.

I would encourage you to look at using something like vpopmail with qmail. Once it is properly setup it is easy to manage, especially when you get more than three or four domains. Check out Bill Shupp's qmail/vpopmail toaster at http://shupp.org for some great instructions oin setting up a basic virtual host. Combined with vmailmanager, adding users and managing lists and forwards via the web CGI interface becomes a trivial task.

As for the second part of the question - as long as you define your locals configuration file properly, mail will happily be delivered locally.

Last edited by mcleodnine; 01-04-2005 at 03:22 AM.
 
Old 01-06-2005, 09:47 AM   #3
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
You should also consider a more comprehensive howto like the one in my signature or qmailrocks.org. Lifewithqmail is good, don't get me wrong, but if you want nice features like antivirus and spam control, you should consider something more.
 
Old 01-20-2005, 02:21 PM   #4
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Gsee, I am having problems sending you mail. I tried to mail you through this site, but it says you are not accepting mail from people on these boards. If you can provide me with an address that works, I can email you in response to your questions about qmail.
 
Old 01-20-2005, 03:59 PM   #5
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
Theoretically I've now enabled you to Email me through the board. If this still isn't working I'll post my address but it would be preferred if that wasn't necessary.

Thank you greatly for taking the time to reply to me - it is very much appreciated.

Gsee
 
Old 01-20-2005, 06:57 PM   #6
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Didn't work.

Quote:
Sorry! That user has specified that they do not wish to receive emails through this board. If you have a question about a particular thread you may want to try posting a reply in that thread.
This is the reply I tried to send. I guess we either need to start another thread or something.



You definitely want to finish the vpopmail section. vpopmail uses MySql for its back end, so you need to run those mysql commands. If you're not sure how to get to the mysql prompt, just run this command...

mysql -u root -p

This will attempt to log you into the mysql server running on your system. It will try to login as root and allow you the chance to enter a password. Hopefully you've already setup mysql on your system. If not, please let me know what distro of Linux you're using. Redhat? Fedora? Mandrake?

The installation of autorespond seems to have failed because there is no group named 'root' which is required for autorespond. You'll need to create a group called 'root' like this...

groupadd root

Hope that helps.
 
Old 01-21-2005, 10:05 PM   #7
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
Thanks for your reply Donboy

I've decided to switch to another howto for setting up my mailserver. I"m now using the flounder how found at:

http://www.flounder.net/qmail/qmail-howto.html

I think I'd prefer this method as it takes things a little slower which will enable me more of a chance to make more sense of what's going on.

But, alas, I'm having problems.

Everything runs smoothly until I reach the step of 'ps auxwww | grep qmail' as I receive:

$ ps auxwww | grep qmail
root 31354 0.0 0.5 40 336 ?? S 1:18PM 0:11.65 readproctitle service errors: ...t qmail-smtpd/run: access denied\nsupervise: fatal: unable to start qmail-send/run: access denied\nsupervise: fatal: unable to start log/run: access denied\nsupervise: fatal: unable to start log/run: access denied\nsupervise: fatal: unable to start qmail-smtpd/run: access denied\nsupervise: fatal: unable to start qmail-send/run: access denied\nsupervise: fatal: unable to start log/run: access denied\n
root 17047 0.0 0.6 76 400 ?? S 1:18PM 0:18.70 supervise qmail-send
root 14572 0.0 0.6 52 404 ?? S 1:18PM 0:18.45 supervise qmail-smtpd
gsee 10404 0.0 0.0 384 4 p0 R+ 3:02PM 0:00.00 grep qmail (sh)


From what I can tell there is a permission error on all four of the run files. I've tried redoing the how to, heck I've even re-installed OpenBSD 3.6 and started from scratch and found the same problem.

I tried doing ls -l to see the permissions set for the run files and I get the following:

$ pwd
/var/qmail/supervise/qmail-send
$ ls -l
total 12
drwxr-xr-x 3 root qmail 512 Jan 22 13:13 log
-rw-r--r-- 1 root qmail 29 Jan 22 12:56 run
drwx------ 2 root qmail 512 Jan 22 15:04 supervise

$ pwd
/var/qmail/supervise/qmail-send/log
$ ls -l
total 8
-rw-r--r-- 1 root qmail 108 Jan 22 12:56 run
drwx------ 2 root qmail 512 Jan 22 15:04 supervise

$ pwd
/var/qmail/supervise/qmail-smtpd
$ ls -l
total 12
drwxr-xr-x 3 root qmail 512 Jan 22 13:14 log
-rw-r--r-- 1 root qmail 234 Jan 22 12:57 run
drwx------ 2 root qmail 512 Jan 22 15:04 supervise

$ pwd
/var/qmail/supervise/qmail-smtpd/log
$ ls -l
total 8
-rw-r--r-- 1 root qmail 109 Jan 22 12:57 run
drwx------ 2 root qmail 512 Jan 22 15:05 supervise


To me, everything looks ok so I can't explain the error.

Any further help would be greatly appreciated.

My task after completing this how to will be to install squirrrelmail followed by few other cool features which I may call upon your guidance for.

Thanks again Donboy - I think I sent you an invite, but if I didn't I have a gmail invite for you if you wish, as a method of thanks for all your help. Let me know.

Gsee
 
Old 01-21-2005, 10:44 PM   #8
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Your run scripts need to be chmod 755. Right now, you're showing they only have read permission.

I really don't know how gmail invites work, but it doesn't matter. No reward is necessary or desired. I just like helping people learn new stuff.

I hope I will be able to help you. I'm not familiar with this howto, so I don't know if I will really be able to help you effectively.
 
Old 01-21-2005, 10:57 PM   #9
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
Thanks, I now get this - I tried doing the chmod command to the rc file too, but I still get the error - progess none the less, but still not there yet.

mailserver# ps auxwww | grep qmail
root 31354 0.0 0.5 40 336 ?? I 1:18PM 0:17.76 readproctitle service errors: ...: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n./run[2]: /var/qmail/rc: cannot execute - Permission denied\n
root 17047 0.0 0.6 76 400 ?? I 1:18PM 0:28.61 supervise qmail-send
root 14572 0.0 0.6 52 404 ?? I 1:18PM 0:28.14 supervise qmail-smtpd
qmaill 28685 0.0 0.7 104 416 ?? I 3:56PM 0:00.05 /usr/local/bin/multilog t s2500000 /var/log/qmail/qmail-send
qmaild 4552 0.0 0.7 124 456 ?? I 3:56PM 0:00.05 /usr/local/bin/tcpserver -H -R -v -p -x /etc/tcp.smtp.cdb -u 1002 -g 1000 0 smtp /var/qmail/bin/qmail-smtpd
qmaill 14322 0.0 0.6 72 388 ?? I 3:56PM 0:00.04 /usr/local/bin/multilog t s2500000 /var/log/qmail/qmail-smtpd
qmails 20608 0.0 0.7 116 464 ?? I 3:56PM 0:00.11 qmail-send
qmailq 21401 0.0 0.6 108 412 ?? I 3:56PM 0:00.04 qmail-clean
root 4327 0.0 0.6 88 372 ?? I 3:56PM 0:00.03 qmail-lspawn |dot-forward .forward\n./Maildir/
qmailr 16960 0.0 0.6 96 368 ?? I 3:56PM 0:00.03 qmail-rspawn

If I send you a Gmail invite and you accept it you're can have a gmail Email address which is google mail, enabling you to have a 1GB inbox. Let me know if you're interested.

gsee
 
Old 01-22-2005, 12:08 AM   #10
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
The answers are visible right there in the log messages...

"/var/qmail/rc: cannot execute - Permission denied"

You just need to chmod these files to 755.

It sounds like this tutorial isn't very good if it doesn't explain these basic requirements.
 
Old 01-22-2005, 09:28 PM   #11
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
Please don't start a flamewar with me in regards to 'which is the best howto'.

Everything seems to be working now. Looking back at the howto:

http://www.flounder.net/qmail/qmail-howto.html

I've made my way down to '12. rblsmtpd.'

Donboy, if you could have a look at the howto to find out what's being discussed here and share your thoughts I'd be highly appreciative. I've started to follow the directions for TMDA but I'm getting a little lost.

Everything keeps referring to the .qmail files in the user home directories. My understanding was that qmail would be putting everyting into /var, thus I don't even have a /home partition. Somehow I have a /home directory but I assume that must be on the / partition.

Any chance you can step me through the next few stages? I'm getting a little lost and confused.

Gsee
 
Old 01-22-2005, 11:37 PM   #12
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
Ah, I don't care what howto you use. It's all up to you. I'll help regardless of which one. But I'm just saying that some other howtos will give you more features added to your mailserver.

Anyway, I should also mention that TMDA is very very optional. If you don't want to mess with this, I would wait for a while until you are doing good with the other aspects of your mail server before you try using TMDA. It's not terribly hard to setup, but some of the concepts can be confusing, especially to new people who don't understand POP3 email that well. I ran my mailserver without TMDA for a while so that I could get everything in good order. Then after a while, I installed TMDA to help appease my more experienced users who were having spam problems. If you want to eliminate spam, this is the way. However, if you are not getting too terribly much spam, I wouldn't trouble yourself with TMDA unless you really need it. If your spam problem is not too bad, adding TMDA may cause more trouble than its worth.

That being said, here's the howto I used for installing TMDA. It was pretty easy and painless for me.

http://mung.net/~dude/howto/Qmail-vp...dmin-tmda.html

Bear in mind, this was written for Debian, but it's not too different from any other distro.

When you setup your qmail installation using a howto like www.lifewithqmail.org, they are assuming your mail server has system accounts. LIke people who login to your unix system using a shell account. In that case, each person has their own home directory and they probably also have .qmail files in there to help control how qmail delivers mail to their account.

Now, if you have setup your qmail installation using something like vpopmail, then vpopmail handles all of the user accounts on the system. You don't have to allow people to have shell acounts on the system in order to use the qmail server. vpopmail also handles their home directories (located under /home/vpopmail/domains) and there are .qmail files located under these folders that control the delivery of mail to those accounts. When you are using vpopmail, you don't have to worry so much about how .qmail files are doing their job. vpopmail creates and modifies the .qmail files behind the scenes and you don't have to mess with them very much.

TMDA also uses the .qmail files to manipulate how mail is delivered or routed once it is received on the system. If you have not changed anything about your .qmail files before, you should not need to unless you have a specific need... like if you need to deliver mail into a certain mailbox under certain conditions you can modify your .qmail files to accomplish that.

I'm a little concerned because I just looked at the howto you sent me and I don't see any discussion about installing vpopmail. I think you really should use this. It makes administration of your mail server much easier because you don't have to mess with .qmail files, you don't have to setup virtual domains manually (as their howto seems to suggest) and you have command line tools you can use for creating, editing and deleting accounts on your system.

If you'd rather not use vpopmail, that's fine. It's not required, but it sure makes everything easier. I couldn't imagine using a mail server without it.

What TMDA howto are you following?
 
Old 01-23-2005, 01:56 AM   #13
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
Donboy you're certainly one of the dying breed of people who still understand the terms 'help' and 'support'! I continually express gratitdue for everything you're doing for me.

The reason I like the look of the howto I"ve used is because it appeared to be only what was needed for a basic qmail install. This is not to say I"m after a basic install - infact I don't think I am. But my point was that if I use a basic howto it will help me understand the fundamentals of what's going on with the mailserver - this is as opposed to something like lifewithqmail or even the one you've got in your signature - I feel these howtos tend be:
do this
this
this
this
this
and this
and everything will be working.

My intended approach is to get the basic system working (as per the howto I was using or another simple one you can suggest). And then add what I need such as spam control, webmail etc etc. But take a step by step approach to adding and enhancing the system.

Now... that said... let's see how we go getting this thing to work.

For now let's forget TMDA - as I said we can add/enhance the system when everything's working.

Can you answer what's probably a very basic question. Do I need a local login for every mail user? My assumption and limited understanding is that I do NOT need this. Let me elaborate -

If I were to have

user1@mydomain.com
user2@mydomain.com
user3@mydomain.com

does there need to be an account for user1, user2 and user3 on the system? As I said everything keeps referring to the home directory of each user. I would imagine I don't need a login/account for EVERYONE as this would be a monumental inconvenience and indeed A MESS for large mailservers such as those of ISP's.

Now, referring back to the howto I've used let's for now assume that I've completed up to and including step #11 excluding the tests. What would be my next step to getting the base system working before we start making it more advanced?

Let me again take the opportunity to redefine my needs:

1) multiple domains (as the thread suggests) - enabling me to handle mail for mydomain.com and mybrothersdomain.com

2) Emails from within a local office don't leave the building when going between staff members - a step I presume to be trivial or unecessary.

3) Webmail

4) Antivirus measures

5) Antispam measures

Donboy (and others) I leave myself in your hands - whatever you suggest and are willing to help me with is the method I'll take.

Thanks in advance,
Gsee
 
Old 01-23-2005, 02:17 PM   #14
Donboy
Member
 
Registered: Aug 2003
Location: Little Rock, Arkansas
Distribution: RH, Fedora, Suse, AIX
Posts: 736

Rep: Reputation: 31
>> does there need to be an account for user1, user2 and user3 on the system?

Pretty much, yes. I think there may be better ways of handling it than having to run "useradd" everytime you want to create another account, but I'm not familiar with those methods very well. When I started running my own mail server, I ran it according to "lifewithqmail" for a little while, but it wasn't very long! I only had a couple of accounts on the system so it wasn't a big deal to add a few here and there. But if you're going t become an ISP with hundreds of mail accounts, you are going to need a more "industrial strength" mail server. I'm sure there are people here (and elsewhere) who might say this simply isn't true and I'm sure they can refer to a bunch of utilities that are available that make it easier to administer a mail server, but I have never really looked very closely at these, or the stuff I did find was poor and didn't suit me very well.

So with that being said, let me tell you more about the benefit of vpopmail. With vpopmail, it gives you a bunch of command-line tools that you can use for adding/modifying/deleting mailboxes. it also handles the creation of home directories for you. It also allows you to NOT have system accounts that are mapped to /etc/passswd. vpopmail stores all the home directories under /home/vpopmail/domains and it makes management so easy that you (should) never have to go under these directories and make changes. The command line tools they provide take care of everything.

Furthermore, there is qmailadmin, which provides a web browser interface you can use for modifying email domains. So if you want to become an ISP and you want your customers to have better control over their domain, you definitely want to add qmailadmin. This will allow them to login to their account and add/modify/remove mailboxes under their domain. So this gives you the ability to delegate that job to your customers.

Now to your needs...

If you're just planning to manage 2 domains, then maybe the howto you're using currently is all you need. But if you're expecting to have many many users on your system, I think you should consider vpopmail with qmailadmin so that adding domains in the future and adding email boxes is easier.

Assuming you set everything up properly, the email messages sent across your LAN should never go outside. Mail will travel to the mail server and users can access the mail server by referring to its local IP address or a local hostname. For example, if your mail server is operating as "mail.yourdomain.com" then presumably you should be able to use "mail" (this is the hostname part of your domain name) when setting up your email client and in that event, no email will leave the LAN. It will travel from one machine to another on your LAN and never go outside. Now on the other hand, if you setup your email client (like outlook or whatever) to use the full domain name, then yes, it's going to go outside to your ISP and then back into your network to deliver the mail.

I consider webmail to be one of those addons that you can plug into your server later on. Anti spam can be done using rblsmtpd, which comes standard with qmail, so no worries there. Antivirus will be a little more complicated to install, but this should only be necessary if you are planning to run your own ISP and you are simply needing to add this feature to appease your customers or you are wanting to add this feature because it will help you sell more subscriptions to your customers. What I mean is... if you are running Norton Antivirus (or the like) on your personal desktop, then you already have a really nice antivirus solution in place. Adding antivirus (for example, Clam AV) on the server isn't going to buy you that much additional security. Your local antivirus program is probably going to do a much better job of catching viruses than the server's antivirus solution. IMO, installing a server-based antivirus solution is only needed for (1) customers who demand it, (2) your desire to appeal to customers you haven't landed yet, (3) you are a large ISP and adding this basic virus protection just to help keep the world a safer place.

Anyway, those are my opinions. If people disagree, I encourage them to post in the thread instead of remaining slient.
 
Old 01-23-2005, 04:00 PM   #15
Gsee
Member
 
Registered: Mar 2004
Location: Australia
Distribution: FreeBSD, OpenBSD, Gentoo, Debian
Posts: 153

Original Poster
Rep: Reputation: 30
So it appears vpopmail is where we begin from here. The howto that you recommend indicates installing/configuring vpopmail in a way that uses mysql in one way or another. I have never used mysql and feel I'd be very lost in that territory. Can you let me know what you suggest for getting vpopmail up and running?

Gsee
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
qmail and wrong domains RonGG Linux - Software 3 04-19-2005 11:38 AM
qmail and real domains (no vpopmail) LKWPeter Linux - Networking 1 01-04-2005 02:04 AM
Parked Domains in Qmail grimreaper Linux - Software 0 07-30-2004 01:03 AM
qmail & virtual domains monacoflasher Fedora 1 06-07-2004 11:36 AM
Multiple email addresses with qmail (same prefix, different domains) Shaolyen Linux - General 1 11-16-2003 11:50 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 02:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration