LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2011, 11:28 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Rep: Reputation: 35
Postfix / Telnet reports a connection timeout


Hi all, I have been asked open a new thread on this so here goes.

Im trying to configure postfix to send and receive emails but am getting a connection timeout error.

Code:
Jan 18 18:09:17 homeserver postfix/smtp[21228]: B2090DA20F: to=<root@mymail.com>, orig_to=<root>, relay=none, delay=555, delays=525/0.1/30/0, dsn=4.4.1, status=deferred (connect to smtp.mymail.com[xx.xx.xx.xx]:25: Connection timed out)
Jan 18 18:09:17 homeserver postfix/smtp[21228]: flush_add: site mymail.com id B2090DA20F
Jan 18 18:09:17 homeserver postfix/smtp[21228]: match_hostname: mymail.com ~? mail.mymail.com
Jan 18 18:09:17 homeserver postfix/smtp[21228]: match_hostname: mymail.com ~? localhost.mymail.com
Jan 18 18:09:17 homeserver postfix/smtp[21228]: match_list_match: mymail.com: no match
Jan 18 18:09:17 homeserver postfix/smtp[21228]: flush_add: site mymail.com id B2090DA20F status 4
Jan 18 18:09:17 homeserver postfix/smtp[21228]: deliver_request_final: send: "connect to smtp.mymail.com[xx.xx.xx.xx]:25: Connection timed out" -1

Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr status = 4.4.1
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr diag_type = 
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr diag_text = 
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr mta_type = 
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr mta_mname = 
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr action = 
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr reason = connect to smtp.mymail.com[xx.xx.xxx.xx]:25: Connection timed out
Jan 18 18:09:17  homeserver postfix/smtp[21228]: send attr status = 4294967295
Jan 18 18:09:17  homeserver postfix/smtp[21228]: master_notify: status 1
Jan 18 18:09:17  homeserver postfix/smtp[21228]: connection closed
NB: The "xx.xx.xx.xx" is my static WAN IP address. Not a local LAN IP


I can telnet inside my LAN network and I get the following:

Code:
# telnet smtp.mymail.com 25
Trying 127.0.0.1...
Connected to mail.mymail.com.
Escape character is '^]'.
220 mail.mymail.com ESMTP Postfix (Ubuntu)
ehlo mail.mymail.com
250-mail.mymail.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
I can telnet outside (WAN) and I get the following when I enter my static IP and port 25:

Code:
# telnet xx.xx.xxx.xx 25
Trying xx.xx.xxx.xx                                                                         ...
Connected to mail.mymail.com.
Escape character is '^]'.
220 mail.mymail.com ESMTP Postfix (Ubuntu)
ehlo mail.mymail.com
250-mail.mymail.com
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
This is my setup in my /etc/hosts file (which im not 100% convinced is correct but I will wait if anyone sees anything bad):

Code:
127.0.0.1 mail.mymail.com localhost.localdomain localhost
192.168.1.4 myfirstdomain.net www.myfirstdomain.net
192.168.1.7 mymail.com mail.mymail.com smtp.mymail.com
As you can see I have 2 domains hosted on 1 server. "myfirstdomain.net" is for things like FTP/SSH and so on and is port forwarded via my router to the 192.168.1.4 address. This works well.
The new domain I have now is also port forwarded but strictly to a virtual NIC I have setup under the 192.168.1.7 address. This seems to be happy and has now logged any errors so I am ruling it out (hopefully).

And here is snippet of my main.cf

Code:
myhostname = mail.mymail.com
mydomain = mymail.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname
relay_domain = $mydomain
relayhost = smtp.mymail.com
mynetworks = 192.168.1.7
mailbox_size_limit = 0
debug_peer_level = 6
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/
mailbox_command =
Any help would be very appreciated.

Thanks
 
Old 01-19-2011, 12:38 PM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,774
Blog Entries: 1

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
can you

Code:
telnet 192.168.1.7 25
succesfully?
 
Old 01-19-2011, 12:56 PM   #3
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
Code:
#telnet 192.168.1.7 25
Trying 192.168.1.7...
Connected to 192.168.1.7.
Escape character is '^]'.
220 mymail.com ESMTP Postfix (Ubuntu)
ehlo 192.168.1.7   
250-mymail.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
Looks ok to me?

I can send emails inside the LAN now.

I changed the following:

Code:
myhostname = mail.mymail.com
mydomain = mymail.com
To look like:
Code:
myhostname = mymail.com
mydomain = mymail.com
And when I set up a simple loop on the Maildir dir I can see test mails coming in one-by-one.

I just cant send mail out and the Mail.log file is reporting lots of "Connection timeouts".

Thanks
 
Old 01-19-2011, 01:29 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Try to sent mail to an external address.(hotmail or gmail or...)
Try to sent mail from an external computer to your domain.

Kind regards
 
Old 01-19-2011, 02:14 PM   #5
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
Tried and still the same

Can only send and receive via LAN not external
 
Old 01-19-2011, 02:15 PM   #6
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
error messages?

Kind regards
 
Old 01-19-2011, 05:15 PM   #7
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
The story so far....

I can do the following:
Code:
via telnet - Send an email from user1 to user2 over the local network
via webmail - Send an email to user1 and receive it via Postfix into a Maildir from an external WAN connection
I cannot do the following:
Code:
via telnet - Send an email from user1 to a ukonline email account
via telnet - Send an email from user1 to a gmail email account

Here is the partial log output when trying to send to a ukonline email account:
Code:
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: connect to subsystem public/cleanup
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: public/cleanup socket: wanted attribute: queue_id
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: input attribute name: queue_id
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: input attribute value: 912ADDA163
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: public/cleanup socket: wanted attribute: (list terminator)
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: input attribute name: (end)
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: send attr flags = 178
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: 912ADDA163: client=mymail.com[192.168.1.7]
Jan 19 22:03:38 homeserver postfix/smtpd[15127]: > mymail.com[192.168.1.7]: 250 2.1.5 Ok
Jan 19 22:03:40 homeserver postfix/smtpd[15127]: < mymail.com[192.168.1.7]: data
Jan 19 22:03:40 homeserver postfix/smtpd[15127]: > mymail.com[192.168.1.7]: 354 End data with <CR><LF>.<CR><LF>
Jan 19 22:03:55 homeserver postfix/cleanup[15205]: 912ADDA163: message-id=<20110119220338.912ADDA163@mymail.com>
Jan 19 22:03:55 homeserver postfix/qmgr[14368]: 912ADDA163: from=<burt@mymail.com>, size=378, nrcpt=1 (queue active)
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: public/cleanup socket: wanted attribute: status
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: input attribute name: status
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: input attribute value: 0
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: public/cleanup socket: wanted attribute: reason
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: input attribute name: reason
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: input attribute value: (end)
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: public/cleanup socket: wanted attribute: (list terminator)
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: input attribute name: (end)
Jan 19 22:03:55 homeserver postfix/smtpd[15127]: > mymail.com[192.168.1.7]: 250 2.0.0 Ok: queued as 912ADDA163
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: < mymail.com[192.168.1.7]: quit
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: > mymail.com[192.168.1.7]: 221 2.0.0 Bye
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: match_hostname: mymail.com ~? 192.168.1.7
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: match_hostaddr: 192.168.1.7 ~? 192.168.1.7
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: disconnect from mymail.com[192.168.1.7]
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: master_notify: status 1
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: connection closed
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: proxymap stream disconnect
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: auto_clnt_close: disconnect private/tlsmgr stream
Jan 19 22:03:57 homeserver postfix/smtpd[15127]: rewrite stream disconnect
Jan 19 22:03:57 homeserver postfix/pickup[14366]: F08F4DA172: uid=5001 from=<burt@mymail.com>
Jan 19 22:03:57 homeserver postfix/cleanup[15205]: F08F4DA172: message-id=<20110119220338.912ADDA163@mymail.com>
Jan 19 22:03:57 homeserver postfix/pipe[15258]: 912ADDA163: to=<bobthebuilder@ukonline.co.uk>, relay=spamassassin, delay=27, delays=24/0.01/0/2.6, dsn=2.0.0, status=sent (delivered via spamassassin service)
Jan 19 22:03:57 homeserver postfix/qmgr[14368]: 912ADDA163: removed
Jan 19 22:03:57 homeserver postfix/qmgr[14368]: F08F4DA172: from=<burt@mymail.com>, size=680, nrcpt=1 (queue active)
Jan 19 22:03:58 homeserver postfix/error[15272]: F08F4DA172: to=<bobthebuilder@ukonline.co.uk>, relay=none, delay=0.03, delays=0.02/0.01/0/0, dsn=4.4.1, status=deferred (delivery temporarily suspended: connect to smtp.mymail.com[xx.xx.xxx.xx]:25: Connection timed out)
What do you think???

Last edited by fusion1275; 01-19-2011 at 05:16 PM.
 
Old 01-19-2011, 06:21 PM   #8
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
Update....

I have been testing out the telnet again and found the following:

If I telnet mymail.com 25 - This works and I get "OK" when using a rcpt address of gmail
If I telnet smtp.mymail.com 25 - This works and I get "OK" when using a rcpt address of gmail
If I telnet mail.mymail.com 25 - This fails on when entering the rcpt address of gmail
If I telnet 127.0.0.1 25 - This fails on when entering the rcpt address of gmail

Code:
# telnet mail.mymail.com 25
Trying 127.0.0.1...
Connected to mail.mymail.com.
Escape character is '^]'.
220 mymail.com ESMTP Postfix (Ubuntu)
ehlo mail.mymail.com
250-mymail.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from: bobthebuilder@mymail.com
250 2.1.0 Ok
rcpt to: donkey@gmail.com
554 5.7.1 <donkey@gmail.com>: Relay access denied
rcpt to: shrek@ukonline.co.uk
554 5.7.1 <shrek@ukonline.co.uk>: Relay access denied
rcpt to: granny@mymail.com
250 2.1.5 Ok
So heres a snippet of the logs. The top part is a couple of lines when I tested the gmail. The next load of lines are the ukonline information.
Code:
Jan 19 23:00:15 homeserver postfix/smtpd[25659]: NOQUEUE: reject: RCPT from mail.mymail.com[127.0.0.1]: 554 5.7.1 <donkey@gmail.com>: Relay access denied; from=<bobthebuilder@mymail.com> to=<donkey@gmail.com> proto=ESMTP helo=<mail.mymail.com>
Jan 19 23:00:15 homeserver postfix/smtpd[25659]: generic_checks: name=reject_unauth_destination status=2
Jan 19 23:00:15 homeserver postfix/smtpd[25659]: > mail.mymail.com[127.0.0.1]: 554 5.7.1 <donkey@gmail.com>: Relay access denied
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: < mail.mymail.com[127.0.0.1]: rcpt to: bobthebuilder@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: extract_addr: input: shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: smtpd_check_addr: addr=shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: ctable_locate: move existing entry key shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: extract_addr: in: shrek@ukonline.co.uk, result: shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: >>> START Recipient address RESTRICTIONS <<<
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=permit_sasl_authenticated
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=permit_sasl_authenticated status=0
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=permit_mynetworks
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: permit_mynetworks: mail.mymail.com 127.0.0.1
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: match_hostname: mail.mymail.com ~? 192.168.1.7
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: match_hostaddr: 127.0.0.1 ~? 192.168.1.7
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: match_list_match: mail.mymail.com: no match
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: match_list_match: 127.0.0.1: no match
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=permit_mynetworks status=0
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=reject_unauth_destination
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: reject_unauth_destination: shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: permit_auth_destination: shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: ctable_locate: leave existing entry key shrek@ukonline.co.uk
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: NOQUEUE: reject: RCPT from mail.mymail.com[127.0.0.1]: 554 5.7.1 <shrek@ukonline.co.uk>: Relay access denied; from=<bobthebuilder@mymail.com> to=<shrek@ukonline.co.uk> proto=ESMTP helo=<mail.mymail.com>
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: generic_checks: name=reject_unauth_destination status=2
Jan 19 23:00:26 homeserver postfix/smtpd[25659]: > mail.mymail.com[127.0.0.1]: 554 5.7.1 <shrek@ukonline.co.uk>: Relay access denied
 
Old 01-20-2011, 05:54 PM   #9
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
After some playing around in my lunch break at work and logging in via putty I managed to get it all working and now I can send/receive and accept all mails from yahoo/gmail/hotmail etc etc.

Thanks all for your input.

Marking as solved.
 
Old 01-20-2011, 06:23 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Perhaps you can share the solution?

Kind regards
 
Old 01-21-2011, 04:26 AM   #11
fusion1275
Member
 
Registered: Jul 2007
Location: Portsmouth, Hants
Distribution: Linux Mint
Posts: 266

Original Poster
Rep: Reputation: 35
Don't actually know the solution but I will post up my config settings so they can be based on when others are doing the same thing or have the same probs as I did.

I'll update this later this evening.


Cheers
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection timeout in postfix for e-mail messages from Asterisk ergosteur Linux - Software 8 12-11-2009 12:10 AM
Postfix Connection Timeout, CentOs joeyadms Linux - Server 5 05-18-2008 03:49 PM
Telnet Timeout energiza Linux - Networking 0 08-19-2006 11:42 AM
how to change telnet timeout? qnguyendang Linux - Networking 0 02-17-2003 05:13 AM
Does telnet have a timeout??? mjb2123 Linux - Networking 1 01-30-2002 11:38 PM


All times are GMT -5. The time now is 10:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration