# Postfix problem?

## Mikey-D

Hey all,

First off, as you can see, I'm new here.  So I apologize if this is in the wrong place (mods, feel free to move it).  Just made the switch to gentoo a month or two back on my old dell 600m (circa 2003).  Got the base system all set up (sans gui) and am now playing around with some other aspects.  Currently working on setting up a mail server.

I'm no expert on linux by any stretch of the imagination.  I was working my way through the instructions here http://www.gentoo.org/doc/en/virt-mail-howto.xml and ran into a snag at step 6.  When I try 

```
 telnet localhost 25
```

I get the following

```

trying 127.0.0.1...

Connected to starscream

Escape character is '^]'.

Connection closed by foreign host.

```

I'm at a loss as to what the problem may be...any suggestions on where to look?

----------

## tony-curtis

Looks like you have the tcp wrappers enabled.  You'll need to set up access in /etc/hosts.allow.

----------

## Mikey-D

apologies, but could you elaborate?  A quick google search on tcp wrappers and hosts.allow indicated that if no matching rules are found in either hosts.allow or hosts.deny, then the service is allowed.  I currently don't have either a hosts.allow or hosts.deny file...

----------

## PaulBain

Do you have iptables installed and enabled?

Perhaps try disabling it for a moment and then trying again.

Also just as a hint, make sure you have added all daemons to your runlevel:

```
rc-update add postfix default
```

Another idea, open a second terminal and do:

```
tail -f /var/log/messages
```

You should see your connection when you telnet.

----------

## Mikey-D

@PaulBain

I don't have iptables installed yet.  I have a custom set of iptables rules that I wrote a while back for my other machine that I intend to import after this is all set up and ready.  I'll try tailing the logs this afternoon, and see what comes up.  As for adding the daemons to the default runlevel, I'd like to wait until I'm done getting this mail server set up, then I'll write a single script which launches all the services at once.  Makes it easier to enable/disable as needed.  That said, I made sure to stop and restart postfix (and all the other services).

----------

## PaulBain

Ok no problem, although I wouldn't write a single script if I were you. It's best to let gentoo's runlevel management handle things.

The init script in gentoo do load dependencies, so you really shouldn't have to worry about it. If it doesn't load one you want, add a dependency.

----------

## Mikey-D

Found the problem.  Had 192.168.1.1/24 in the postfix config for mynetworks, rather than 192.168.1.0/24.   :Razz: 

Rookie mistake.  Thanks guys!

----------

