LinuxQuestions.org
Visit Jeremy's Blog.
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 08-22-2008, 04:01 AM   #1
haariseshu
Member
 
Registered: Jan 2008
Location: Noida, India
Distribution: RHEL
Posts: 81

Rep: Reputation: 15
Question 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.
 
Old 08-22-2008, 08:41 AM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
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.
 
  


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
Sendmail Mail Routing namit Linux - Server 1 03-15-2007 12:32 PM
Routing mail Dennysk Linux - Enterprise 2 07-06-2006 05:23 AM
postfix, mysql and mail routing demian Linux - Networking 0 09-09-2004 09:37 AM
routing mail out on a specific IP address LordFarquad Linux - Networking 0 09-01-2004 07:20 PM
Qmail - Routing Mail Shak Linux - Software 0 11-25-2002 04:20 PM

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

All times are GMT -5. The time now is 05:58 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