Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 14th February 2008, 19:28
veremchook veremchook is offline
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Postfix email server config

I've recently set up a dedicated postfix server on fc8. When I send an email to one of my xxx domain accounts I get the following:

Final-Recipient: rfc822; adam@xxx.co.uk
Action: failed
Status: 4.0.0
Diagnostic-Code: X-INTERIA-PL; connect to xxx.co.uk[XXX.XXX.XXX.XXX]:
Connection refused


The domain name and ip address are correct, so I don't think it's a dns issue.

My main.cf file (uncommented lines only, most of them are dafault values):

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
myhostname = xxx
(xxx it's the LAN machine name)
mydomain = xxx.co.uk
myorigin = xxx.co.uk
inet_interfaces = localhost
mydestination = $myhostname, localhost.$mydomain, localhost, $myhostname.$mydomain, /etc/postfix/mydestination
unknown_local_recipient_reject_code = 550
mynetworks_style = subnet
relay_domains = $mydestination
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
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
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.4.5/samples
readme_directory = /usr/share/doc/postfix-2.4.5/README_FILES


Some additional info:

[root@xxx ~]# cat /etc/passwd | grep adam
adam:x:500:500::/home/adam:/sbin/nologin

[root@xxx ~]# chkconfig --list | grep postfix
postfix 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@xxx ~]# ps aux | grep postfix
root 1469 0.0 0.3 6940 1796 ? Ss Feb08 0:00 /usr/libexec/postfix/master
postfix 1476 0.0 0.3 7064 1836 ? S Feb08 0:00 qmgr -l -t fifo -u
postfix 19091 0.0 0.3 7004 1776 ? S 17:05 0:00 pickup -l -t fifo -u
root 19113 0.0 0.1 4048 680 pts/0 S+ 17:14 0:00 grep postfix


The port forwarding on our gateway also seems to be fine. I'm using SpeedTouch 5x6 "Game & Application Sharing" tool.
hits on port 110 (pop3) are set to be redirected to xxx:110
hits on port 25 (smtp) are set to be redirected to xxx:25

Please help and advise where to dig to solve my problem and start some basic email exchange on my server.
Cheers
Adam
Reply With Quote
Sponsored Links
  #2  
Old 14th February 2008, 19:43
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

The issue is connections are not being allowed to port 25 on your server.

To verify test it from a different location
Code:
nc your_server_ip 25
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #3  
Old 15th February 2008, 17:05
veremchook veremchook is offline
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, I tried the following:

[root@xxx ~]# nc -v my_gateway_ip 110
nc: connect to my_gateway_ip port 110 (tcp) failed: Connection refused
[root@xxx ~]# nc -v my_gateway_ip 25
nc: connect to my_gateway_ip port 25 (tcp) failed: Connection refused


In the same time in my gateway logs I get the following:

00:40:49 (since last boot) FIREWALL rule (1 of 1) : Protocol: TCP Src ip: some_external_ip Src port: 51090 Dst ip: postfix_server_internal_ip Dst port: 110 Chain: forward_host_service Rule Id: 11 Action: accept

00:40:51 (since last boot) FIREWALL rule (1 of 4) : Protocol: TCP Src ip: some_external_ip Src port: 44892 Dst ip: postfix_server_internal_ip Dst port: 25 Chain: forward_host_service Rule Id: 12 Action: accept


I even tried to disable the firewall completely with the sam nc response (Connection refused)
Any suggestions?
Reply With Quote
  #4  
Old 15th February 2008, 17:08
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

Something is wrong with your port forwarding, you need to use tcpdump to debug it.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #5  
Old 15th February 2008, 17:31
veremchook veremchook is offline
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To me it looks like packets go through:

[root@xxx ~]# tcpdump | grep some_external_ip

15:21:21.365433 IP some_external_ip.37849 > postfix_server_internal_ip.pop3: S 3011648941:3011648941(0) win 5840 <mss 1452,sackOK,timestamp 450822963 0,nop,wscale 6>

15:21:26.058233 IP some_external_ip.42605 > postfix_server_internal_ip.smtp: S 3092138727:3092138727(0) win 5840 <mss 1452,sackOK,timestamp 450823431 0,nop,wscale 6>
Reply With Quote
  #6  
Old 15th February 2008, 17:39
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

Quote:
Originally Posted by veremchook
To me it looks like packets go through:

[root@xxx ~]# tcpdump | grep some_external_ip

15:21:21.365433 IP some_external_ip.37849 > postfix_server_internal_ip.pop3: S 3011648941:3011648941(0) win 5840 <mss 1452,sackOK,timestamp 450822963 0,nop,wscale 6>

15:21:26.058233 IP some_external_ip.42605 > postfix_server_internal_ip.smtp: S 3092138727:3092138727(0) win 5840 <mss 1452,sackOK,timestamp 450823431 0,nop,wscale 6>
Yes packets are going in but the response is not coming back.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #7  
Old 15th February 2008, 17:49
veremchook veremchook is offline
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

So there is something wrong with my postfix config if it doesn't respond, right?
Can you spot the culprit reading my first post?
Reply With Quote
  #8  
Old 15th February 2008, 18:46
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
Default

Quote:
Originally Posted by veremchook
So there is something wrong with my postfix config if it doesn't respond, right?
Can you spot the culprit reading my first post?
This is not a postfix problem its an issue with your networking.

On the server it self check try this
Code:
nc 127.0.0.1 25
It should respond with the banner.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
  #9  
Old 15th February 2008, 19:09
veremchook veremchook is offline
Junior Member
 
Join Date: Feb 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Results:

[root@xxx ~]# nc -v 127.0.0.1 25
Connection to 127.0.0.1 25 port [tcp/smtp] succeeded!
220 xxx ESMTP Postfix
421 4.4.2 xxx Error: timeout exceeded
Reply With Quote
  #10  
Old 15th February 2008, 19:11
topdog topdog is offline
Senior Member
 
Join Date: Jan 2008
Location: South Africa
Posts: 1,352
Thanks: 0
Thanked 153 Times in 150 Posts
 
Default

Quote:
Originally Posted by veremchook
Results:

[root@xxx ~]# nc -v 127.0.0.1 25
Connection to 127.0.0.1 25 port [tcp/smtp] succeeded!
220 xxx ESMTP Postfix
421 4.4.2 xxx Error: timeout exceeded
Yap like a said the problem is not a postfix problem it is a networking problem to do with either your routing, port forwarding or firewalling.
__________________
----
http://www.topdog.za.net - Got Linux problems ? - I can help.
http://www.baruwa.org - Try it.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php Apps email not going through palkat General 8 21st September 2011 06:35
postfix bounced email question daveb Server Operation 8 3rd February 2008 21:32
mail delivered in mbox patfee Installation/Configuration 8 11th December 2007 14:58
how to configure postfix to send email out for a hosted domain nox171 Server Operation 24 13th July 2007 12:48
Occasional high load on the server. kanour General 5 21st November 2006 12:27


All times are GMT +2. The time now is 07:12.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.