Hi there:

I'm a little tired of making some tests with gnarwl and postfix, so I
started to reduce directives. I have something like this in main.cf
(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
debug_peer_list = domain.com
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 20971520
mydestination = localhost
mydomain = domain.com
myhostname = mail.$mydomain
mynetworks = 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
relayhost = 192.168.99.1
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
show_user_unknown_table_name = no
smtpd_banner = $myhostname ESMTP
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_data_restrictions = reject_unauth_pipelining,
reject_multi_recipient_bounce
smtpd_helo_restrictions = permit_mynetworks, permit_sasl_authenticated
smtpd_recipient_restrictions = reject_non_fqdn_recipient,
reject_unknown_recipient_domain, permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sender_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_non_fqdn_sender, reject_unkno
wn_sender_domain
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = ldap:/etc/postfix/phamm_alias.cf, $alias_maps
virtual_mailbox_domains = ldap:/etc/postfix/phamm_dominios_virtuales.cf
virtual_mailbox_maps = ldap:/etc/postfix/phamm_vacation.cf
virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp

The content of /etc/postfix/phamm_vacation.cf is:

server_host= 127.0.0.1
server_port= 389
bind_dn = cn=phamm,o=hosting,dc=domain,dc=com,dc=pe
bind_pw = secret
timeout = 20
search_base = o=hosting,dc=domain,dc=com,dc=pe
query_filter = 
(&(mail=%s)(objectClass=VirtualMailAccount)(accountActive=TRUE)(delete=FALSE)(forwardActive=FALSE)(vacationActive=TRUE))
result_attribute = mail
result_format = jvoorhe...@gmail.com
scope = sub
debuglevel = 0

According to 'result_format' value... Isn't suposed that Postfix will
return 'jvoorhe...@gmail.com' when someone aks for u...@domain.com?
postmap -q returns the expected value:

$ postmap -q u...@domain.com ldap:/etc/postfix/phamm_vacation.cf
jvoorhe...@gmail.com

But when I send a message to u...@domain.com Postfix doesn't return
jvoorhe...@gmail.com, instead it returns u...@domain.com yet. These
are the corresponding postfix logs:

Jan 29 16:30:48 mail postfix/smtpd[22343]: connect from
localhost.localdomain[127.0.0.1]
Jan 29 16:31:02 mail postfix/smtpd[22343]: 677411E020D:
client=localhost.localdomain[127.0.0.1]
Jan 29 16:31:08 mail postfix/cleanup[22346]: 677411E020D:
message-id=<20090129213102.677411e0...@mail.domain.com>
Jan 29 16:31:08 mail postfix/qmgr[22339]: 677411E020D: from=<>,
size=380, nrcpt=1 (queue active)
Jan 29 16:31:08 mail postfix/lmtp[22348]: 677411E020D:
to=<u...@domain.com>,
relay=mail.domain.com[/var/lib/imap/socket/lmtp], delay=15,
delays=15/0.01/0/0.02, dsn=2.1.5, status=sent (250 2.1.5 Ok)
Jan 29 16:31:08 mail postfix/qmgr[22339]: 677411E020D: removed
Jan 29 16:31:09 mail postfix/smtpd[22343]: disconnect from
localhost.localdomain[127.0.0.1]

I sent the email like this:

$ telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 mail.domain.com ESMTP
helo localhost
250 mail.domain.com
mail from: <>
250 2.1.0 Ok
rcpt to: <u...@domain.com>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
Test
.
250 2.0.0 Ok: queued as 677411E020D
quit
221 2.0.0 Bye
Connection closed by foreign host.

So, why it's result_format in LDAP map being ignored? I hope someone
can help me, bye people

Reply via email to