# Qmail incomming problems

## dcstimm

Hey all, 

I have been working all day trying to get qmail to recieve email using qmail-pop3d 

Basicly the qmail-smtp works fine, I can send messages perfectly.

my problem is if I send one to my self daryl@localhost or daryl@hostname or daryl@ipaddress or daryl@domain.com I dont receieve the email.   

I even set up a MX record with zoneedit.com

mail.domain.com --> domain.com I believe is how they set it...

But im not sure how that works exactly.

I am able to telnet domain 110 and USER PASS into the account.  but when i type STAT or LIST it always shows no messages.

so its authenticating..

So I have no idea where this mail is going...

Do I need a MX record?  can I just do daryl@localhost?

daryl@hostname?

Does it need a real domain name?

mail.domain.com is pointing to my ip

domain.com is pointing to my ip

So I guess Im just really confused.

Or maybe I just dont understand how email works:-)

----------

## dcstimm

yes I have tried the amazing howto at lifewithqmail....

----------

## rac

 *dcstimm wrote:*   

> my problem is if I send one to my self daryl@localhost or daryl@hostname or daryl@ipaddress or daryl@domain.com I dont receieve the email.

 

Is this being sent from an outside account, or from on the machine in question?  Do you get a bounce message or does the mail just seem to vanish?

 *Quote:*   

> I even set up a MX record with zoneedit.com
> 
> mail.domain.com --> domain.com I believe is how they set it...
> 
> But im not sure how that works exactly.

 

MX records tell mailers which hosts will accept mail for a particular domain.  There can be several of them, and each has a priority associated with it.  The setup I've used for years is to have a low numbered MX to my own mail server, and then a higher numbered MX for one of my ISP's mail servers.  Normally, mail comes to my mail server.  But if it's down for maintenance, or there are network troubles or something, the ISP's mail servers accept the mail.  Then, when I come back up, they notice and the mail gets delivered later.

 *Quote:*   

> I am able to telnet domain 110 and USER PASS into the account.  but when i type STAT or LIST it always shows no messages.

 

"domain" here means the machine you're trying to install qmail-pop3d on, right?  What is in your user's ~/.qmail file?  Do the qmail-smtpd logs indicate whether the mail was received?

I'm trying to isolate whether it's a problem with qmail-smtpd (getting the mail to the machine at all) or with qmail-pop3d (accessing it via POP).

 *Quote:*   

> Do I need a MX record?

 

Not if you're sending things to fully qualified hostnames, or to IP addresses.

 *Quote:*   

> can I just do daryl@localhost? daryl@hostname?

 

Yes and probably (depends on where the mail is coming from and how the resolver is set up).  daryl@hostname.domain should work from anywhere, regardless of MX records.

 *Quote:*   

> Does it need a real domain name?

 

If you're sending mail from outside, yes.  Otherwise, no, as long as the sender and receiver agree on the fiction.

----------

## Larde

 *Quote:*   

> daryl@hostname.domain should work from anywhere, regardless of MX records.

 

Is that really true? I never thought of that before, but how would a mailer know that bla.blabla.com is really a host and not a subdomain? In both cases it could have it's own IP adress. And it's totally common a certain host is declared as MX for a certain other host. Just wondering, perhaps I'll read some RFCs later. Yippie, you got me to think and research about something.  :Smile: 

Yours,

Larde.

P.S. Ok, it works. mail to to kn@kugelfisch.moonage.net found it's way.  :Smile: 

----------

## rac

 *Larde wrote:*   

>  *Quote:*   daryl@hostname.domain should work from anywhere, regardless of MX records. 
> 
> Is that really true?

 

I think so.  I believe RFC 974 is relevant here, and as I read this:  *Quote:*   

>  It is possible that the list of MXs in the response to the query will be empty.  This is a special case.  If the list is empty, mailers should treat it as if it contained one RR, an MX RR with a preference value of 0, and a host name of REMOTE.  (I.e., REMOTE is its only MX).  In addition, the mailer should do no further processing on the list, but should attempt to deliver the message to REMOTE.

 

...if MX records exist, they are used.  If there is no MX record, direct delivery to the FQDN is attempted.

----------

## Larde

 *Quote:*   

> ...if MX records exist, they are used. If there is no MX record, direct delivery to the FQDN is attempted.

 

Yes, that totally makes sense.  :Smile: 

So back to the original problem. We have to wait for Daryl's answers to your questions. It should probably be a problem with the pop setup I guess, otherwise the mail should have bounced.

Perhaps qmail is a tough start for a beginner in mail setup. But good choice anyway!  :Wink: 

Yours,

Larde.

----------

## dcstimm

Okay,  thanks for all the info,  I knew I wasnt crazy:-)

but I think its because I dont have the ~/.qmail file set up,  Im not really sure what should be in there.

I used /var/qmail/bin/maildirmake ~/.maildir to make the .maildir that I was having a problem with before.

when I do telnet domain 110 I am on the machine that is running qmail.

here is my nmap -sT localhost

```

nmap -sT localhost                   

Starting nmap V. 3.00 ( www.insecure.org/nmap/ )

Interesting ports on localhost (127.0.0.1):

(The 1592 ports scanned but not shown below are in state: closed)

Port       State       Service

22/tcp     open        ssh                     

25/tcp     open        smtp                    

80/tcp     open        http                    

110/tcp    open        pop-3                   

111/tcp    open        sunrpc                  

828/tcp    open        unknown                 

3306/tcp   open        mysql                   

6000/tcp   open        X11                     

10000/tcp  open        snet-sensor-mgmt        

Nmap run completed -- 1 IP address (1 host up) scanned in 1 second

```

Thanks for the help so far!  you taught me how the mx records work...

----------

## dcstimm

also did I have to edit these files?

/var/qmail/control/rcpthosts

/var/qmail/control/locals

because I added

mydomain.com

mail.mydomain.com

is that correct?

----------

## rac

 *dcstimm wrote:*   

> I think its because I dont have the ~/.qmail file set up,  Im not really sure what should be in there.

 

I would try: 

```
./.maildir/
```

The stuff in locals and rcpthosts looks good to me - I have similar entries on my qmail server.

----------

## dcstimm

Thanks guys!  I got it working, it was something to do with dot-forword....

thanks!

----------

## procrustes

Exactly how did you go about fixing the problem?

I'm having a similar issue, and I've seen some .forwards in config files running around, but I'm not sure what to do with them.

Thanks.

----------

## JB

This can be a we-tad frusterating.. how did you do the dot-foward thing?

and do any additional users have to be a member of any groups? to be allowed to recieve mail?

----------

## rac

No, you don't have to be a member of a special group to receive mail.  I get  :Sad:  when people don't bother to post how they resolved things, especially after people spend time helping them debug.

----------

## JB

somewhat rude no doubt

----------

## Messiah

Well I got a tip for you guys.

Look at your logfiles. Especially these ones:

/var/log/qmail/qmail-pop3d/current

/var/log/qmail/qmail-smtpd/current

They giva *a lot* of info.

----------

## JB

The logs are not at all helpful, From a bare install of just qmail it seems to deliver mail to:

/var/qmail/alias/.maildir/ 

but i need it to go to $home/.maildir/

it rejects new users as unknown, but sends to root@host.domain

and delivers to the above listed dir. All i need is for qmail to deliver to $HOME/.maildir/. I have the needed $HOME/.qmail and $HOME/.qmail-default files containing ./.maildir/ but this doesnt matter qmail just iqnores them.

My /var/qmail/control/defaultdelivery contains 

|dot-forward .forward

./.maildir/

So i was thinking It has something to do with dot-forward so i changed /var/qmail/control/defaultdelivery to:

#|dot-forward .forward

./.maildir/

my /var/qmail/rc file is default so it points to /var/qmail/control/defaultdelivery so I know that cant be it.

Am I maybe supposed to have something like "USE="maildir"" in /etc/make.conf or something before compiling.

I have been through everything that I can find if anyone can help please let me know! THX

----------

## Larde

Please have a look here, not having populated /var/qmail/users/assign might be the problem.

Yours,

Larde.

----------

