Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Postfix newbie can't get outside LAN

Status
Not open for further replies.

pavNell

Technical User
Sep 27, 2002
178
US
Hello,

I want to send an email message to my_work.com from my linux box at home using mailx. That's it. Only outbound mail too. I have a static IP and a domain name. I have postfix installed and running but I can't seem to send anything outside of my LAN. I'm guessing that some of the variables inside main.cf aren't set correctly and that's because I'm a dolt and I don't understand. Any sample config file settings to get outside of my lan???

My firewall allows outbound connections on all ports too.
Thanks.
 
DNS problems? Your postfix box must be able to talk to a DNS server that can return the MX record for my_work.com. If you do:

dig my_work.com MX

Do you get a valid responce?


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Hands working faster than the brain. Hit the submit before reading through.

Just to clarify, you need to run the dig command on your postfix server.


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
I ran
htdig my_work.com
and got nothing.

I have my isp's nameservers listed in /etc/resolve.conf if it's worth anything.

I can't htdig anything. I had to install htdig too. Perhaps there's a conf file for it?
 
O.k. I have dig working now. And I'm able to htdig the my_work.com site. Anything else?
 
dig & htdig (aka ht://dig) are 2 different pieces of software. dig is provided by the bind-utils package. Below is what I get when I query redhat.com for their MX record.

[zeland@ws18 ~]$ dig redhat.com MX

; <<>> DiG 9.3.1 <<>> redhat.com MX
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52941
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 13, ADDITIONAL: 11

;; QUESTION SECTION:
;redhat.com. IN MX

;; ANSWER SECTION:
redhat.com. 80 IN MX 10 mx1.redhat.com.
redhat.com. 80 IN MX 10 mx3.redhat.com.
redhat.com. 80 IN MX 20 mx2.redhat.com.

;; AUTHORITY SECTION:
com. 81290 IN NS i.gtld-servers.net.
com. 81290 IN NS j.gtld-servers.net.
com. 81290 IN NS k.gtld-servers.net.
com. 81290 IN NS l.gtld-servers.net.
com. 81290 IN NS m.gtld-servers.net.
com. 81290 IN NS a.gtld-servers.net.
com. 81290 IN NS b.gtld-servers.net.
com. 81290 IN NS c.gtld-servers.net.
com. 81290 IN NS d.gtld-servers.net.
com. 81290 IN NS e.gtld-servers.net.
com. 81290 IN NS f.gtld-servers.net.
com. 81290 IN NS g.gtld-servers.net.
com. 81290 IN NS h.gtld-servers.net.

;; ADDITIONAL SECTION:
mx1.redhat.com. 80 IN A 66.187.233.31
mx3.redhat.com. 80 IN A 66.187.233.32
mx2.redhat.com. 80 IN A 66.187.237.31
a.gtld-servers.net. 163735 IN A 192.5.6.30
a.gtld-servers.net. 163734 IN AAAA 2001:503:a83e::2:30
b.gtld-servers.net. 163774 IN A 192.33.14.30
b.gtld-servers.net. 165764 IN AAAA 2001:503:231d::2:30
c.gtld-servers.net. 162040 IN A 192.26.92.30
d.gtld-servers.net. 163735 IN A 192.31.80.30
e.gtld-servers.net. 163735 IN A 192.12.94.30
f.gtld-servers.net. 157418 IN A 192.35.51.30

;; Query time: 240 msec
;; SERVER: 192.168.0.4#53(192.168.0.4)
;; WHEN: Wed Dec 7 11:08:05 2005
;; MSG SIZE rcvd: 512


Take note of the line:

;; SERVER: 192.168.0.4#53(192.168.0.4)

This is telling me that my dig query was sent to 192.168.0.4 (my internal DNS).


--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
Ok.
apt-get remove htdig
apt-get install bind-utils

Now,
dig company.com MX
returns info and the line:

;; SERVER: 207.158.92.18#53(207.158.92.18)

which is my isp's dns server
 
Alright, looks like we're getting somewhere. In the returned result, does your mail server show up in the answer section? Going back to the RedHat example, you should see at least 1 MX record. In RedHats's case, they have 3.

;; ANSWER SECTION:
redhat.com. 80 IN MX 10 mx1.redhat.com.
redhat.com. 80 IN MX 10 mx3.redhat.com.
redhat.com. 80 IN MX 20 mx2.redhat.com.



--== Anything can go wrong. It's just a matter of how far wrong it will go till people think its right. ==--
 
If it helps, here's all uncommented lines in my main.cf....


queue_directory = /var/spool/postfix

command_directory = /usr/sbin

daemon_directory = /usr/lib/postfix

mail_owner = postfix

myhostname = myhost.blah.com

mydomain = blah.com

myorigin = $mydomain

inet_interfaces = all

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

unknown_local_recipient_reject_code = 550

mynetworks_style = host

relay_domains = $mydestination

relayhost = smtp.my_isp.net

relay_recipient_maps = hash:/etc/postfix/relay_recipients

alias_maps = hash:/etc/aliases

smtpd_banner = $myhostname ESMTP

debug_peer_level = 2

debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

delay_warning_time = 4

sendmail_path = /usr/sbin/sendmail.postfix

newaliases_path = /usr/bin/newaliases.postfix

mailq_path = /usr/bin/mailq.postfix

setgid_group = postdrop

html_directory = /usr/share/doc/postfix-2.1.5/html

manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.1.5/samples

readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES



Also, I'm sitting behind a linksys router too.
 
O.k.

just so we're on the same page, doing a:
dig the_company_I_want_to_email_to.com MX

returns two lines under the ;;ANSWER section. And doing a:

dig mydomain_name.com MX
does not return anything for ;;ANSWER

 
I found a better tool for what I'm trying to accomplish.
Using mail with msmtp.

Does just what I was needing to do and not having to setup a server.

I appreciate your help with this though. Thanks.

m.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top