# wtf is on port 25?  i.e postfix problems

## gedanken

Im trying to follow the excellent gentoo faq on how to set up postfix with ssl to handle multiple domains for multiple users.  all seemed to be going well, until:

the docs want me to telnet to localhost 25 and make sure the new auth stuff is working after postfix reload.  instead of getting any text, something is answering the connection but never responding.  example:

arioch root # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

HELO edgeoftheworld.com

EHLO

asd

as

d

as

asd

as

^]

telnet> quit

Connection closed.

1)  how can i see what program is answering on port 25??

2)  any ideas what might be wrong with postfix, assuming it is postfix answering and then not doing anything?

i was expecting:

Code Listing 6.2: Verifying sasl and tls support

# telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 mail.domain.com ESMTP Postfix

EHLO domain.com

250-mail.domain.com

250-PIPELINING

250-SIZE 10240000

250-VRFY

250-ETRN

250-STARTTLS

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250-XVERP

250 8BITMIME

^]

telnet> quit

----------

## gedanken

oh i forgot to mention - i did an emerge -Cp before i started on sendmail, qmail, and exim to make sure they were not installed, and none were.

matt

----------

## verbatim

 *gedanken wrote:*   

> 
> 
> 1)  how can i see what program is answering on port 25??
> 
> 

 

I usually use "netstat -lp --tcp".

----------

## gedanken

what the heck is 'master'?

arioch root # netstat -lp --tcp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name

tcp        0      0 *:imaps                 *:*                     LISTEN      22335/couriertcpd

tcp        0      0 *:pop3s                 *:*                     LISTEN      22457/couriertcpd

tcp        0      0 localhost:mysql         *:*                     LISTEN      9208/mysqld

tcp        0      0 *:netbios-ssn           *:*                     LISTEN      5719/smbd

tcp        0      0 *:pop-3                 *:*                     LISTEN      22396/couriertcpd

tcp        0      0 *:imap2                 *:*                     LISTEN      22274/couriertcpd

tcp        0      0 *:www                   *:*                     LISTEN      5389/apache2

tcp        0      0 *:ssh                   *:*                     LISTEN      5375/sshd

tcp        0      0 *:631                   *:*                     LISTEN      5437/cupsd

tcp        0      0 *:smtp                  *:*                     LISTEN      10433/master

tcp        0      0 *:microsoft-ds          *:*                     LISTEN      5719/smbd

----------

## gedanken

ok i did some googl0ring and i see that 'master' i the correct postfix daemon to be listening.

any ideas why it isnt responding with anything usefur or interesting when i telnet to it?

----------

## DaveArb

How is your DNS? I don't know Postfix, but Sendmail will give a long pause before announcing if DNS isn't resolving. I believe it is doing an rDNS on your IP.

If it's a DNS error, it should proceed after a half minute or so.

Dave

----------

## gedanken

wow great idea but i let it go for 15 min and still no response =(

----------

## Janne Pikkarainen

I think you've been hit by a some obscure thing in Postfix ebuild. I complained about it in bugs.gentoo.org a while ago but haven't heard about it in long time.

Anyway, create a directory called /var/spool/postfix/etc and copy the following files from your /etc directory to it:

```
hosts

localtime

nsswitch.conf

passwd

resolv.conf

services
```

After that restart Postfix and all should work fine. Postfix runs some parts of it in a chroot jail and it needs those files to be in the directory you just created.

At least I think this is what your problem is about.  :Smile: 

----------

## gedanken

hmm well that dir was missing, so i copied it over.  i did a postfix reload and no effect.  for grins, i did a stop then a start.  i got all kinds of warnings that etc wasnt owned by root - i had chown'd it to postfix.  of course my first concern was why postfix reload hadnt given me the same warnings...

anyways, i chown'd it back to root and did a stop and a start, no effect =(

thanks for trying!  im stumped

----------

## Janne Pikkarainen

How about system logs, do they show any errors related to postfix?

----------

## splooge

This one simple!

You didn't run newaliases!

----------

## nobspangle

 *Janne Pikkarainen wrote:*   

> I think you've been hit by a some obscure thing in Postfix ebuild. I complained about it in bugs.gentoo.org a while ago but haven't heard about it in long time.
> 
> Anyway, create a directory called /var/spool/postfix/etc and copy the following files from your /etc directory to it:
> 
> ```
> ...

 

I don't have a /var/spool/postfix/etc directory and postfix runs fine, this is the case on three boxes I run postfix on.

----------

## gedanken

i had ran newaliases =(

arioch root # newaliases

arioch root # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

(wait for eternity =( )

----------

## splooge

mmm hmm and what does it say in your logs?

----------

## gedanken

i see no postfix specific logs.  i see no postfix entries in any general system logs

----------

## splooge

Run these commands, make sure they return favorable results eg: make sure they don't say (none)

#hostname

#domainname

----------

## gedanken

arioch log # hostname

arioch

arioch log # domainname

edgeoftheworld.com

----------

## Souperman

 *gedanken wrote:*   

> i see no postfix specific logs.  i see no postfix entries in any general system logs

 

/var/log/mail.*

----------

## gedanken

yikes, i had been looking for /var/log/postfix or something in metalog, i just plain missed seeing the mail folder

Jun 11 11:18:03 [postfix/smtpd] fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit

GROAN, i looked in main.cf and saw i had spelled it reject_unath_destination and left out a u.  sigh.

arioch postfix # vi main.cf

arioch postfix # postfix stop

postfix/postfix-script: stopping the Postfix mail system

arioch postfix # postfix start

postfix/postfix-script: starting the Postfix mail system

arioch postfix # telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

220 arioch.edgeoftheworld.com ESMTP Postfix

EHLO

501 Syntax: EHLO hostname

EHLO arioch

250-arioch.edgeoftheworld.com

250-PIPELINING

250-SIZE 10240000

250-VRFY

250-ETRN

250-STARTTLS

250-AUTH LOGIN PLAIN

250-AUTH=LOGIN PLAIN

250 8BITMIME

THANKS!!!

----------

