LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   relay host failed to send mail to outside domain in postfix (https://www.linuxquestions.org/questions/linux-newbie-8/relay-host-failed-to-send-mail-to-outside-domain-in-postfix-4175489269/)

mjsubbu 12-27-2013 02:25 AM

relay host failed to send mail to outside domain in postfix
 
Hi Experts,

I am a newbie for postfix. I have configured my postfix mail server to relay our intranet mail as well as outbound mails.

The internal mailing is working. when I try to send mails to outside domain ( like .gmail.com) it is giving the below error. Please help me.

I have issues the command from user1 as below :

[user1@yyyyyyy ~]$ echo "testmailing: 11.30" |mail -s "PostFix this elayaraja Test 27122013:11.30" mjsubramanian@gmail.com


#

Dec 27 13:49:41 yyyyyyy sendmail[16794]: rBR8Jel0016794: from=user1, size=272, class=0, nrcpts=1, msgid=<201312270819.rBR8Jel0016794@yyyyyyy.xxxxxxxxxx.in>, relay=user1@localhost
Dec 27 13:49:41 yyyyyyy postfix/smtpd[16795]: connect from localhost.localdomain[127.0.0.1]
Dec 27 13:49:41 yyyyyyy postfix/smtpd[16795]: 15E6816005D: client=localhost.localdomain[127.0.0.1]
Dec 27 13:49:41 yyyyyyy postfix/cleanup[16798]: 15E6816005D: message-id=<201312270819.rBR8Jel0016794@yyyyyyy.xxxxxxxxxx.in>
Dec 27 13:49:41 yyyyyyy sendmail[16794]: rBR8Jel0016794: to=mjsubramanian@gmail.com, ctladdr=user1 (507/507), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30272, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 15E6816005D)
Dec 27 13:49:41 yyyyyyy postfix/qmgr[16325]: 15E6816005D: from=<user1@yyyyyyy.xxxxxxxxxx.in>, size=792, nrcpt=1 (queue active)
Dec 27 13:49:41 yyyyyyy postfix/smtpd[16795]: disconnect from localhost.localdomain[127.0.0.1]
Dec 27 13:49:43 yyyyyyy postfix/smtp[16799]: 15E6816005D: to=<mjsubramanian@gmail.com>, relay=smtp.xxxxxxxxxx.in[70.87.29.223]:25, delay=2.2, delays=0.08/0.01/1.7/0.38, dsn=5.7.1, status=bounced (host smtp.xxxxxxxxxx.in[70.87.29.223] said: 554 5.7.1 <mjsubramanian@gmail.com>: Relay access denied (in reply to RCPT TO command))
Dec 27 13:49:43 yyyyyyy postfix/cleanup[16798]: 93DE916005C: message-id=<20131227081943.93DE916005C@yyyyyyy.xxxxxxxxxx.in>
Dec 27 13:49:43 yyyyyyy postfix/bounce[16800]: 15E6816005D: sender non-delivery notification: 93DE916005C
Dec 27 13:49:43 yyyyyyy postfix/qmgr[16325]: 93DE916005C: from=<>, size=2936, nrcpt=1 (queue active)
Dec 27 13:49:43 yyyyyyy postfix/qmgr[16325]: 15E6816005D: removed
Dec 27 13:49:43 yyyyyyy postfix/local[16801]: 93DE916005C: to=<user1@xxxxxxxxxx.in>, orig_to=<user1@yyyyyyy.xxxxxxxxxx.in>, relay=local, delay=0.07, delays=0.03/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to maildir)
Dec 27 13:49:43 yyyyyyy postfix/qmgr[16325]: 93DE916005C: removed




My postconf out is here:

# postconf -n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, xxxxxxxxx.in
mydomain = xxxxxxxxx.in
myhostname = yyyy.xxxxxxxxx.in
mynetworks = 192.168.1.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = [smtp.xxxxxxxxxx.in]
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_cname_overrides_servername = no
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpw
smtp_sasl_security_options = noanonymous
smtp_sender_dependent_authentication = yes
unknown_local_recipient_reject_code = 550
#

descendant_command 12-27-2013 02:48 AM

I would guess that you are not authenticating properly to your relay, so it is rejecting your attempt to send.
Check these settings and associated files for validity
Code:

relayhost = [smtp.xxxxxxxxxx.in]
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/saslpw
smtp_sender_dependent_authentication = yes


mjsubbu 12-27-2013 03:28 AM

Hi descendant_command,

Thank you very much for your update.

Here is my sender_reply and saslpw files output. I have verified the smtp.XXXXXXXXXX.in is working fine. I could able to download mails to my outlook.
The webmail tomy server also working for the same users with the same password.

Any idea what I am missing here. The syntax or anything.


[root@yyyyyy postfix]# cat sender_relay
user1@xxxxxxxx.in smtp.xxxxxxxx.in
user2@xxxxxxxx.in smtp.xxxxxxxx.in
user2@xxxxxxxx.in smtp.xxxxxxxx.in
user4@xxxxxxxx.in smtp.xxxxxxxx.in


[root@yyyyyy postfix]# cat saslpw
user1@xxxxxxx.in user1@xxxxxxx.in:password
user2@xxxxxxx.in user2@xxxxxxx.in:password
user3@xxxxxxx.in user3@xxxxxxx.in:password
user4@xxxxxxx.in user4@xxxxxxx.in:password

descendant_command 12-27-2013 04:13 AM

Just to be clear - smtp.XXXXXXXXXX.in is your ISP's SMTP relay (or such - external relay anyway), yes?
Not your own server?

Because it is pretty difficult to tell with everything munged with X's ...

I don't know much about the auth syntax for that as I don't use an external relay for my servers.
But it's pretty clear it doesn't like you, so you should verify the name/pw being sent, and that it is one that works.

You could increase the verbosity of the postfix logging, or best, tcpdump the SMTP session to see exactly what is being passed and replied.

mjsubbu 12-27-2013 01:31 PM

Hi,

Thank you for the update.

This smtp.XXXXXXX.in is our mail servers SMTP. It is not any other third party ISP's. I could able resolve the smtp from my mail server.

Actually I am using this mail server as MTA only to distribute the mail locally to the users in Intranet.

[root@YYYYYY]# nslookup smtp.XXXXXXXXXXXX.in
Server: 122.165.223.1
Address: 122.165.223.1#53

Non-authoritative answer:
smtp.XXXXXXXXXXXX.in canonical name = smtp.ZZZZZZZZZZ.com.

Name: smtp.ZZZZZZZZZZ.com
Address: 70.87.29.223
Name: smtp.ZZZZZZZZZZ.com
Address: 70.87.29.14
Name: smtp.ZZZZZZZZZZ.com
Address: 70.87.29.134


Any how I will double check the user and SMTP authentication once again.

I have one more doubt. I found something new when I ran a nslookup for my smtp. It gave me a canonical name for the smtp host. Do I need to use the canonical name instead of the direct SMTP host name.

Please look at the above output.

Do I need to use smtp.XXXXXXX.in or smtp.ZZZZZZZ.in?.

Thanks in advance.

descendant_command 12-27-2013 02:46 PM

Sorry, you lost me. I still have no idea of your setup.

One thing though, any MX record should point to an A record NOT a CNAME (although that probably has nothing to do with your relay issue).

Good luck - I'm off to the beach ... :D


All times are GMT -5. The time now is 06:27 AM.