Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix not listening on port 25 (solved)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
wheelspin
n00b
n00b


Joined: 28 Jul 2003
Posts: 23
Location: Seacoast NH

PostPosted: Thu Apr 29, 2004 2:04 am    Post subject: Postfix not listening on port 25 (solved) Reply with quote

I set up postfix a while back in order to have a way to collect all my email at home a la the doc in Tips and Tricks. The configuration works fine to send and receive mail, but if I try to connect from another machine on my network to send mail, it looks like there is nothing listening to the SMTP port. Isn't postfix supposed to listen for new connections? How can I set up postfix to work this way? Keep in mind I'm not a Linux whiz and know even less about mail systems, but I don't mind reading. I just can't seem to find either here on these forums or out on google the answer to my question. Maybe I'm asking wrong...

Any help is cool. Thankx.


Last edited by wheelspin on Thu May 06, 2004 11:03 am; edited 1 time in total
Back to top
View user's profile Send private message
TimG
n00b
n00b


Joined: 03 Jun 2003
Posts: 62
Location: Houston, TX

PostPosted: Thu Apr 29, 2004 7:12 am    Post subject: Reply with quote

if you are receiving email from the outside then something is listening on port 25.

This will show you what ports are open
Code:

netstat -ln --protocol=inet



What error does it give you when you try to send mail from the other machine?
Back to top
View user's profile Send private message
Souperman
Guru
Guru


Joined: 14 Jul 2003
Posts: 449
Location: Cape Town, South Africa

PostPosted: Thu Apr 29, 2004 7:26 am    Post subject: Reply with quote

TimG wrote:
if you are receiving email from the outside then something is listening on port 25.

Indeed, except he's collecting it, presumably from an ISP-provided POP3/IMAP account. ;)

Code:
# netstat -lnpt
will show you which processes have listening TCP sockets and which IP(s) are being listened on.
_________________
moo
Back to top
View user's profile Send private message
Jesore
Apprentice
Apprentice


Joined: 17 Jul 2002
Posts: 232
Location: Nürnberg Germany

PostPosted: Thu Apr 29, 2004 8:35 am    Post subject: Reply with quote

Mabe a stupid idea, but do you have a firewall activated on that machine - and if you do, is port 25 open?

Jesore
Back to top
View user's profile Send private message
Souperman
Guru
Guru


Joined: 14 Jul 2003
Posts: 449
Location: Cape Town, South Africa

PostPosted: Thu Apr 29, 2004 10:53 am    Post subject: Reply with quote

Jesore wrote:
Mabe a stupid idea, but do you have a firewall activated on that machine - and if you do, is port 25 open?

Jesore

A firewall wouldn't affect the output of the netstat command. If a program has a port opened, netstat will tell you. Whether or not the port is open on the other side of a firewall is another issue.
_________________
moo
Back to top
View user's profile Send private message
wheelspin
n00b
n00b


Joined: 28 Jul 2003
Posts: 23
Location: Seacoast NH

PostPosted: Wed May 05, 2004 1:19 am    Post subject: More information Reply with quote

Sorry I got pulled away and could't get back to this problem. Busy at work playing Microsoft administrator....

Anyway, the output from the 2 suggested commands reveals that the system is only listening to port 25 on the localhost interface, 127.0.0.1.

I do not as yet have this machine set up with a firewall so that can't be an issue. As Souperman mentioned, I have not configured this system to collect mail from external sources. I simply have fetchmail working and passing the results off to postfix through procmail for delivery.

I am going to spend some time doing some more research to figure out why this is not working the way I think it should, but here's the code in my main.cf

Code:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
mydomain = brucker.com
myorigin = brucker.com
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain
unknown_local_recipient_reject_code = 450
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains = $mydestination
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
home_mailbox = .maildir/
mailbox_command = /usr/bin/procmail -a $DOMAIN
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
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.19/sample
readme_directory = /usr/share/doc/postfix-2.0.11
smtpd_sasl_auth_enable = no
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated, reject
smtpd_use_tls = yes
smtpd_tls_auth_only = no
smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
relayhost=smtp.comcast.net


Not being familiar with mta's in general, I question the inet_interfaces and whether that may be the problem. Anyway, it sure would be nice to use this machine to send email out from my laptop, my desktop or even my Pocket PC.

Thanks for all your help so far.

Bill
Back to top
View user's profile Send private message
Chris W
l33t
l33t


Joined: 25 Jun 2002
Posts: 972
Location: Brisbane, Australia

PostPosted: Wed May 05, 2004 4:50 am    Post subject: Reply with quote

Set inet_interfaces to the IP address of each interface to bind to, or the keyword 'all' to bind all interfaces. For example:
Code:
inet_interfaces = 127.0.0.1
is you current situation, probably because Postfix cannot work out what $myhostname is. What you want is more like:
Code:
inet_interfaces = 127.0.0.1 192.168.0.1
(substituting an appropriate address). You could try explicitly setting:
Code:
myhostname = some.host.domain
while making sure that the name resolves to an IP address.
_________________
Cheers,
Chris W
"Common sense: The collection of prejudices acquired by age 18." -- Einstein
Back to top
View user's profile Send private message
wheelspin
n00b
n00b


Joined: 28 Jul 2003
Posts: 23
Location: Seacoast NH

PostPosted: Wed May 05, 2004 10:59 am    Post subject: Made the change Reply with quote

I changed the setting as Chris W suggested and the system appears to be listening properly on port 25. I'm not sure why the system didn't recognize my hostname, but that is probably another issue. I'll test this when I get home tonight and make sure it actually works.

Thanks all.
Back to top
View user's profile Send private message
wheelspin
n00b
n00b


Joined: 28 Jul 2003
Posts: 23
Location: Seacoast NH

PostPosted: Thu May 06, 2004 11:02 am    Post subject: It works! Reply with quote

The change I made which was to add the actual interface address to the inet_interfaces = line did the trick. Thanks for the help.
Back to top
View user's profile Send private message
BlinkEye
Veteran
Veteran


Joined: 21 Oct 2003
Posts: 1046
Location: Gentoo Forums

PostPosted: Mon May 24, 2004 1:11 pm    Post subject: Reply with quote

Jesore wrote:
Mabe a stupid idea, but do you have a firewall activated on that machine - and if you do, is port 25 open?
Jesore

damn it, you're good. i've been looking for hours why i'm able to send mail from my network do not recieve mail sent to me. this is a really lucky strike, probably i wouldn't have found the solution within days if ever!
_________________
Easily backup up your system? klick
Get rid of SSH Brute Force Attempts / Script Kiddies klick
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum