Ok I finally figured it...
It was because of improper permissions for the attachments folder.... I did
an strace and found this.
Once I changed the permision to the attachments folder it was alright..
I think this is a bug... it must check and fail and report a proper error
message.. instead of this cryptic error...
here is the strace output...
open("/apps/mail/mailbox/attachments/23/12/hashes/2312039008db057a1c75",
O_RDONLY) = -1 ENOENT (No such file or directory)
lstat("/apps/mail/mailbox/attachments/23/12/.temp.vrajah-vps5.15910.c9ec404edac079b3",
0x7fff1d300260) = -1 ENOENT (No such file or directory)
umask(066) = 077
open("/apps/mail/mailbox/attachments/23/12/.temp.vrajah-vps5.15910.c9ec404edac079b3",
O_RDWR|O_CREAT|O_EXCL, 0666) = -1 ENOENT (No such file or directory)
umask(077) = 066
umask(0) = 077
mkdir("/apps/mail/mailbox/attachments/23/12", 0700) = -1 ENOENT (No
such
file or directory)
umask(077) = 0
umask(0) = 077
mkdir("/apps/mail/mailbox/attachments/23", 0700) = -1 EACCES
(Permission
denied)
umask(077) = 0
fstat(22, {st_mode=S_IFREG|0600, st_size=137728, ...}) = 0
pread(22,
"\320\317\21\340\241\261\32\341\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0>\0\3\0\376\377\t\0"...,
8192, 0) = 8192
.
.
.
pread(22,
"\n\0%\1\3\0\202\0\16\0\0\0\1\2\6\0&\1\0\0\261\0\375\0\n\0&\1\1\0\201\0"...,
8192, 131072) = 6656
pread(22, "", 1536, 137728) = 0
fdatasync(4294967295) = -1 EBADF (Bad file descriptor)
write(2, "\1\00415910 fdatasync(/apps/mail/mai"..., 138) = 138
On Fri, Sep 6, 2013 at 12:38 PM, Vijay Rajah <vijayrajah at gmail.com>
wrote:
>
>
> Hello list,
>
> I have a dovecot 2.2.5 instance configured to use mdbox as mailbox format.
> I configured to use separate storage attachments and use SIS.. (doveconf -n
> below)
>
> I get this error
>
> Sep 6 12:29:52 vrajah.mydomain.tld dovecot: lmtp(14258, email at
mydomain.tld):
> Error:
>
fdatasync(/apps/mail/mailbox/attachments/23/12/2312039008db057a1c75-2efc2d00687d2952b2370000f89409f1)
> failed: Bad file descriptor
>
> I'm using centos 6.4 on a KVM with ext4 as fs.
>
> Can someone tell me why i'm getting this error? and how to fix this?
>
> -Thanks in advance
> Vijay
>
>
> ##########doveconf -n
>
> # 2.2.5: /apps/mail/dovecot/2.2.5/etc/dovecot/dovecot.conf
> # OS: Linux 2.6.32-358.14.1.el6.x86_64 x86_64 CentOS release 6.4 (Final)
> ext4
> auth_mechanisms = plain login digest-md5 cram-md5
> auth_socket_path = /apps/mail/var/dovecot/run/auth-userdb
> base_dir = /apps/mail/var/dovecot/run/
> debug_log_path = /var/log/dovecot-debug.log
> dict {
> sqlquota >
mysql:/apps/mail/dovecot/2.2.5/etc/dovecot/conf.d/sqlquota.dict.ext
> }
> hostname = mail1 at mydomain.tldmydomain.tld
> mail_attachment_dir = /apps/mail/mailbox/attachments
> mail_attachment_hash = %{sha256:80}
> mail_debug = yes
> mail_location = mdbox:/apps/mail/mailbox/%d/%n/mdbox
> mail_plugin_dir = /apps/mail/dovecot/2.2.5/lib/dovecot/
> mail_plugins = " virtual quota zlib"
> managesieve_notify_capability = mailto
> managesieve_sieve_capability = fileinto reject envelope encoded-character
> vacation subaddress comparator-i;ascii-numeric relational regex imap4flags
> copy include variables body enotify environment mailbox date ihave
> mbox_write_locks = fcntl dotlock
> mdbox_rotate_size = 1 M
> namespace inbox {
> inbox = yes
> location > mailbox Drafts {
> auto = subscribe
> special_use = \Drafts
> }
> mailbox Junk {
> auto = subscribe
> special_use = \Junk
> }
> mailbox Sent {
> special_use = \Sent
> }
> mailbox "Sent Messages" {
> special_use = \Sent
> }
> mailbox Spam {
> auto = subscribe
> }
> mailbox Trash {
> auto = subscribe
> special_use = \Trash
> }
> prefix > separator = /
> type = private
> }
> passdb {
> args = /apps/mail/dovecot/2.2.5/etc/dovecot/conf.d/dovecot-sql.conf.ext
> driver = sql
> }
> plugin {
> mail_log_events = delete undelete expunge copy mailbox_delete
> mailbox_rename
> mail_log_fields = uid box msgid size
> quota = dict:User quota::proxy::sqlquota
> quota_grace = 10%%
> quota_rule = *:storage=1GB
> quota_rule2 = Trash:storage=+10%%
> quota_rule3 = Spam:storage=+20%%
> quota_status_nouser = DUNNO
> quota_status_overquota = 450 4.2.2 Mailbox is full. Try again later
> quota_status_success = DUNNO
> quota_warning = storage=95%% quota-warning 95 %u
> quota_warning2 = storage=80%% quota-warning 80 %u
> quota_warning3 = -storage=100%% quota-warning below %u
> sieve = ~/.dovecot.sieve
> sieve_before = /apps/mail/var/dovecot/sieve/
> sieve_dir = ~/sieve
> sieve_global_dir = /apps/mail/var/dovecot/sieve
> zlib_save = bz2
> zlib_save_level = 9
> }
> protocols = imap lmtp sieve
> service auth {
> unix_listener /apps/mail/var/postfix/dovecot-auth {
> group = postfix
> mode = 0660
> user = postfix
> }
> }
> service dict {
> unix_listener dict {
> group = vmail
> mode = 0600
> user = vmail
> }
> }
> service imap-login {
> inet_listener imap {
> port = 143
> }
> }
> service lmtp {
> unix_listener /apps/mail/var/postfix/dovecot-lmtp {
> group = postfix
> mode = 0660
> user = postfix
> }
> }
> service managesieve-login {
> inet_listener sieve {
> port = 4190
> }
> service_count = 10
> vsz_limit = 64 M
> }
> service managesieve {
> process_limit = 1024
> }
> service quota-status {
> client_limit = 1
> executable = quota-status -p postfix
> inet_listener {
> port = 12340
> }
> }
> service quota-warning {
> executable = script
> /apps/mail/dovecot/2.2.5/etc/dovecot/conf.d/quota-warning.sh
> unix_listener quota-warning {
> group = vmail
> mode = 0660
> user = vmail
> }
> user = vmail
> }
> shutdown_clients = no
> ssl_ca = </apps/mail/dovecot/2.2.5/etc/dovecot/ssl/mayca.crt.pem
> ssl_cert =
</apps/mail/dovecot/2.2.5/etc/dovecot/ssl/mail1.mydomain.tld.pem
> ssl_key =
</apps/mail/dovecot/2.2.5/etc/dovecot/ssl/mail1.mydomain.tld.key
> ssl_parameters_regenerate = 30 hours
> submission_host = 127.0.0.1:587
> userdb {
> driver = prefetch
> }
> userdb {
> args = /apps/mail/dovecot/2.2.5/etc/dovecot/conf.d/dovecot-sql.conf.ext
> driver = sql
> }
> protocol lda {
> mail_plugins = " virtual quota zlib sieve zlib"
> }
> protocol imap {
> mail_plugins = " virtual quota zlib imap_quota imap_zlib"
> }
> protocol lmtp {
> debug_log_path = /var/log/dovecot-lmtp-debg.log
> mail_plugins = " virtual quota zlib sieve zlib"
> }
>
>