[Dovecot] attachments not with email causing FETCH BODY[] failed
Hi,
Anyone else experiencing this (Dovecot 2.2.4, attachments stored separately):
dovecot: imap(user@kamdha.com): Error: file_istream.open(/home/ example.com/user/attachments/f5/f0/f5f0f2c08c4311fa404d090a703c3b492f2ea718-a52388285a04eb51820c0000d485234e-c92f64f79f0d1ed01e6d5b314f04886c-42501) failed: No such file or directory dovecot: imap(user@example.com): Error: read(BODY[]) failed: No such file or directory (FETCH for mailbox INBOX UID 42501) dovecot: imap(user@example.com): Disconnected: FETCH failed in=186 out=86389
My dovecot.conf attachment related config is:
mail_attachment_dir = /home/%d/%n/attachments mail_attachment_min_size = 128k mail_attachment_fs = sis posix mail_attachment_hash = %{sha1}
So, questions:
- anyone else experiencing this?
- how might this occurred?
- what is the best way to find the corrupted message?
- how should I go about fixing this?
Any help or pointers would be appreciated.
Thanks, Anand
On 2013-07-21 10:12 AM, Anand Kumria <wildfire@progsoc.org> wrote:
My dovecot.conf attachment related config is:
No, please don't provide copy/pastes of config files.
Always provide FULL doveconf -n output (and postfix -n output when it may be related to postfix)...
--
Best regards,
Charles
On 21.7.2013, at 17.12, Anand Kumria <wildfire@progsoc.org> wrote:
Anyone else experiencing this (Dovecot 2.2.4, attachments stored separately):
dovecot: imap(user@kamdha.com): Error: file_istream.open(/home/ example.com/user/attachments/f5/f0/f5f0f2c08c4311fa404d090a703c3b492f2ea718-a52388285a04eb51820c0000d485234e-c92f64f79f0d1ed01e6d5b314f04886c-42501) failed: No such file or directory dovecot: imap(user@example.com): Error: read(BODY[]) failed: No such file or directory (FETCH for mailbox INBOX UID 42501) dovecot: imap(user@example.com): Disconnected: FETCH failed in=186 out=86389
I can think of one reason why this would happen that doesn't involve an actual Dovecot bug:
First session starts fetching the message. It manages to open the sdbox file. Another sesssion deletes the mail and the attachment. The first session can still read the sdbox file, but can't access the attachment. But unless you were stress testing, this is quite unlikely.
- how might this occurred?
- what is the best way to find the corrupted message?
- how should I go about fixing this?
I'd also like to know how it could have happened (other than accidental rm -rf). You could also later try again to read the mail, for example:
doveadm fetch -u user@kamdha.com text mailbox inbox uid 42501
Does that fail with the same error? Do you see anything with:
ls /home/example.com/user/attachments/f5/f0/f5f0f2c08c4311fa404d090a703c3b492f2ea718*
Hi Timo,
On 5 August 2013 19:19, Timo Sirainen <tss@iki.fi> wrote:
On 21.7.2013, at 17.12, Anand Kumria <wildfire@progsoc.org> wrote:
Anyone else experiencing this (Dovecot 2.2.4, attachments stored separately):
dovecot: imap(user@kamdha.com): Error: file_istream.open(/home/
example.com/user/attachments/f5/f0/f5f0f2c08c4311fa404d090a703c3b492f2ea718-a52388285a04eb51820c0000d485234e-c92f64f79f0d1ed01e6d5b314f04886c-42501 )
failed: No such file or directory dovecot: imap(user@example.com): Error: read(BODY[]) failed: No such file or directory (FETCH for mailbox INBOX UID 42501) dovecot: imap(user@example.com): Disconnected: FETCH failed in=186 out=86389
I can think of one reason why this would happen that doesn't involve an actual Dovecot bug:
First session starts fetching the message. It manages to open the sdbox file. Another sesssion deletes the mail and the attachment. The first session can still read the sdbox file, but can't access the attachment. But unless you were stress testing, this is quite unlikely.
- how might this occurred?
- what is the best way to find the corrupted message?
- how should I go about fixing this?
I'd also like to know how it could have happened (other than accidental rm -rf). You could also later try again to read the mail, for example:
I actually have to make an effort to get access to the box, so it wasn't anything on the command line.
doveadm fetch -u user@kamdha.com text mailbox inbox uid 42501
Does that fail with the same error?
Yes.
Do you see anything with:
ls /home/ example.com/user/attachments/f5/f0/f5f0f2c08c4311fa404d090a703c3b492f2ea718*
No
I did some further analysis and after learning how 'doveadm fetch' works, all the problem messages have a common problem.
Basically it appears that I configured:
userA@example.com
and
userA@kamdha.com
to *both* have the same storage location.
i.e. /home/kamdha/com/user
And the 'mail_location' variable is set to 'sdbox:~/mail'
*AND* 'mail_attachment_dir' is specified as '/home/%d/%u/attachments'.
The primary domain is kamdha.com; all of the problem messages are addressed to userA@example.com.
So if something was sent to userA@example.com it would wind up in /home/ example.com/userA/..../ but the mail in /home/kamdha.com/userA would reference a location that it didn't know about.
My read of things was that '~' is *ONLY* valid in mail_location. If I could specify mail_attachment_dir to be '~/attachments', then things should work.
Is my read of things correct?
Thanks, Anand
On 5.8.2013, at 21.38, Anand Kumria <wildfire@progsoc.org> wrote:
Basically it appears that I configured:
userA@example.com
and
userA@kamdha.com
to *both* have the same storage location.
i.e. /home/kamdha/com/user
And the 'mail_location' variable is set to 'sdbox:~/mail'
*AND* 'mail_attachment_dir' is specified as '/home/%d/%u/attachments'.
The primary domain is kamdha.com; all of the problem messages are addressed to userA@example.com.
So if something was sent to userA@example.com it would wind up in /home/ example.com/userA/..../ but the mail in /home/kamdha.com/userA would reference a location that it didn't know about.
Ah, that explains it.
My read of things was that '~' is *ONLY* valid in mail_location. If I could specify mail_attachment_dir to be '~/attachments', then things should work.
You can use %h/attachments.
participants (3)
-
Anand Kumria
-
Charles Marcus
-
Timo Sirainen