Cyrus 3.0.4 - Over quota returns 550-Mailbox unknown
Edda
letters001 at sendmaid.org
Thu Nov 2 09:38:51 EDT 2017
Hi,
that's surprising and the same here.
I think there is a bug in imap/lmtpengine.c, function process_recipient:
verify_user returns the correct error code as we can see with LOG_DEBUG
"on":
Nov 2 14:10:50 popc lmtp[2092]: verify_user(test at sendmaid.org) failed:
Over quota
but this return code is not used in process_recipient
There we have:
[...]
if (sl) {
char *rcpt = xstrndup(addr, sl);
mbname = mbname_from_recipient(rcpt, msg->ns);
free(rcpt);
int forcedowncase = config_getswitch(IMAPOPT_LMTP_DOWNCASE_RCPT);
if (forcedowncase) mbname_downcaseuser(mbname);
/* strip username if postuser */
if (!strcmpsafe(mbname_localpart(mbname),
config_getstring(IMAPOPT_POSTUSER))) {
mbname_set_localpart(mbname, NULL);
if (!config_virtdomains ||
!strcmpsafe(mbname_domain(mbname), config_defdomain))
mbname_set_domain(mbname, NULL);
}
if (verify_user(mbname,
(quota_t) (ignorequota ? -1 : msg->size),
ignorequota ? -1 : 1, msg->authstate)) {
mbname_free(&mbname);
}
}
if (!mbname) {
const char *catchall =
config_getstring(IMAPOPT_LMTP_CATCHALL_MAILBOX);
if (catchall) {
mbname = mbname_from_userid(catchall);
if (verify_user(mbname,
ignorequota ? -1 : msg->size,
ignorequota ? -1 : 1, msg->authstate)) {
mbname_free(&mbname);
}
}
}
if (!mbname) {
/* we lost */
return IMAP_MAILBOX_NONEXISTENT;
}
[...]
means as far as I understand: if verify_user returns its error (for
example IMAP_QUOTA_EXCEEDED), mbname is freed and process_recipient
always returns IMAP_MAILBOX_NONEXISTENT.
Below is a patch that works for me. But I don't know if this is a good
way to fix it.
Hopefully one of the developers helps :)
Regards, Edda
diff -Naur cyrus-imapd-3.0.4.orig/imap/lmtpengine.c
cyrus-imapd-3.0.4/imap/lmtpengine.c
--- cyrus-imapd-3.0.4.orig/imap/lmtpengine.c 2017-09-04
02:09:46.000000000 +0200
+++ cyrus-imapd-3.0.4/imap/lmtpengine.c 2017-11-02 13:59:56.764175245
+0100
@@ -830,6 +830,7 @@
}
mbname_t *mbname = NULL;
+ int r = 0;
size_t sl = strlen(addr);
if (addr[sl-1] == '>') sl--;
@@ -849,7 +850,7 @@
mbname_set_domain(mbname, NULL);
}
- if (verify_user(mbname,
+ if (r = verify_user(mbname,
(quota_t) (ignorequota ? -1 : msg->size),
ignorequota ? -1 : 1, msg->authstate)) {
mbname_free(&mbname);
@@ -860,7 +861,7 @@
const char *catchall =
config_getstring(IMAPOPT_LMTP_CATCHALL_MAILBOX);
if (catchall) {
mbname = mbname_from_userid(catchall);
- if (verify_user(mbname,
+ if (r = verify_user(mbname,
ignorequota ? -1 : msg->size,
ignorequota ? -1 : 1, msg->authstate)) {
mbname_free(&mbname);
@@ -870,6 +871,9 @@
if (!mbname) {
/* we lost */
+ if (r) {
+ return r;
+ }
return IMAP_MAILBOX_NONEXISTENT;
}
Am 02.11.17 um 09:27 schrieb Maros Vegh:
> Hello,
>
> i'm using compiled cyrus version 3.0.4 on Debian 9.2.
>
> When the Postfix server is trying to deliver a message via lmtp to
> cyrus mailbox which is over quota, it receives the 550-Mailbox unknown
> return code and not the 452 or 552 Over quota.
>
> In the previous version 2.5.10 it worked fine with default values in
> imapd.conf
>
> Is it a bug or my fault?
>
> Thanks
>
> Maros Vegh
>
>
More information about the Info-cyrus
mailing list