Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 May 2004 14:06:46 +0200
From:      =?ISO-8859-1?Q?Mattias_Bj=F6rk?= <mattias.bjork@sydnet.net>
To:        Peter Risdon <peter@circlesquared.com>, freebsd-questions@freebsd.org
Subject:   Re: Problems with qmail and connecting to smtp daemon and problem with my virtual domain.
Message-ID:  <40B093D6.3090000@sydnet.net>
In-Reply-To: <40AF52A8.3070406@circlesquared.com>
References:  <40AE85F1.6030807@sydnet.net> <40AF52A8.3070406@circlesquared.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Hello Peter,

Peter Risdon wrote:
> Mattias Björk wrote:
> 
>> Hi, list(ners)
>>
>> Problem nr 1.
>>
>> I have read the following guide to install qmail:
>>
>> http://www.stevenfettig.com/mythoughts/archives/cat_qmailhowto.php
> 
> 
> 
> I'll try to help. You might have looked at these already but if not, 
> they're worthwhile:
> 
> http://cr.yp.to/qmail.html for a general guide, especially the qmail 
> pictures, and:

Homepage of qmail, have read some of it from time to time.

> http://www.lifewithqmail.org - especially read:
> 
> http://www.lifewithqmail.org/lwq.html#test for some diagnostic and 
> testing guidance.

I did know about the page, but I seem to have forgotten about it. The 
Problem is that the link does not work for me as I type. But I have 
google and found some other links that I could use. The might perhaps 
not be so up to date if compared to www.lifewithqmail.org.

> Probably the starting point for testing a new installation is to look at 
> the output of:
> 
> #qmailctl stat

I do not have that commad/script on the server.

> to make sure everything is running properly. All uptimes should be > 1 
> second and identical or very close to it. You should see lines for at 
> least qmail-smtpd and qmail-send and their respective logs.
> 
>>
>> I have not installed from source by my self, I found that all programs 
>> where avalible thru ports. I will make this as sort as possible,
> 
> 
> 
> There is disagreement between the author of qmail and the port 
> maintainer about where the service directory should go. djb says 
> /service whereas the port maintainer says /var/service and this can lead 
> to strange mixed installations, especially when you've been following 
> installation or configuration guides that are not specific to FreeBSD. 
> Check that you only have one or the other. If qmailctl stat does not 
> show enough processes, this might be why.

I have /var/service, my directory listing is like this:

qmail -> /var/qmail/service/qmail
smtpd -> /var/qmail/service/smtpd

Section "2.4 qmail-conf" on the page:

http://stevenfettig.com/mythoughts/archives/000091.php

Says how to set up the service files/directories, that is so I have done 
  it.

The file /var/qmail/service/qmail/run does look like this:

#!/bin/sh
exec /var/qmail/rc

And the file /var/qmail/rc does look like this:

#!/bin/sh
exec env - PATH="/var/qmail/bin:$PATH" \
qmail-start ./Maildir/ /usr/local/bin/multilog t /var/log/qmail qmaill

And finaly the file /var/qmail/service/smtpd/run does look like this:

#!/bin/sh
exec 2>&1 \
envdir ./env \
sh -c '
     case "$REMOTENAME" in h) H=;; p) H=p;; *) H=H;; esac
     case "$REMOTEINFO" in r) R=;; [0-9]*) R="t$REMOTEINFO";; *) R=R;; esac
     exec \
     envuidgid qmaild \
     softlimit ${DATALIMIT+"-d$DATALIMIT"} \
     /usr/local/bin/tcpserver \
         -vDU"$H$R" \
         ${LOCALNAME+"-l$LOCALNAME"} \
         ${BACKLOG+"-b$BACKLOG"} \
         ${CONCURRENCY+"-c$CONCURRENCY"} \
         -xtcp.cdb \
         -- "${IP-0}" "${PORT-25}" \
     /var/qmail/bin/qmail-smtpd
'

>> I set up vpopmail with domain "setiathome.birch.se". The domain is 
>> "birch.se", fqdn is "setiathome.birch.se" for the host. I didn't how 
>> ever install everything. I didn't install ezmlm-idx and auotrespond, 
>> but its not vital for the operation of the mail-server at this time.
> 
> 
> 
> That should be fine.
> 
>>
>> I had this problem, that i couldn't send message to the FreeBSD 
>> mailinglists, but I solved it by adding my ISP outgoing smtpserver to 
>> /var/qmail/control/smtproutes. Perhaps it hade something to do with 
>> reversed DNS.
> 
> 
> 
> I don't think this list checks reverse DNS. Could you send mail anywhere 
> else? Some ISPs do not allow e-mail to be sent through their network 
> unless their smtp server is used, as an anti-spam precaution.

Aha okey, but I didn't send my mail through my ISP smtp server to get to 
anything else but @freebsd.org, didn't work before that.

>>
>> Here are my directory listing from /var/qmail/control/:
>>
>> defaultdomain           plusdomain              smtproutes
>> locals                  rcpthosts               virtualdomains
>> locals.lock             rcpthosts.lock          virtualdomains.lock
>> me                      servercert.pem
>>
>> In the file defaultdomain and plusdomain are the string entry 
>> "birch.se". In the me file there are the hostname of the mail server. 
>> And finaly in the "virtualdomains" file are the string: 
>> "setiathome.birch.se:setiathome.birch.se"
> 
> 
> 
> That means you're expecting to receive mail addressed to 
> user@setiathome.birch.se, not user@birch.se - is that what you want? 
> There should also be an entry in rcpthosts, just the domain name, 
> setiathome.birch.se in this case. Have you made these entries by hand? 
> You shouldn't need to since you are running vpopmail (see below).

Yes, for now. I forgot to say that *.birch.se is my internal domain, and 
  not an domain that works on the internet. How ever I use mutt and 
thunderbird as my MUA and I have set my mail address to 
mattias.bjork@sydnet.net. (as you could se in this mail)

I have MX records for setiathome.birch.se and thrawn.birch.se and 
dasboot.birch.se. So what Im saying is that I understand that 
user@birch.se/user@host.birch.se does not work so well on the outside. 
At least not replying to the mail would not work. But that is not what 
im trying to do either. Internal this mail should work fine however 
cause I have my own DNS server for this.

>>
>> My problems is that I can connect to port 25. The problem is that 
>> nothing happens, look below:
>>
>> <snip>
> 
> 
> 
> Make sure that qmailctl stat gives the right output before going any 
> further.
> 
>>
>>
>> How ever, in the first chapter of the guide. It says the following at 
>> "1.6 courier-imap Hack" :
>>
>> "Because the SMTP after IMAP4(s)/POP3(s) of courier-imap does not 
>> work, here is a small wrapper. This "hack" tracks the IP of the 
>> authenticating user and allows for SMTP sending (i.e. a form of 
>> authenticated SMTP relay)."
>>
>> Perhaps that have something to do with that it doesn't work.
> 
> 
> 
> I'm not sure how...
> 
>>
>> Problem nr 2.
>>
>> The other problem is that I have a user named "thrawn" that is a local 
>> user on the system.
>> The home directory of the user is "/usr/home/thrawn".
>> And the the Maildir diretory is "/usr/home/thrawn/Maildir". When I 
>> connect to my mail via imapd-ssl, It uses the local user Maildir.
> 
> 
> 
> This is a big problem. There shouldn't be a Maildir in this directory, 
> if you set up the domain properly under vpopmail. Use the vpopmail 
> binaries to add domains and users (see below).

As in section "3.1 vpopmail" on the page:

http://stevenfettig.com/mythoughts/archives/000093.php

they describe quite well how to do that. At least the basic stuff.

So I should move the mail from /usr/home/thrawn/Maildir/* to 
/usr/local/vpopmail/domains/setiathome.birch.se/thrawn/Maildir/*.

My periodic scripts that i run daily/weekly/mountly on my hosts, are 
mailed to thrawn@setiathome.birch.se. They get in the directory 
/usr/local/vpopmail/domains/setiathome.birch.se/thrawn/Maildir/new so 
that is working. So atleast something is configured correctly, I forgot 
to mention that in my first mail.

The there is another problem, that might be litle off-topic, but Im 
using getmail to recive my mail from my ISPs pop3 mail-accounts. Then 
there must be a way to make it place it in 
/usr/local/vpopmail/domains/setiathome.birch.se/thrawn/Maildir/new 
instead of /usr/home/thrawn/Maildir/new

> Secondly, it seems that imapd-ssl is not using the right authentication 
> module. It needs to use something that checks with vpopmail and then 
> shows the correct directory. Perhaps consider using courier-imapd 
> instead; it's written by the same people who produced vpopmail and 
> integrates well with it.

That might be my own fault or something that I have missed in the guide 
that I have mentioned erlier. Im using courier-imapd (ssl version) as my 
imapd server. So as you metioned the problem is that I have to change it 
in the some config-file.

I think what you are talking about is the file:

/usr/local/etc/courier-imap/authdaemonrc

In this file there is a string that goes like:

authmodulelist="authcustom authuserdb authvchkpw authpam"

I will try and remove everything except authvchkpw, and see if that 
helps to get to the /usr/local/vpopmail/domains/setiathome instead of 
the local Maildir in /usr/home/thrawn. If that not helps I will try and 
rename /usr/home/thrawn/Maildir to something other.

>>
>> But I have a domain for vpopmail at the following directory 
>> "/usr/local/vpopmail/domains/setiathome.birch.se"
> 
> 
> 
> If you're using vpopmail and it has been set up properly and knows about 
> the domain, this is the start of the directory tree where mail should be 
> placed.

So what you are saying is that what /var/qmail/control/virtualdomains 
are saying with:

setiathome.birch.se:setiathome.birch.se

is something like this:

for the domain "setiathome.birch.se" use the directory 
"root-of-vpopmail/domains/setiathome.birch.se"?

>>
>> And there I also have a user named "thrawn" and with the same password 
>> as the local "thrawn" account. If I understand it correctly for some 
>> reason courier-imap doesn't use my virtual domain, but it does use the 
>> local user. Im sure that it might be me that I have done something 
>> wrong or the documentation is not completly correct.
> 
> 
> 
> See below.
> 
>>
>> Perhaps I should use another domain name and se if it works then, I 
>> haven't tested that yet. I think that it should work anyway, but I 
>> might  be wrong.
> 
> 
> 
> Are you using the binaries vadddomain and vadduser in 
> /usr/local/vpopmail/bin, to set up new domains and users?

Yes Im, as metioned in section "3.1 vpopmail"

Thanks a lot for this reply.

//Mattias Björk



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?40B093D6.3090000>