# Postfix not sending mail

## Novack

Hi,

I have a problem with Postfix when sending mail. PINE gives a "SMTP Greeting failure: 421 SMT Connection went away". All the docs I've read say that sending mail should work automatically after "emerge postfix" and starting the server.

When I try "telnet localhost 25":

```

telnet localhost 25

Trying 127.0.0.1...

Connected to localhost.

Escape character is '^]'.

```

I also have a Mandrake box, where I tried to install Postfix just for testing purposes. It sent the mail fine. When I telnetted port 25 on the Mandrake box it outputted:

```

telnet localhost 25

Trying 127.0.0.1...

Connected to localhost (127.0.0.1).

Escape character is '^]'.

220 novacomp.localdomain ESMTP Postfix (2.0.6) (Mandrake Linux)

500 Error: bad syntax

```

The last error is the result of pressing the enter key after connection opened. The postfix on my gentoo box gives no such error.

----------

## s1th

 *Novack wrote:*   

> Hi,
> 
> I have a problem with Postfix when sending mail. PINE gives a "SMTP Greeting failure: 421 SMT Connection went away". All the docs I've read say that sending mail should work automatically after "emerge postfix" and starting the server.
> 
> When I try "telnet localhost 25":
> ...

 

Since no smtpd banner is proving this is actually the Postfix smtp listener, does a `ps -ef | grep postfix` actually show you Postfix is even running?

How did you configure pine to sent out email?

 *Quote:*   

> 
> 
> I also have a Mandrake box, where I tried to install Postfix just for testing purposes. It sent the mail fine. When I telnetted port 25 on the Mandrake box it outputted:
> 
> ```
> ...

 

What did the logs tell you when you issued a `postfix start` or /etc/init.d/postfix start?

It might help if you run a `postfix check` first before a 'start'.

HTH[/quote]

----------

## kashani

1. Did you you do any sort of configuration to /etc/postfix/main.cf? If not you'll want to add the IP's of the local server to the mynetworks variable. 127.0.0.1 needs to be allowed if nothing else.

2. Run a test from the command line make sure it's a Postfix problems and not the client. I suggest something like this:

echo "Subject: Testing #214" | /usr/sbin/sendmail -F yourusername -f your username test@addresshere.com

kashani

----------

## Novack

The test worked fine and it sent the mail (Postfix check didn't give any errors).

I didn't configure PINE at all (because it worked fine on the Mandrake box without configuring. I checked it's config, they were all "not set" and it worked fine. Postfix on the Mandrake box also works if I configure it to use localhost as it's smtp-server). 

If I configure "localhost" as the smtp-server on my Gentoo box, PINE will timeout when trying to send mail (Connection failed to localhost,25: Connection timed out). If I don't configure anything, it will give the "SMTP Connection went away" error.

----------

## b0fh

I've got the same error here, the test works fine, but pine gives me an error. Did you solve this some way?

----------

## b0fh

I found the error with sending mail and pine: Just add "sendmail-path=/usr/sbin/sendmail -oem -t -oi" to your .pinerc. Now I've got another problem: I'm sending myself a mail, but it doesn't appear in my inbox, it's still in the mail queue (mailq). What to do?

----------

## Novack

I fixed my mail sending problem by doing a symbolic link

/bin/mail -> /usr/sbin/sendmail

It can also be fixed by editing /etc/services.

Find the line:

smtp      25/tcp        mail

and change it to

smtp      25/tcp        sendmail

(This way of fixing, compared to modifying .pinerc, has the nice side effect in that you can use any mail software (like mozilla mail on another computer in your network) by just using your server as the SMTP-server).

This could also fix your problem with the mailboxes.

----------

## fimblo

I just told pine's smtp-server field to localhost. works fine if you have a MTA on your puter.

----------

