# Postfix / Recieving Mail

## decker in flux

Hello -- I have been battling with postfix for the past week, scouring forums etc.  No matter what i have done / tried i CANNOT manage to get mail from the outside ( for example a yahoo.com account ).  

I have an A RECORD setup to point to the machine ( i.e. it resolves correctly ).

Postfix is listening for incoming:

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      9807/master

And local mail sending and recieving works ( i.e. anything sent from some local user to another local user works, and also outgoing mail works fine ).....

HELP!

Any input is much appreciated.

-d  :Sad: 

----------

## MoonWalker

To start with, post your '# postconf -n' result, it's it's impossible to figure out something without facts. I'm in troble myself with postfix setting up a new box, but maybe our joint forces and experiences can bring success  :Smile: 

----------

## guero61

http://www.gentoo.org/doc/en/desktop.xml

Section six.

----------

## decker in flux

 *guero61 wrote:*   

> http://www.gentoo.org/doc/en/desktop.xml
> 
> Section six.

 

I followed the desktop guide.   :Confused: 

The state of the email system is as follows:

1) Can send mail to any destination

2) Can recieve mail only from other local users

3) smtp is listening on 0.0.0.0:25 ( i.e. any )

why is mail coming from yahoo.com ( for eg ) not coming through?  My inet_destination's, and everything else i can find documented anywhere is set correctly.  

What could i be missing?  What could i post to clarify the situation.

-d

----------

## guero61

I don't know.  Here's my /etc/postfix/main.cf; see what ou can make of it.  (output from "cat /etc/postfix/main.cf | grep -v ^# | sort"

```

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

debugger_command =

default_destination_concurrency_limit = 10

home_mailbox = .maildir/

inet_interfaces = all

local_destination_concurrency_limit = 2

local_recipient_maps = unix:passwd.byname $alias_maps

mail_owner = postfix

mail_spool_directory = /var/spool/mail

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, $mydomain,

mydomain = mydomain.dyndns.org

myhostname = mydomain.dyndns.org

mynetworks = 192.168.0.0/29, 127.0.0.0/8

myorigin = $myhostname

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.0.3

sample_directory = /etc/postfix/sample

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

soft_bounce = no

unknown_local_recipient_reject_code = 550

```

Last edited by guero61 on Sun May 04, 2003 9:54 pm; edited 1 time in total

----------

## Xor

if you have trouble getting mail from the outside world to your domain, you might want to consider adding an MX entry to you domain pointing to the right mta, anyway - the sending and possibly the receiving host will have some entries in the mail.log....

----------

## acidreign

Step 1.

Check that your the server that you have setup has an MX (Mail exchanger) setup in the correct DNS server.

For example, I run subverted.net, in my bind (DNS) configuration files i have to set the MX to point to my mail server.  Otherwise mail wont work.

For a quick and easy test, you can do this with an no-ip.com domain.  Just setup your domain, setup the bind server on the server that hosts the no-ip.com domain, and set this to point to your mail server (even if it is the same box).

The documentation that will help you with this is.

DNS and Bind by Orielly (Great book)

http://www.crazysquirrel.com/linux/dns.php ( The info is there, he isnt very clear)

http://www.menandmice.com/9000/9100_dns_related_links.html (link fest)

As usual, if this isnt your problem, this entire post has been in waste, but it woulnt be the first time.

If this isnt the case, i'd work on checking that your isp doesnt block port 25 in (Yes, ISP's commonly do this), and secondly that the box functions as expected for other services such as http or ftp.

----------

## decker in flux

I have verified that my port 25 is not being blocked by the ISP, i.e. i can telnet into 25 from the outside.  

That is -- i see two possible problems... 

1)  My postfix is not actually picking up the mail that comes in -- but then again inet_interfaces = all, and mydestination = $myhostname

2)  The external mailers are having problems contacting the server -- i.e. cannot resolve the server , but the A Record is setup correctly, and in absence of an MX record should be used to direct the mail...

i would rather not have to setup an MX record as it would confuse my mail setup beyond belief...

-d

----------

## decker in flux

Here is a more thorough follow up to previous posts:

my postfix config

```
root@analog decker # postconf -n

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 10

home_mailbox = .maildir/

inet_interfaces = all

local_destination_concurrency_limit = 4

local_recipient_maps =

mail_owner = postfix

mailq_path = /usr/bin/mailq

manpage_directory = /usr/share/man

mydestination = $myhostname, localhost.$mydomain, $mydomain

myhostname = analog.dotdark.com

newaliases_path = /usr/bin/newaliases

queue_directory = /var/spool/postfix

readme_directory = /usr/share/doc/postfix-2.0.9

sample_directory = /etc/postfix/sample

sendmail_path = /usr/sbin/sendmail

setgid_group = postdrop

unknown_local_recipient_reject_code = 450

```

Here is the dig of the DNS

```
root@analog decker # dig analog.dotdark.com

 

; <<>> DiG 9.2.2rc1 <<>> analog.dotdark.com

;; global options:  printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44451

;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

 

;; QUESTION SECTION:

;analog.dotdark.com.            IN      A

 

;; ANSWER SECTION:

analog.dotdark.com.     3592    IN      A       209.129.116.102

 

;; Query time: 1 msec

;; SERVER: 209.129.114.2#53(209.129.114.2)

;; WHEN: Wed May  7 09:35:56 2003

;; MSG SIZE  rcvd: 52

```

A snip from netstat:

```
root@analog decker # netstat -lpn | grep master

tcp        0      0 0.0.0.0:25              0.0.0.0:*               LISTEN      9807/master

```

And here is a snip from the bounce back sent by MAILER-DAEMON@yahoo.com 

```
Message from  yahoo.com.

Unable to deliver message to the following address(es).

<decker@analog.dotdark.com>:

Sorry, I wasn't able to establish an SMTP connection. (#4.4.1)

I'm not going to try again; this message has been in the queue too 

long.
```

Sooooooooo...... any help is appreciated.

-d

----------

## TrippyZ

I cannot connect to your port 25.  A scan reveals that I can connect to 21,22 & 80.

----------

## decker in flux

 *TrippyZ wrote:*   

> I cannot connect to your port 25.  A scan reveals that I can connect to 21,22 & 80.

 

thx.  turns out that the IT dept setup a butchered firewall with some criminally insane rules.  Apparently every machine i have access to is permitted -- just not *ALL* ... those bastards.

thx everyone for their help.

-d

----------

