LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   problem on mail routing through mailHost attribute (https://www.linuxquestions.org/questions/linux-server-73/problem-on-mail-routing-through-mailhost-attribute-664543/)

haariseshu 08-22-2008 04:01 AM

problem on mail routing through mailHost attribute
 
Hi all,
I'm running postfix-2.3.3-2 and openldap-2.3.27-8.
Everything is working fine. But I want to route the mails for some users to another mail server in my domain itself. So I decided to use mailHost attribute in ldap. after reading the mailHost attribute from ldap postfix should route the mail to the specified server in mailHost. But in my case after reading the mailHost postfix is considering the value in mailHost as a user and trying to send mail to that value. I think i'm confusing. I will give the logs then you can get:

user.ldif
dn: cn=relaym,ou=Telemedicine,dc=panafnet,dc=com
objectClass: posixAccount
objectClass: qmailUser
objectClass: inetOrgPerson
cn: relaym
sn: relaymail
uid: relaym
uidNumber: 550
gidNumber: 550
description: africanuser
mail: relaym@panafnet.com
homeDirectory: /var/vhome/mail/relaym
mailMessageStore: /var/spool/mail
userPassword: relaym
telephoneNumber: 9871115175
accountStatus: active
mailHost: [DIDEL_TCILS_DL02.panafnet.com]

main.cf

[root@DIDEL_TCILS_MAIL01 ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mydomain = panafnet.com
myhostname = DIDEL_TCILS_MAIL01.panafnet.com
mynetworks = 192.168.117.0/24, 10.20.20.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.3.3/README_FILES
relay_domains = $mydestination
relayhost = $mydomain
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_gid_maps = static:102
virtual_mailbox_base = /var/spool/mail
virtual_mailbox_maps = ldap:ldaprelay
virtual_minimum_uid = 102
virtual_transport = virtual
virtual_uid_maps = static:102


and ldap lookup in postfix

#Ldap details
ldaprelay_server_host = 192.168.117.23
ldaprelay_server_port = 389
ldaprelay_search_base = dc=panafnet,dc=com
ldaprelay_query_filter = (mail=%s)
ldaprelay_bind = yes
ldaprelay_bind_dn = cn=Manager,dc=panafnet,dc=com
ldaprelay_bind_pw = hcl123
ldaprelay_result_attribute = mailHost
ldaprelay_result_filter = smtp:%s

when i'm testing with postmap:

[root@DIDEL_TCILS_MAIL01 ~]# postmap -q relaym@panafnet.com ldap:ldaprelay
smtp:[DIDEL_TCILS_DL02.panafnet.com]

But when i'm sending mail to relaym

[root@DIDEL_TCILS_MAIL01 ~]# mail relaym
Subject: test
mail
.
Cc:
[root@DIDEL_TCILS_MAIL01 ~]#

postfix log:

Aug 21 19:42:29 DIDEL_TCILS_MAIL01 postfix/pickup[7495]: BCA5A1027C: uid=0 from=<root>
Aug 21 19:42:29 DIDEL_TCILS_MAIL01 postfix/cleanup[7866]: BCA5A1027C: message-id=<20080821141229.BCA5A1027C@DIDEL_TCILS_MAIL01.panafnet.com>
Aug 21 19:42:29 DIDEL_TCILS_MAIL01 postfix/qmgr[7496]: BCA5A1027C: from=<root@panafnet.com>, size=324, nrcpt=1 (queue active)
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/virtual[7868]: BCA5A1027C: to=<smtp:[DIDEL_TCILS_DL02.panafnet.com]@panafnet.com>, orig_to=<relaym>, relay=virtual, delay=0.31, delays=0.17/0.01/0/0.13, dsn=5.1.1, status=bounced (unknown user: "smtp:[didel_tcils_dl02.panafnet.com]@panafnet.com")
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/cleanup[7866]: 0BC9F102A4: message-id=<20080821141230.0BC9F102A4@DIDEL_TCILS_MAIL01.panafnet.com>
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/qmgr[7496]: 0BC9F102A4: from=<>, size=2361, nrcpt=1 (queue active)
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/bounce[7870]: BCA5A1027C: sender non-delivery notification: 0BC9F102A4
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/qmgr[7496]: BCA5A1027C: removed
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/virtual[7868]: 0BC9F102A4: to=<root@panafnet.com>, relay=virtual, delay=0.42, delays=0.25/0.01/0/0.16, dsn=5.1.1, status=bounced (unknown user: "root@panafnet.com")
Aug 21 19:42:30 DIDEL_TCILS_MAIL01 postfix/qmgr[7496]: 0BC9F102A4: removed



This is my problem...
Any idea where i'm making mistake...

Thanks a lot...

--
Hari.

chort 08-22-2008 08:41 AM

Try changing the mailHost attribute for that user to:
Code:

relaym@DIDEL_TCILS_DL02.panafnet.com
Most of the LDAP mail routing cases I've seen use fully qualified user@host notation for mailHost.


All times are GMT -5. The time now is 05:36 PM.