hi all,

i am new to postfix and dovecot and this is my first ever setup.

i have a problem with address rewrite on local/lmtp when using unix
account as an alias from virtual user.

when an email from outside deliver to virtual user on local server
(t...@test.net) then it rewrite to unix_acco...@hostname
(test.test....@corporate-e.xxx.net.id), :

Nov 18 10:33:16 corporate-e postfix/local[17789]: D0A18141AFFD:
to=<test.test....@corporate-e.xxx.net.id>, orig_to=<t...@test.net>,
relay=local, delay=0.1, delays=0.01/0/0/0.08, dsn=2.0.0, status=sent
(delivered to maildir)

how do i change this ? because it trigger another problem when user
want to authenticate via dovecot or when i want to use dovecot lmtp as
the lda.
is it possible to have just the orig to address ? i don't want any
real unix user address like usern...@hostname.

also it print that address (unix_acco...@hostname) on bounce message
so i think i may confused user a bit.

<test.test....@corporate-e.xxx.net.id> (expanded from <t...@test.net>):
    maildir delivery failed: error writing message: Disk quota exceeded

t...@test.net alias to test.test.net on my virtual_alias_maps

for now imap authentication run ok since i add
auth_username_translation = @. on dovecot.

Nov 18 10:34:05 corporate-e dovecot: auth: Debug:
pam(test.test.net,202.148.1.39): lookup service=dovecot
Nov 18 10:34:05 corporate-e dovecot: auth: Debug:
pam(test.test.net,202.148.1.39): #1/1 style=1 msg=Password:
Nov 18 10:34:05 corporate-e dovecot: auth: Debug: client out:
OK      1       user=test.test.net
Nov 18 10:34:05 corporate-e dovecot: auth: Debug: master in:
REQUEST 1       17815   1       2e965273b92f96fd0790a40773797087
Nov 18 10:34:05 corporate-e dovecot: auth: Debug:
passwd(test.test.net,202.148.1.39): lookup
Nov 18 10:34:05 corporate-e dovecot: auth: Debug: master out:
USER    1       test.test.net   system_groups_user=test.test.net        uid=515 
gid=508 home=/home/test.net/homes/test
Nov 18 10:34:05 corporate-e dovecot: imap-login: Login:
user=<test.test.net>, method=PLAIN, rip=202.148.1.39,
lip=202.148.1.10, mpid=17816, TLS

but it does't success for dovecot lmtp

Nov 16 11:13:45 corporate-e dovecot: lmtp(29568): Connect from local
Nov 16 11:13:45 corporate-e dovecot: auth: Debug: master in:
USER    1       test.test....@corporate-e.xxx.net.id    service=lmtp
Nov 16 11:13:45 corporate-e dovecot: auth: Debug:
passwd(test.test.net.corporate-e.xxx.net.id): lookup
Nov 16 11:13:45 corporate-e dovecot: auth:
passwd(test.test.net.corporate-e.xxx.net.id): unknown user
Nov 16 11:13:45 corporate-e dovecot: auth: Debug: master out: NOTFOUND  1
Nov 16 11:13:45 corporate-e postfix/lmtp[29567]: CA4EF141AFFD:
to=<test.test....@corporate-e.xxx.net.id>, orig_to=<t...@test.net>,
relay=corporate-e.xxx.net.id[/usr/local/var/run/dovecot/lmtp],
delay=0.09, delays=0.01/0/0.06/0.02, dsn=5.1.1, status=bounced (host
corporate-e.xxx.net.id[/usr/local/var/run/dovecot/lmtp] said: 550
5.1.1 <test.test....@corporate-e.xxx.net.id> User doesn't exist:
test.test....@corporate-e.xxx.net.id (in reply to RCPT TO command))

i try to play with auth_username_format = %n , then lmtp run ok

Nov 11 09:53:41 corporate-e dovecot: lmtp(26707): Connect from local
Nov 11 09:53:41 corporate-e dovecot: auth: Debug: Loading modules from
directory: /usr/local/lib/dovecot/auth
Nov 11 09:53:41 corporate-e dovecot: auth: Debug: master in:
USER    1       test.test....@corporate-e.xxx.net.id    service=lmtp
Nov 11 09:53:41 corporate-e dovecot: auth: Debug: passwd(test.test.net): lookup
Nov 11 09:53:41 corporate-e dovecot: auth: Debug: master out:
USER    1       test.test.net   system_groups_user=test.test.net        uid=515 
gid=508 home=/home/test.net/homes/test
Nov 11 09:53:41 corporate-e dovecot: lmtp(26707, test.test.net):
x9o3JbVa20xTaAAAH/SnqQ: msgid=unspecified: saved mail to INBOX
Nov 11 09:53:41 corporate-e postfix/lmtp[26678]: 8FE32141AFF2:
to=<test.test....@corporate-e.xxx.net.id>, orig_to=<t...@test.net>,
relay=corporate-e.xxx.net.id[/usr/local/var/run/dovecot/lmtp],
delay=0.17, delays=0.03/0/0/0.13, dsn=2.0.0, status=sent (250 2.0.0
<test.test....@corporate-e.xxx.net.id> x9o3JbVa20xTaAAAH/SnqQ Saved)

but imap doesn't

Nov 11 09:53:59 corporate-e dovecot: auth: Debug:
pam(test,202.148.1.56): lookup service=dovecot
Nov 11 09:53:59 corporate-e dovecot: auth: Debug:
pam(test,202.148.1.56): #1/1 style=1 msg=Password:
Nov 11 09:54:00 corporate-e dovecot: auth: pam(test,202.148.1.56): unknown user
Nov 11 09:54:02 corporate-e dovecot: auth: Debug: client out: FAIL      1       
user=test

at the moment i run postfix local and dovecot imap, but i also want to
replace postfix local to dovecot lmtp and i don't want to have
(u...@hostname) print on bounce message.

please help, thanks.

postfix 2.6.7
dovecot 2.0.6
centos 5.5

# postconf -n
alias_maps = hash:/etc/aliases
bounce_queue_lifetime = 3600s
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
daemon_timeout = 180s
data_directory = /var/lib/postfix
debug_peer_level = 2
default_destination_concurrency_limit = 100
default_destination_recipient_limit = 500
home_mailbox = Maildir/
html_directory = no
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq
manpage_directory = /usr/local/man
maximal_backoff_time = 600s
maximal_queue_lifetime = 3600s
message_size_limit = 17225137
minimal_backoff_time = 305s
mydestination = $myhostname, localhost
mynetworks_style = host
newaliases_path = /usr/bin/newaliases
readme_directory = no
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
smtp_data_done_timeout = 30s
smtp_data_init_timeout = 30s
smtp_data_xfer_timeout = 30s
smtp_destination_concurrency_limit = 10
smtp_helo_timeout = 60s
smtp_mail_timeout = 30s
smtp_quit_timeout = 30s
smtp_rcpt_timeout = 30s
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_unauth_destination
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = /var/spool/postfix/private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_unknown_sender_domain
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_cert_file = /etc/postfix/corporate-e.xxx.net.id.cert.pem
smtpd_tls_key_file = /etc/postfix/corporate-e.xxx.net.id.key.pem
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_tls_session_cache_database =
btree:/var/lib/postfix/smtpd_tls_session_cache
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

# dovecot -n
# 2.0.6: /usr/local/etc/dovecot/dovecot.conf
# OS: Linux 2.6.18-194.17.4.el5.centos.plusPAE i686 CentOS release 5.5 (Final)
auth_debug = yes
auth_debug_passwords = yes
auth_username_translation = @.
auth_verbose = yes
default_internal_user = postfix
default_login_user = postfix
disable_plaintext_auth = no
mail_gid = postfix
mail_location = maildir:~/Maildir:INDEX=MEMORY
mail_plugins = " quota"
mail_uid = postfix
passdb {
  driver = pam
}
plugin {
  quota = fs:user
}
service auth {
  unix_listener /var/run/dovecot/auth-master {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0660
    user = postfix
  }
  user = postfix
}
service lmtp {
  inet_listener lmtp {
    address = 127.0.0.1 ::1
    port = 24
  }
}
ssl_cert = </etc/postfix/corporate-e.xxx.net.id.cert.pem
ssl_key = </etc/postfix/corporate-e.xxx.net.id.key.pem
userdb {
  driver = passwd
}
protocol imap {
  mail_plugins = " quota imap_quota"
}


-- 
http://blog.rizahnst.org

Reply via email to