Link to home
Start Free TrialLog in
Avatar of ddiazp
ddiazpFlag for Canada

asked on

Postfix Relay Problem

Hi All,

We migrated a postfix configuration to version 2.2.9, adjusted the configuration to the best of my knowledge, but I have a problem.


Whenever a client inside my network tries to send email out (through postfix) I see the following entry on the mail log:

Apr 28 13:19:43 servername postfix/qmgr[10128]: 39690289F0: to=<xxx@outsideworld.com>, relay=none, delay=6, status=deferred (delivery temporarily suspended: transport is unavailable)

(note relay=none)

This happens for every email that is not part of my transport file.. It seems that postfix doesn't know how to handle the email..

I have attached my postconf -n output




This is extremely urgent!! I appreciate anyone with any suggestion :)

Thank you




biff = no
body_checks = regexp:/etc/postfix/body_checks
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 30
default_privs = nobody
default_process_limit = 225
disable_vrfy_command = yes
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
local_destination_concurrency_limit = 4
local_recipient_maps = unix:passwd.byname $alias_maps
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 7500s
maximal_queue_lifetime = 5d
message_size_limit = 20480000
minimal_backoff_time = 750s
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = $myhostname
myhostname = hostname.domain.com
mynetworks = 127.0.0.0/8,32,10.2.0.0/16
mynetworks_style = host
myorigin = $myhostname
newaliases_path = /usr/bin/newaliases
qmgr_message_active_limit = 60000
qmgr_message_recipient_limit = 65000
queue_directory = /var/spool/postfix
queue_run_delay = 500s
readme_directory = no
recipient_delimiter = -
relay_domains = my.domain.com my.domain.info
relay_recipient_maps = hash:/etc/postfix/relay_recipients
relayhost =
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_destination_recipient_limit = 125
smtpd_delay_reject = no
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks, reject_unauth_destination, check_recipient_access hash:/etc/postfix/recipient_access
smtpd_sender_restrictions = hash:/etc/postfix/access
strict_rfc821_envelopes = yes
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Michael Worsham
Michael Worsham
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddiazp

ASKER

Thanks for the quick reply:

This is what I get from the logs after attempting to send 1 email:

Apr 28 14:00:19 toad1 postfix/cleanup[11919]: E39A028A1F: message-id=<20100428185951.E39A028A1F@mycorp.com>
Apr 28 14:00:19 toad1 postfix/qmgr[11910]: E39A028A1F: from=<mailfrom@mycorp.com>, size=399, nrcpt=1 (queue active)
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: input attribute name: status
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: input attribute value: 0
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: public/cleanup socket: wanted attribute: reason
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: input attribute name: reason
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: input attribute value: (end)
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: public/cleanup socket: wanted attribute: (list terminator)
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: input attribute name: (end)
Apr 28 14:00:19 toad1 postfix/smtpd[11949]: > unknown[10.2.5.135]: 250 Ok: queued as E39A028A1F
Apr 28 14:00:19 toad1 postfix/qmgr[11910]: E39A028A1F: to=<email@outsideworld.com>, relay=none, delay=32, status=deferred (delivery temporarily suspended: transport is unavailable)

Can you post a copy of your /etc/postfix/transport file?
Avatar of ddiazp

ASKER

Here it is
.mycorp.com   relay:[ExchangeIP]
mycorp.com relay:[ExchangeIP]
myhost.mydomain.com local:

Open in new window

Instead of using relay:[ExchangeIP], try using smtp:[ExchangeIP]

Avatar of ddiazp

ASKER

I've enabled -v on qmgr on my master.cf file, here's the output for the failed email:

sender: sender@mycorp.com
recipient: destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: master_notify: status 1
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_active_feed: queue incoming
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_active_feed: incoming/C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_message_alloc: active C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: C2E9F28944: from=<sender@mycorp.com>, size=422, nrcpt=1 (queue active)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: start sorted recipient list
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_message_sort: destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: end sorted recipient list
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr request = resolve
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr address = destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: flags
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: flags
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: 0
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: transport
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: transport
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: smtp
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: nexthop
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: nexthop
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: recipient
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: recipient
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: flags
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: flags
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: 4096
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/rewrite socket: wanted attribute: (list terminator)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: (end)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: resolve_clnt: `destination@yahoo.com' -> transp=`smtp' host=`yahoo.com' rcpt=`destination@yahoo.com' flags= class=default
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: connect to subsystem private/defer
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr nrequest = 0
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr flags = 0
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr queue_id = C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr original_recipient = destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr recipient = destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr offset = 265
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr status = 4.0.0
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr action = delayed
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: send attr reason = delivery temporarily suspended: transport is unavailable
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/defer socket: wanted attribute: status
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: status
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute value: 0
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: private/defer socket: wanted attribute: (list terminator)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: input attribute name: (end)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: C2E9F28944: to=<destination@yahoo.com>, relay=none, delay=16, status=deferred (delivery temporarily suspended: transport is unavailable)
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: flush_add: site yahoo.com id C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: match_hostname: yahoo.com ~? mycorp.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: match_list_match: yahoo.com: no match
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: flush_add: site yahoo.com id C2E9F28944 status 4
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: start sorted recipient list
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_message_sort: destination@yahoo.com
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: end sorted recipient list
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_active_done: C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: wakeup C2E9F28944 after 750 secs
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: qmgr_active_defer: defer C2E9F28944
Apr 28 14:44:20 toad1 postfix/qmgr[13766]: done incoming queue scan

Open in new window

This is what concerns me -- send attr status = 4.0.0

The 4.0.0 code is a "soft" error which means that your SMTP server kept retrying.

The 'transport is unavailable' message looks like that the Exchange server is not allowing the message to be relayed/passed through.

---

I also noticed in your main.cf config this variable -- mynetworks = 127.0.0.0/8,32,10.2.0.0/16

What does the '32' represent?
Avatar of ddiazp

ASKER

Exchange is fine because I can get incoming emails just fine, when it says transport unavailable it refers to the SMTP server for the recipient in the recipient list on the email header -- in this case I do not have a transport entry for yahoo.com so Postfix doesn't know what to do with the email.

I have a few other entries for trusted subnets on mynetworks and i removed them to clean up the output a bit, that 32 comes from  X.X.X.X/32 (one of my other entries).

The emails i'm trying to relay through postfix to the outside world do not get sent but they're on they queue (checked with mailq)


Once postfix reads the email headers it has to determine where to send the email next. I believe it does it by looking up the destination domain, lookup its MX record on DNS and connect to that IP on port 25. If so, I assume something among those steps is failing. The server has access to the internet, it can do DNS queries and ping remote SMTP servers..
Avatar of ddiazp

ASKER

Finally figured out what the issue was.

We added the following line to the transport file:

*     relay:


This will overwrite the 'nexthop' for the rest of the domains in the transport table and will force postfix to use the MX record of the domain of the recipient.

I will award points as your comment made me think of adding -v to the qmgr which gave me more ideas.


Thanks again!
Avatar of ddiazp

ASKER

Thanks for the quick help