# my postfix can only send email, but cannot receive email

## bluephoenix

I just installed postfix on my server with dovecot.

I can send email to outside, such as gmail.

I try to send an email from gmail to my server but failed.

The feedback from the gmail is:

This is an automatically generated Delivery Status Notification

THIS IS A WARNING MESSAGE ONLY.

YOU DO NOT NEED TO RESEND YOUR MESSAGE.

Delivery to the following recipient has been delayed:

     yw@fhhome.net

Message will be retried for 1 more day(s)

Technical details of temporary failure: 

The recipient server did not accept our requests to connect. Learn more at http://support.google.com/mail/bin/answer.py?answer=7720

[(1) www.fhhome.net. [180.77.20.134]:25: Connection timed out]

----- Original message -----

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;

        d=gmail.com; s=20120113;

        h=x-received:message-id:date:from:user-agent:mime-version:to:subject

         :content-type:content-transfer-encoding;

        bh=X28T/JEIBzh1UWAAYSKgzJljFrPSeZVNQCcsz6KTla0=;

        b=OqHuVdFFLiSSs+WE9yACcUS8brbxvs4dqh7i3uOuLO8g+dUIgx5tVHhZO5tHFN5lGS

         J4rH/NJxMwYPV08G1WjQYA4BqQHs2wfHB+D2sQwpmIT0YzOHDkIUVX5cDMIyknE/EakJ

         dVWYYczknBdtpcZKZyNwTYFZ6PJV/hWwwWtl15+SNZnVnaXIT5GQ2Sm+12/IOZvHEmI2

         C+AakLXhJneQ7piu2QQLdHrkkGNtVs8WBjc+HXMDtb2zvcEK9fj21fs7ogY45zxuFxw9

         wa3kidLSV5mIJL7qMufoy8YJCIjMpdBupnGv6jbXM3KTbpG6UpOKJyafPa/Jgv37GKPV

         wSlQ==

X-Received: by 10.66.85.103 with SMTP id g7mr23221702paz.45.1358511809584;

        Fri, 18 Jan 2013 04:23:29 -0800 (PST)

Return-Path: <nobrainnohappy@gmail.com>

Received: from [192.168.0.101] ([110.232.37.70])

        by mx.google.com with ESMTPS id e6sm3357909paw.16.2013.01.18.04.23.26

        (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128);

        Fri, 18 Jan 2013 04:23:28 -0800 (PST)

Message-ID: <50F93F11.40808@gmail.com>

Date: Fri, 18 Jan 2013 20:24:49 +0800

From: Urbain <nobrainnohappy@gmail.com>

User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.11) Gecko/20130104 Thunderbird/10.0.11

MIME-Version: 1.0

To: yw@fhhome.net

Subject: test from google + thunderbird

Content-Type: text/plain; charset=ISO-8859-1

Content-Transfer-Encoding: 7bit

test from google + thunderbird

I worry about it is because I am behind NAT, but it seems that my webserver based on nginx is OK. I also set the MX record in my domain service provider. So now I really don't know why I cannot receive email from my postfix

----------

## VinzC

You need to forward port 25 to your mail server's IP. Also note in general you'll need a SPF (Sender Policy Framework) record to mark your mail server legitimate and prevent it from being denied sending mail. You'll also need to ask your ISP to add a reverse DNS record (i.e. a PTR record) with an IP that points back to mail.fhhome.net . You need that because some mail servers use that information to decide whether to blacklist illegitimate mail servers. Also note that an MX server name may not be an alias.

Just ask back if you need more information.

----------

## cach0rr0

(Moved from "Installing Gentoo" to "Networking & Security")

some ISP's will block inbound access to port 25 for their residential customers' IP address space

if your postfix is indeed already listening on 25:

```

netstat -tlnp

```

AND, you have already set up port forwarding on your router...

Then that would appear to be your problem. 

I just tried connecting from my mail server, to your mail server, on port 25, and was not able:

```

# nmap -sT -p25 -P0 -vv mail.fhhome.net

Starting Nmap 6.01 ( http://nmap.org ) at 2013-01-31 01:39 CST

Initiating Parallel DNS resolution of 1 host. at 01:39

Completed Parallel DNS resolution of 1 host. at 01:39, 0.05s elapsed

Initiating Connect Scan at 01:39

Scanning mail.fhhome.net (180.77.20.134) [1 port]

Completed Connect Scan at 01:39, 2.00s elapsed (1 total ports)

Nmap scan report for mail.fhhome.net (180.77.20.134)

Host is up.

Scanned at 2013-01-31 01:39:20 CST for 2s

PORT   STATE    SERVICE

25/tcp filtered smtp

Read data files from: /usr/bin/../share/nmap

Nmap done: 1 IP address (1 host up) scanned in 2.14 seconds

```

So either your ISP, or, your router, or, your server's iptables, are blocking inbound port 25 traffic

*if it's your ISP, there is nothing you can do except for ask them to unblock port 25

*if it's your router, you will have to enable port forwarding for 25, same as youve done for nginx on port 80

*if it's your server's iptables, a basic iptables -I INPUT -p tcp --dport 25 -j ACCEPT should do the job

----------

## JC99

Try running this command...

```
/usr/bin/newaliases
```

I remember my postfix installation didn't work until I did that.

----------

