# qmail & relay

## darktux

```

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 tuxslare.org ESMTP

helo

250 tuxslare.org

mail <test@test.pt>

250 ok

rcpt to <test@test.pt>

553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

quit

221 tuxslare.org

Connection closed by foreign host.

```

Although tcp.smtp reads:

 *Quote:*   

> 
> 
> 127.0.0.1:allow,RELAYCLIENT=""
> 
> 192.168.168.169:allow,RELAYCLIENT=""
> ...

 

And even after

```
root@tuxslare etc # fuser 25/tcp

25/tcp:              16901

root@tuxslare etc # kill -HUP 16901

```

 still no go...

Any sugestions?

----------

## jukka

did you run tcprules after editing your tcp.smtp file (see qmail FAQ, question 5.4)? do you use tcpserver to let qmail-smtpd communicate with clients? did you add a '-x /path/to/your/tcp.smtp.cdb' to the tcpserver invocation?

hth, jukka

----------

## darktux

I did:

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

and I use:

/usr/bin/tcpserver -v -R -x /etc/tcp.smtp.cdb -u 201 -g 200 0 smtp rblsmtpd /var/qmail/bin/qmail-smtpd

and yes, I already did a kill -HUP to the process after all the modifications.

----------

## jukka

 *darktux wrote:*   

> and yes, I already did a kill -HUP to the process after all the modifications.

 

hmm, do you start tcpserver with damontools (supervise etc.), inetd, or as a standalone server?

----------

## darktux

supervise

----------

## kashani

is test.pt supposed to go to the local machine or should qmail send it somewhere else. If it's supposed to be delivered locally you'll need to make sure it's listed in /var/qmail/control/rcpthosts

If mail to test.pt is a remote server try testing to a domain on the local machine. 

kashani

----------

## jukka

 *kashani wrote:*   

> [...] you'll need to make sure it's listed in /var/qmail/control/rcpthosts [...]

 

qmail-smtpd ignores rcpthosts if $RELAYCLIENT is set.

----------

## jukka

hmm, darktux, strange situation. what does you smtpd log say?

----------

## darktux

test.pt well... It's really just to do the test, don't know if it exists or not.. I just wanted him to accept the relay. And yes, I can mail my own local domain, because it's on the rcpthosts file.

 *jukka wrote:*   

> qmail-smtpd ignores rcpthosts if $RELAYCLIENT is set.

 

Are you sure? If I put test.pt on rcpthosts, it will let me 'relay'..

STOP. It worked now.

```
bash-2.05b$ telnet tuxslare 25

Trying 192.168.168.168...

Connected to tuxslare.

Escape character is '^]'.

220 tuxslare.org ESMTP

helo

250 tuxslare.org

mail <test.pt>

250 ok

rcpt to <test.pt>

250 ok

```

```
@400000003e2f57be32638f1c tcpserver: status: 1/40

@400000003e2f57be3a107aa4 tcpserver: pid 17526 from 192.168.168.169

@400000003e2f57bf23d6accc tcpserver: ok 17526 :::ffff:192.168.168.168:25 :::ffff:192.168.168.169::36211
```

Weird.... Haven't changed anything... OH well.... All's good.

Tks for the feedback.

----------

## darktux

Never mind... I was doing it wrong, I wasn't typing the user. So:

```

bash-2.05b$ telnet tuxslare 25

Trying 192.168.168.168...

Connected to tuxslare.

Escape character is '^]'.

220 tuxslare.org ESMTP

helo

250 tuxslare.org

mail <user@teste.pt>

250 ok

rcpt to <user@teste.pt>

553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

```

```

@400000003e2f6092319f58a4 tcpserver: status: 1/40

@400000003e2f609239d69e24 tcpserver: pid 17584 from 192.168.168.169

@400000003e2f60932669e29c tcpserver: ok 17584 :::ffff:192.168.168.168:25 :::ffff:192.168.168.169::36683

```

Still no go...

----------

## darktux

Hello? Still here, and still needing some help   :Crying or Very sad: 

----------

## jukka

 *darktux wrote:*   

>  *jukka wrote:*   qmail-smtpd ignores rcpthosts if $RELAYCLIENT is set. Are you sure? If I put test.pt on rcpthosts, it will let me 'relay'..

 

that's at least what the man page says: *qmail-smtpd(8) wrote:*   

> rcpthosts
> 
> Allowed RCPT domains. If rcpthosts is supplied, qmail-smtpd will reject any envelope recipient address with a domain not listed in rcpthosts.
> 
> Exception: If the environment variable RELAYCLIENT is set, qmail-smtpd will ignore rcpthosts, and will append the value of RELAYCLIENT to each incoming recipient address. [...]

 

 *darktux wrote:*   

> Never mind... I was doing it wrong, I wasn't typing the user.

 

if you don't specify a user name, the message is delivered to the postmaster. did it arrive there?

btw: first you typed '@test.pt', and afterwards '@teste.pt' (e before dot). maybe you just misspelled your domain name!?

hth, jukka

----------

## darktux

Everything else is working fine. I can deliver to my own domain, and the aliases for POSTMASTER, ROOT, and everything is working fine.

The only thing I can't do is relay from 

127.0.0.1

192.168.168.169

192.168.168.168

213.228.189.208

to some other domain, which I could do earlier with this tcp.smtp file on LFS and Slackware.

For future reference:

```

tcprulescheck /etc/tcp.smtp.cdb

rule :

allow connection

```

----------

## jukka

 *darktux wrote:*   

> The only thing I can't do is relay from [...] to some other domain

 

really strange. do you use a qmail ebuild, or did you compile / install it manually? in case you use the ebuild, maybe you should try installing qmail manually and use the same tcp.smtp file.

i don't know whether the qmail ebuilds are ok or not. i don't use them. but i use the daemontools (version 0.76-r1) and ucspi-tcp (version 0.88-r4) ebuilds, and my qmail installation works fine, and lets me relay.

----------

## darktux

Going to try out qmail 'vanilla' now. Hope it works.

----------

## darktux

```
bash-2.05b$ telnet 127.0.0.1 25

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 tux.tuxslare.org ESMTP

helo

250 tux.tuxslare.org

mail <teste@test.pt>

250 ok

rcpt to <teste@teste.pt>

553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)

```

Using the vanilla qmail.... So perhaps it's a ucspi issue? Going to try that later..

----------

## darktux

AHA! EURECA!   :Very Happy: 

emerge -C ucspi-tcp and then compiled and installed it manually (vanilla).

And it WORKS!

```

bash-2.05b$ telnet 127.0.0.1 25

Trying 127.0.0.1...

Connected to 127.0.0.1.

Escape character is '^]'.

220 tux.tuxslare.org ESMTP

helo

250 tux.tuxslare.org

mail <teste@test.pt>

250 ok

rcpt to <teste@teste.pt>

250 ok

```

Going to post this @ bugs.gentoo.org

----------

## jukka

 *darktux wrote:*   

> emerge -C ucspi-tcp and then compiled and installed it manually (vanilla).
> 
> And it WORKS!

 

compiled and installed what? ucspi-tcp or qmail?

please post a link to the bug report here.

----------

## darktux

 *jukka wrote:*   

>  *darktux wrote:*   emerge -C ucspi-tcp and then compiled and installed it manually (vanilla).
> 
> And it WORKS! 
> 
> compiled and installed what? ucspi-tcp or qmail?
> ...

 

ucspi-tcp. Now I've removed the patches bit on the ebuild and re-emerged it, and everything is working fine. 

BUG

Keep in mind that I'm not a very good bug poster   :Rolling Eyes: 

----------

