LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Qmail confusion. Please Help. (https://www.linuxquestions.org/questions/linux-software-2/qmail-confusion-please-help-160812/)

l0f33t 03-22-2004 02:55 AM

Qmail confusion. Please Help.
 
Hello,

I have acouple of really stupid questions that I can't seem to figure out. Some quick info.

I have 2 separate email accounts at my ISP. They host Regular SMTP and POP3 servers. I pull the mail off their servers via fetchmail to the server running qmail internally. Qmail is running POP3D.

1) As a test I want 2 windows pc's on the internal lan to simply grab their mail from qmail via pop3. As well as relaying mail for them to. What I don't understand is, do I actually need too create system accounts on the qmail server for the windows machines even know the only thing these windows users will ever do is just a pop3 interaction to grab mail?

If so, does it matter what I name the system accounts? Should it be the actual host names of the windows machines or the windows user account names that will be connecting to qmail or does it not matter?

2) If I need to create accounts on the qmail server for the 2 windows pc's, considering the only thing they will ever do is send and receive mail from this server and that's it.....

What is the easiest way to setup their accounts? I.E. When I setup my normal non-root user on linux I used the following:
Code:

useradd jblow -m -G users,wheel,audio -s /bin/bash
If I were to add the windows users they obviously don't need a shell and need only the ability to do send and grab mail via this qmail server. What are the the settings that I need to use when doing "useradd" for the 2 windows users?

3) When the 2 local windows users send mail for qmail to relay out to the ISP.... how do I ensure that mail is relayed with their normal email header From: user1@isp.net ? As the isp's smtp server expects to see it.

Thanks,

svartrev 03-31-2004 06:06 AM

Uh, I think you got the same Q I had a couple of weeks back when I started installing qmail for the first time.

I didn't know anything about mail servers. My basic setup was a small work LAN using martian addresses, mostly windows XP workstations running Outlook, a Linux (RedHat 9) server for qmail, apache and MySQL, and a Linux (RedHat9) firewall with one of our legal IP addresses on the outside.
I also wanted to give all the people in the office an email address without creating a user account for them on the Linux server.

Luckily the answer is quite simple. Install vpopmail. This creates one user account on the Linux server, and sets up a virtual domain under qmail. All mail going to anybody@yourvirtualdomain goes to vpopmail, which puts it under that one user account. Check it out

l0f33t 03-31-2004 08:15 AM

Thanks svartrev.

Cool. I'll check out vpopmail. Does vpopmail need/use/ or depend on MySQL database in any shape or form? A simple yes or no will suffice. Just wondering. Thanks.....

Are you using qmail for hosting a public mail/mx domain though? I don't host a public mail server. This (qmail) would strictly be used for acedemic mail server learning purposes. So when clients internally send mail out... qmail needs to relay this to the ISP's smtp server where there public accounts reside. Some how I need to have the email headers in outgoing emails leave qmail with the clients public looking mail "From: Headers"..... as would normally be seen by the ISP's smtp server if I wasn't using Qmail.

Does that make sense?

Right now I host my own non-public internal domain using DJBDNS. AKA Tiny-dns and Dns-caching E.G. internalnet.com

So for instance, Win2k pc1 points to the internal qmail smtp server when sending any outbound email. The mail From: headers would look like "win2k@internalnet.com". When qmail relays outbound email for this client to the ISP's smtp server, (Since I don't host my own public mx sever), qmail needs to rewrite the From: headers to look like "joeblow@isp.net".

Are you doing something similar? Any input is greatly appreciated. Thanks.

svartrev 04-02-2004 05:09 AM

Uh, no, vpopmail doesn't need MySQL. It might be able to use it, but it isn't using it on my machine.

Yes, I am hosting a public mail server. I have a fixed line with a legal IP for my firewall, which is set up as the MX record for our licensed domain on our ISP's DNS server.

Why don't you just let qmail send mail directly out? You let it connect through any firewalls to the outside world, where it looks up the recipients MX record and connects to their server, then hands the message off to them. Of course, the from address wouldn't work if you are not a public server. But couldn't you just set the relpy-to address as your ISP email address?

Otherwise, I'm not sure, you might be able to write a custom scipt to intercept all outbound email on its way to your ISP, rewrite the header, and send it on its way, but this seems like a lot of work. However, check out http://www.superscript.com/qtools/filterto.html As far as I can see, you could use a dummy account, set up qmail that all outbound email goes to this dummy account, and the program called by filterto would rewrite the from line (using sed or such), then filterto would send the mail on to your ISP. It should work, but just doesn't seem like an ideal solution to me. Then again, if it works...

Then again, I just found qmail-masq at http://www.folug.linux.it/sviluppo/q...mail-masq.html
(I am currently researching your Q on the web, a simple read through of the user contrib section at http://qmail.ru.ac.za/top.html revealed the above suggestions)

Haven't actually used any of the above myself, but hope the links give you a place to start...

l0f33t 04-02-2004 08:15 AM

Wow.. cool. Thanks for the links. This helps a ton.

Quote:

Why don't you just let qmail send mail directly out? You let it connect through any firewalls to the outside world, where it looks up the recipients MX record and connects to their server, then hands the message off to them. Of course, the from address wouldn't work if you are not a public server. But couldn't you just set the relpy-to address as your ISP email address?
Well from my understanding, correctly configured mail servers upon receiving any email will first check to make sure that the sending mail server has an MX record associated with the ip address that it appears to be sending mail from.. since I don't have a public mx record associated with my external ip address the mail would more than likely would be rejected regardless of what the reply/to path/header says.

Thanks for the suggestions though. The qmail masq link is perfect. This alone, solves half of my problem.

Now, all that I need to do is figure out how to tell qmail, "when sending any email, always forward email to myisps.smtpsever.com". Then I will be all set. The answer to that would solve the other half of my problem.

Thanks for your reply. This has helped a ton. I know if I had a public mx record that this would be very easy to setup. Unforturnately were not ready to do this yet... My testing setup is more or less to get some experience with qmail itself as well as integrating qmail scanner and some type of anti-spam softeware. Once I have a firm grip this type of setup then we will go public. Thanks again.

svartrev 04-06-2004 02:17 AM

Good point, several (most?) mail servers would probably reject your mail if you don't have a reverse lookup on your domain name and/or an MX record pointing back to your mail server.

Glad qmail masq seems to help.

I'm kinda in the same boat about getting a firm grip on qmail, anti-virus, anti-spam, squirrelmail etc. except that I am administering a live site (while actually trying to get some programming work done at the same time, and all by friggen ASAP or earlier, preferably yesterday!)

As to the second half of your problem: a brief look at the man pages of qmail-remote suggests a possible (untried) solution. I don't know why, but when I installed qmail, the man pages were not integrated into the man system. They can be found under /var/qmail/man/, so for example to view the man pages for qmail-remote typing:

[foo@bar /]# man /var/qmail/man/man8/qmail-remote.8

should show you the man pages in proper man format.

It seems qmail-remote, which is responsable for delivering mail to remote hosts, has a control file called smtproutes, that can specify artificial routes to mail servers like so:

domain:relay

so if the mail is destined for domain, it is routed via relay. A blank domain acts as a wildcard, so:

:yourisp

should route ALL outgoing mail via your isp.

Hope this helps.

l0f33t 04-06-2004 05:01 PM

Thanks. Yes, I ran acrossed that same man page. Now I just need to set everything up..


Thanks for all your help svartrev.

svartrev 04-07-2004 03:02 AM

An absolute pleasure, dude.

mardanian 04-07-2004 06:05 AM

well i do read all your answering and question, Just wana know to configure qmail "svartrev" way on localhost what qmail packages i have to install?
"svartrev" you will probably give me suggestion coz you have the same case like me of no public domain yet.

svartrev 04-08-2004 03:55 AM

The "Svartrev" way... I like it... :>
Uh, sorry, I DO have a public domain, its l0f33t who doesn't, but still...
I have a plain vanilla qmail, with vpopmail for virtual domains, qmail-pop3d for pop access, and the smtp-auth patch for smtp authentication for access outside the offcie LAN. the smtp patch works fine, but I am having minor difficulties trying to get it to work with vchkpw instead of the recommended cmd5checkpw. Other than that, I am trying to set up courier-IMAP (which is not wanting to compile at the mo), so that I can set up SquirrelMail for web access to email. Also, Iwant to get SpamAssasin and ClamAV for spam and virus control. That would pretty much sort me out.

Most of the stuff I mentioned (probably all of it) can be found by doing a google search. Let me know if you run into any specific difficulties, and I will try to give further assistance. If you really can't find anything out there, I will try to locate where I got it from, or try and put it on our website that you can download it, but I don't really have time right now (perhaps next week :)


All times are GMT -5. The time now is 09:08 AM.