Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am attempting to configure an openSuse 11.1 box to send outgoing email for a domain that the same server is hosting. I don't understand enough about smtp servers and the like to know what needs to be in place and working.

The system already had Postfix installed, and I confirmed it was running via a

> sudo /etc/init.d/postfix status

I examined the Postfix config file in /etc/ and configured a couple of items regarding the domain/host name and such, but left it largely default.

I attempted to send an email from the command line with the following command:

> echo "test 123" | mail -s "test subject"

Where was not the same domain as the one best hosted on the server. However, the email never reaches the target account.

Any suggestions?


In the postfix log, (/var/log/, there's nothing in .err) I see that postfix is trying to connect to what appears to be a different smtp server on our network, with a connection refused:

connect to[our ip address]:25: Connection refused

However, I can't figure out why it is 1) trying to connect to that server and 2) not just sending the messages itself... I mean, isn't postfix an smtp server?

I did a grep -ri on ourdomain from /etc and see no configuration files anywhere telling it to do this. Why is it?

share|improve this question
How about some postconf -n output, along with more log lines? – Bill Weiss Sep 16 '10 at 19:25

I found this link helpful when configuring Postfix:

The "postconf -n" tip was particularly useful in uncovering items configured, then reconfigured later in

share|improve this answer

Start with /var/log/mail as Postfix will log pretty much everything.

share|improve this answer
updated the question with a log msg – Matt Sep 16 '10 at 18:48

It looks like Postfix is looking up the MX record for, which is, and attempting to connect to port 25 of that mail server to send out the email. Does your ISP allow outgoing connections to port 25? Do you have outbound connections to Port 25 blocked in a firewall?

share|improve this answer
If resolves to your IP address, maybe the problem is with your DNS? – lladnar Sep 16 '10 at 21:03

Whenever I come across a problem like this (which could seemingly be caused by dns, postfix, command clients, etc)-- the first thing I try to do is eliminate possibilities. In your example, I would start by eliminating postfix issues by two things:

1) grep for various parts of the servername that is being connected to (using the examples from your log file and email attempts):

grep /etc/postfix/*
grep /etc/postfix/*
grep /etc/postfix/*

2) test outgoing email delivery with more than one example. If trying to send to a google, yahoo, and address all result in attempts to delivery to the address, I would suspect any of the following: - You have a smarthost configured and it's just not reachable - Something in the configuration is telling postgres to always append "" to every outgoing email address

Take a look at the output of 'mailq' -- are the email addresses it's trying to deliver to what you expected?

share|improve this answer

Your outgoing messages aren't going through postfix at all when you send by the command line. To answer the question in the subject - you don't need very much in place to send messages from a linux box. You don't need Postfix just to send mail.

The mail programme will try and send directly to the smtp server listed in the MX record for the domain you send to. Mind you - that smtp server might not allow you to send directly to it in this way. As llandar says your firewall may be blocking the outgoing traffic. You need to check your (probably) iptables setup by running

iptables -vnL

That will list your active firewall rules (if you are running iptables) including open ports.

Then I guess what you are really trying to do is test whether your postfix setup is working - you need to try and make a manual smtp connection to it. I wrote about this in answer to another question. The output of that, and the contents of the logfile Hutch mentioned (may also be called /var/log/maillog) will help you understand the health of your Postfix config.

I strongly recommend The Book of Postfix if you will be working with postfix a lot. A great manual which steps you through all the aspects of configuration in lots of scenarios, and gives you a good understanding of how mail servers work.

share|improve this answer

Go to and have your IP address de-listed. Domains that use for mail routing are protected by a firewall.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.