LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-14-2009, 10:58 PM   #1
leonardodicrappio
LQ Newbie
 
Registered: Oct 2009
Location: Ottawa, Canada
Distribution: Debian
Posts: 3

Rep: Reputation: 0
Postfix configuration outgoing mail problem; connection timed out


Hello,

I have a problem with postfix. It is installed on a host in my small home lan behind a router. My ISP is rogers. I have 3 external email addresses I am testing to/from, one of them being me@rogers.com, the others me@somewhere.ca and me@somewhereelse.ca. My local domain is mydomain.ca so I am trying to send from me@mydomain.

I can receive mail for me@mydomain.ca from each of these accounts no problem but I can only send mail successfully from this account to me@rogers.com.

mymailhost:/etc/postfix# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname localhost.$mydomain localhost $mydomain
mydomain = mydomain.ca
myhostname = mymailhost.mydomain.ca
mynetworks = 192.168.0.0/24, 127.0.0.0/8
myorigin = $mydomain
notify_classes = bounce,delay,policy,protocol,resource,software
relay_domains =
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions = permit_sasl_authenticated permit_mynetworks
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/toots-cert.pem
smtpd_tls_key_file = /etc/postfix/toots-key.pem
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

mail.log:
Oct 14 23:31:16 mymailhost postfix/smtp[9166]: 5F01426400: to=<me@somewhere.ca>, relay=none, delay=60, delays=0.04/0.02/60/0, dsn=4.4.1, status=deferred (connect to filter.somewhere.ca[ipaddress]:25: Connection timed out)

Oct 14 23:31:51 mymailhost postfix/smtp[9188]: 7EFCE26403: to=<me@somewhereelse.ca>, relay=none, delay=60, delays=0.03/0.01/60/0, dsn=4.4.1, status=deferred (connect to mail.somewhereelse.ca[ipaddress]:25: Connection timed out)

Oct 14 23:31:36 mymailhost postfix/smtp[9178]: 164E126402: to=<me@rogers.com>, relay=mx2.rog.mail.yahoo.com[206.190.37.7]:25, delay=60, delays=0.03/0.01/60/0.14, dsn=2.0.0, status=sent (250 ok dirdel)

I attempted to use relayhost=[smtp.broadband.rogers.com] in main.cf

with sasl_passwd:
[smtp.broadband.rogers.com] me:myrogerspassword

then postmap sasl_passwd and reload and send new test messages but then mail no longer is delivered to me@rogers.com (or the others).
 
Old 10-15-2009, 04:49 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,383

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
Hi

I don't know about your ISP, but most (including mine) will block any traffic where destination port is 25, except if it is to their SMTP server. The reason is that it's mostly used for spam and viruses, so it's probably wise.

My ISP does not require authentication to use the SMTP server, but they have a rule on which IP addresses that can use it, if you don't use authentication. (So basically you can only use it when using their network.)

But there should be no [] in the main.cf file. Try this:

relayhost = smtp.broadband.rogers.com

If it doesn't work, look at /var/log/mail.log. It should give you a clue why.
 
Old 10-15-2009, 10:38 PM   #3
leonardodicrappio
LQ Newbie
 
Registered: Oct 2009
Location: Ottawa, Canada
Distribution: Debian
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Guttorm View Post
Hi

I don't know about your ISP, but most (including mine) will block any traffic where destination port is 25, except if it is to their SMTP server. The reason is that it's mostly used for spam and viruses, so it's probably wise.

My ISP does not require authentication to use the SMTP server, but they have a rule on which IP addresses that can use it, if you don't use authentication. (So basically you can only use it when using their network.)

But there should be no [] in the main.cf file. Try this:

relayhost = smtp.broadband.rogers.com

If it doesn't work, look at /var/log/mail.log. It should give you a clue why.
I attempted your suggestion:

mymailhost:/etc/postfix# vi main.cf
mymailhost:/etc/postfix# vi sasl_passwd
mymailhost:/etc/postfix# postconf -n | grep relayhost
relayhost = smtp.broadband.rogers.com
mymailhost:/etc/postfix# cat sasl_passwd
smtp.broadband.rogers.com me:myrogerspassword
mymailhost:/etc/postfix# postmap sasl_passwd
mymailhost:/etc/postfix# /etc/init.d/postfix reload
Reloading Postfix configuration...done.

mail.log:
Oct 15 22:52:33 mymailhost postfix/master[23048]: reload configuration /etc/postfix
Oct 15 22:57:33 mymailhost postfix/qmgr[17147]: 241DB263F9: from=<me@mydomain.ca>, size=599, nrcpt=1 (queue active)
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: warning: valid_hostname: empty hostname
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: warning: malformed domain name in resource data of MX record for smtp.broadband.rogers.com:
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: warning: valid_hostname: empty hostname
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: warning: malformed domain name in resource data of MX record for smtp-rog.mail.yahoo.com:
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: warning: relayhost configuration problem
Oct 15 22:57:33 mymailhost postfix/smtp[17176]: 241DB263F9: to=<me@somewhere.ca>, relay=none, delay=87508, delays=87508/0.04/0.07/0, dsn=4.3.5, status=deferred (Name service error for name=smtp-rog.mail.yahoo.com type=MX: Malformed or unexpected name server reply)
Oct 15 23:16:44 mymailhost postfix/smtp[17292]: 410B626404: to=<me@somewhereelse.ca>, relay=none, delay=0.11, delays=0.04/0.02/0.05/0, dsn=4.3.5, status=deferred (Name service error for name=smtp-rog.mail.yahoo.com type=MX: Malformed or unexpected name server reply)
 
Old 11-03-2009, 04:41 PM   #4
leonardodicrappio
LQ Newbie
 
Registered: Oct 2009
Location: Ottawa, Canada
Distribution: Debian
Posts: 3

Original Poster
Rep: Reputation: 0
Here is the configuration that I was able to get to work:

mymailhost:/etc/postfix# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mydestination = $myhostname localhost.$mydomain localhost $mydomain
mydomain = mydomain.ca
myhostname = mymailhost.mydomain.ca
mynetworks = 192.168.0.0/24, 127.0.0.0/8
myorigin = $mydomain
notify_classes = bounce,delay,policy,protocol,resource,software
relay_domains =
relayhost = [smtp.broadband.rogers.com]
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions = permit_sasl_authenticated permit_mynetworks
smtpd_recipient_restrictions = permit_sasl_authenticated permit_mynetworks reject_unauth_destination
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/toots-cert.pem
smtpd_tls_key_file = /etc/postfix/toots-key.pem
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom

mymailhost:/etc/postfix# cat sasl_passwd
[smtp.broadband.rogers.com] me:myrogerspassword
 
  


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
Postfix: Disable outgoing mail dvishloff Linux - Server 1 05-13-2009 02:11 PM
Mail sending problem Postfix Connection timed out (port 25) malesh Linux - Server 3 03-20-2009 05:39 PM
Postfix - Configuration to Forward Outgoing Mail Elsewhere Ruler2112 Linux - Server 7 09-15-2008 04:55 PM
Postfix: Connection timed out Kristijan Linux - Networking 3 09-28-2006 05:11 AM
Outgoing Only mail server using Postfix opnsrc Linux - Networking 0 06-15-2006 10:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:35 AM.

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
Open Source Consulting | Domain Registration