I have recently installed dovecot on a FreeBSD mailserver running postfix.
But when I try to login with imap/pop3, I always get an error "stat failed:
Not a directory".
I guess it is something wrong with the mail format postfix uses to store the
message, but I don't seem to find the correct solution.
Here's the postfix log with the successful delivery:
Feb 17 08:58:24 mailsrv2 postfix/smtpd[75706]: connect from
pc17r2.domain.com[10.0.1.17]
Feb 17 08:59:07 mailsrv2 postfix/smtpd[75706]: 290F1B81D:
clientpc17r2.domain.com[10.0.1.17]
Feb 17 08:59:20 mailsrv2 postfix/cleanup[75710]: 290F1B81D:
message-id=<20080217075907.290F1B81D at mailsrv2.domain.com>
Feb 17 08:59:20 mailsrv2 postfix/qmgr[75703]: 290F1B81D:
from=<andrea at vp44.net>, size=384, nrcpt=1 (queue active)
Feb 17 08:59:21 mailsrv2 postfix/virtual[75711]: 290F1B81D:
to=<andrea at internal.domain.com>, relay=virtual, delay=39,
delays=39/0.26/0/0.24, dsn=2.0.0, status=sent (delivered to mailbox)
Feb 17 08:59:21 mailsrv2 postfix/qmgr[75703]: 290F1B81D: removed
And here dovecot:
Feb 17 09:00:24 mailsrv2 dovecot: imap-login: Login:
user=<andrea at internal.domain.com>, method=PLAIN, rip=10.0.1.2,
lip=10.0.1.17
Feb 17 09:00:24 mailsrv2 dovecot: IMAP(andrea at internal.domain.com):
stat(/usr/local/virtual/internal.domain.com/andrea/cur) failed: Not a
directory
Feb 17 09:00:24 mailsrv2 dovecot: IMAP(andrea at internal.domain.com):
stat(/usr/local/virtual/internal.domain.com/andrea/cur) failed: Not a
directory
Feb 17 09:00:24 mailsrv2 dovecot: IMAP(andrea at internal.domain.com):
Connection closed
Dovecot -n:
# 1.0.10: /usr/local/etc/dovecot.conf
base_dir: /var/run/dovecot/
protocols: imap pop3 imaps pop3s
ssl_cert_file: /etc/ssl/dovecot/cert.pem
ssl_key_file: /etc/ssl/dovecot/key.pem
disable_plaintext_auth: no
login_dir: /var/run/dovecot//login
login_executable(default): /usr/local/libexec/dovecot/imap-login
login_executable(imap): /usr/local/libexec/dovecot/imap-login
login_executable(pop3): /usr/local/libexec/dovecot/pop3-login
login_greeting: Internal Server Ready
verbose_proctitle: yes
first_valid_uid: 125
last_valid_uid: 125
first_valid_gid: 125
last_valid_gid: 125
mail_extra_groups: mail
mail_location: maildir:/usr/local/virtual/%d/%n
mail_executable(default): /usr/local/libexec/dovecot/imap
mail_executable(imap): /usr/local/libexec/dovecot/imap
mail_executable(pop3): /usr/local/libexec/dovecot/pop3
mail_plugins(default): quota imap_quota
mail_plugins(imap): quota imap_quota
mail_plugins(pop3): quota
mail_plugin_dir(default): /usr/local/lib/dovecot/imap
mail_plugin_dir(imap): /usr/local/lib/dovecot/imap
mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3
imap_client_workarounds(default): delay-newmail outlook-idle netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(imap): delay-newmail outlook-idle netscape-eoh
tb-extra-mailbox-sep
imap_client_workarounds(pop3): outlook-idle
pop3_uidl_format(default):
pop3_uidl_format(imap):
pop3_uidl_format(pop3): %08Xu%08Xv
pop3_client_workarounds(default):
pop3_client_workarounds(imap):
pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh
auth default:
mechanisms: plain login cram-md5 digest-md5
passdb:
driver: pam
passdb:
driver: sql
args: /usr/local/etc/dovecot-sql.conf
userdb:
driver: passwd
userdb:
driver: sql
args: /usr/local/etc/dovecot-sql.conf
socket:
type: listen
client:
path: /var/spool/postfix/private/auth
mode: 432
user: postfix
group: postfix
Postconf -n:
mailsrv2# postconf -n
broken_sasl_auth_clients = yes
command_directory = /usr/local/sbin
config_directory = /usr/local/etc/postfix
daemon_directory = /usr/local/libexec/postfix
debug_peer_level = 2
html_directory = no
mail_owner = postfix
mailq_path = /usr/local/bin/mailq
manpage_directory = /usr/local/man
mydomain = domain.com
myhostname = mailsrv2.domain.com
mynetworks = 10.0.1.0/24, 127.0.0.0/8
mynetworks_style = subnet
newaliases_path = /usr/local/bin/newaliases
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
$virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = no
relay_domains proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf
sample_directory = /usr/local/etc/postfix
sendmail_path = /usr/local/sbin/sendmail
setgid_group = maildrop
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_non_fqdn_hostname,
reject_non_fqdn_sender, reject_non_fqdn_recipient,
reject_unauth_destination, reject_unauth_pipelining,
reject_invalid_hostname, reject_rbl_client list.dsbl.org,
reject_rbl_client bl.spamcop.net, reject_rbl_client sbl-xbl.spamhaus.org
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_tls_CAfile = /etc/ssl/postfix/ca.crt
smtpd_tls_cert_file = /etc/ssl/postfix/smtp.purplehat.org.crt
smtpd_tls_key_file = /etc/ssl/postfix/smtp.purplehat.org.key
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
soft_bounce = no
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps
proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:125
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains
proxy:mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_limit_maps
proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
virtual_mailbox_limit_override = yes
virtual_mailbox_maps
proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_maildir_limit_message = Sorry, this user has overdrawn their
diskspace quota. Please try again later.
virtual_minimum_uid = 125
virtual_overquota_bounce = yes
virtual_transport = virtual
virtual_uid_maps = static:125