# qmail/vpopmailemail server setup prob.

## _easyrider_

I have finished all the steps in the guide on how to install a mail server with qmail/vpopmail, but when i the try to send a mail out from my lan i get this error.

```
The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was 'jhv@privat.dk'. Subject 'test mail', Account: 'Admin blabla.dk', Server: '10.0.0.1', Protocol: SMTP, Server Response: '553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)', Port: 25, Secure(SSL): No, Server Error: 553, Error Number: 0x800CCC79
```

What can cause this error??

----------

## BobOki

Good luck brother man!

I have been trying to figure this problem out for over a week, and I have a thread about it right below this one actually..

https://forums.gentoo.org/viewtopic.php?t=149478

I have yet to come up with an answer besides turning on total relay, and thats a NO.[/code]

----------

## _easyrider_

Had a look in my rcpthosts file, it was just an empty file.. Do i need to add my lan ip address so that i am able to send mail from my lan side??

----------

## BobOki

First I need to know something else. Are you using courier-imap as well?

As for the rcphosts, all you put in it is your domain names.

So like this:

```
nano rcpthosts

test.com

poo.com

stilldoesntwork.com

```

If you are using courier-imap, than you also need to worry about the tcp.smtp in the /etc dirs..

----------

## _easyrider_

Yes im using courier-imap.. Had a look once more at the rcpthosts and my domain name is there now...

What do i need to do when using courier-imap?.

----------

## BobOki

Well, you need to:

 *Quote:*   

> 7) install courier-imap as imap and pop3 server 
> 
> Code: 
> 
> > emerge courier-imap 
> ...

 

If you are using qmail-scanner you also need to do:

 *Quote:*   

> Now update tcp.smtp to activate qmail-scanner 
> 
> > nano -w /etc/tcp.smtp 
> 
> # Qmail-Scanner disabled for mail from 127.0.0.1 
> ...

 

I too have done all the above, and I still get the same errors.

I think there is a problem with courier-imap/pop3d that is not telling qmail that the session has been authenticated. How it should work is when you connect to send you authenticate, then it allows you to send to anywhere. If we are getting that error, to me it sounds like we are trying to relay. Maybe I am missing something somewhere, like @on auth = allow relay or something, but I have not seen that in any conf files.

----------

## _easyrider_

I have tried to send an email to the person that made the guide, and explained what my problem is. Hope he writes back soon.. But will allso try what you have descriped... 

By the way, sorry if my english issn't so good. Im from denmark, and im not so good at it   :Embarassed: 

----------

## BobOki

actually, your english is quite good.

Please, keep me informed when you get your answer! I have the same problem!

----------

## _easyrider_

Hmm i think i have solved my problem.. I added this line in /etc/tcp.smtp

```
# ALLOW THESE IPS TO RELAY MAIL THROUGH OUR SERVER

#

# Local class-c's from our LAN are allowed to relay,

# and we wont bother doing any RBL checking.

10.0.0.:allow,RELAYCLIENT="",RBLSMTPD=""

#123.111.111.:allow,RELAYCLIENT="",RBLSMTPD=""

```

and run this command

```
tcprules /etc/tcp.smtp.cdb /etc/tcp.smtp.tmp < /etc/tcp.smtp
```

and then it worked   :Very Happy: 

----------

## BobOki

That is only for internal.

If you go to any other ip other than 10.0.0 then you will get the same error again.

----------

## BobOki

Let me rephrase that.

If you try to send mail from any other ip than on the 10.0.0 network, you will get the same error.

So if you create a account for a buddie, and he tries to send e-mail from his home, he will have the same problem.

----------

## _easyrider_

yes, you are right, im not able to send from an email outside my server, to my server   :Crying or Very sad: 

sorry, thought i had found the solution..

----------

## BobOki

Yeah... I came to that conclusion as well.

If you add that other guys external ip as a openrelay, he can send to.

Obviosuly the only way to fix this THUS far is to allow everyone relay, but then you will not like the results of that. ZERO security, ZERO everything.

Anyone can send anything through you, and that is NOT acceptable.

I am seeing a lot of people with this same problem, and then I also see systems, or hear of them, that are working, so I KNOW there is a fix... but what it is, I don't yet know.

----------

## _easyrider_

Hmm strange... Just strange...

----------

## jingo

Did you add the domains your are receiving mail for in your rcpthost file?

receiving mail and relaying mail are two different things.

When using the tools who came with vpopmail to create virtualdomains it normally adds host to rcpthost and to virtualdomains.

----------

## BobOki

I know I personally added the domains. And still the error exists.

----------

## jingo

 *BobOki wrote:*   

> I know I personally added the domains. And still the error exists.

 

I use

```
/var/vpopmail/bin/vadddomain mydomain.tld
```

----------

## jingo

I have had a local qmail running for quite long. I just installed vpopmail to check if there were a problem with gentoo ( normally i have it on a solaris box ).

By just using the tools under /var/vpopmail/bin everything runs fine.

_easyrider_:

Hvis du bruger TDC som udbyder, så har de stoppet både ind og ud gående trafik på port 25.

For at sende ud af huset skal du tilføje en fil: /var/qmail/control/smtproutes med:

```
:smtp.mail.dk
```

Ind ad huset er noget med nogle MX records i din domæne opsætning

----------

## BobOki

 *jingo wrote:*   

>  *BobOki wrote:*   I know I personally added the domains. And still the error exists. 
> 
> I use
> 
> ```
> ...

 

Again, I already added the domains.

It is looking like nothing is really authenticating.

----------

## jingo

Do you have all files in the control dir?

Some of your config:

 *Quote:*   

> # and reads it's data from /etc/poppasswd
> 
> # see the manpage for cmd5checkpw for details on the passwords
> 
> # uncomment the next four lines to enable SMTP-AUTH
> ...

 

Try comment out all those last lines. And QMAIL_SMTP_POST in the beginning of the file. Just to check they are related to authenfication on sending email, might be giving you troubles.

----------

