I think the qouta handling done in the wrong way.
first: sort.c
2 times try for deliver, it wold be enought only one.


quota qives back SN_CLASS_TEMP; and so the mail will be hold by the local 
MTA so it is not good......
it should give back DSN_CLASS_FAIL (5) to avoid that.
It can be solved easely, because in pipe.c


        switch (sort_and_deliver(tmpmsgidnr,
                                                 header, headersize,
                                                 msgsize, rfcsize,
                                                 useridnr,
                                                 delivery->mailbox)) {
                        case DSN_CLASS_OK:
                                /* Indicate success. */
                                trace(TRACE_DEBUG,
                                      "%s, %s: successful sort_and_deliver 
for useridnr [%llu]",
                                      __FILE__, __func__, useridnr);
                                has_2 = 1;
                                break;
                        case DSN_CLASS_FAIL:
                                /* Indicate permanent failure. */
                                trace(TRACE_ERROR,
                                      "%s, %s: permanent failure 
sort_and_deliver for useridnr [%llu]",
                                      __FILE__, __func__, useridnr);
                                has_5 = 1;
                                break;
                        case DSN_CLASS_TEMP:
                        case -1:
                        default:
                                /* Assume a temporary failure */
                                trace(TRACE_ERROR,
                                      "%s, %s: temporary failure 
sort_and_deliver for useridnr [%llu]",
                                      __FILE__, __func__, useridnr);
                                has_4 = 1;
                                break;
                        } 
 
!!!but as we can see in sort.c DNS_CLASS_FAIL is not used !!
when by overqouta sort would give DSN_CLASS_FAIL
:

switch (dsnuser_worstcase_int(has_2, has_4, has_5)) {
                case DSN_CLASS_OK:
                        delivery->dsn.class = DSN_CLASS_OK;     /* Success. 
*/
                        delivery->dsn.subject = 1;      /* Address related. 
*/
                        delivery->dsn.detail = 5;       /* Valid. */
                        break;
                case DSN_CLASS_TEMP:
                        /* this following statement seems a bit dirty.. If 
                         * this is not used the MTA will always receive a 
                         * TEMP_FAIL messages, even when the only action 
                         * that is taken is to forward to an external 
address*/
                        if ((has_4 == 0) && 
                            (list_totalnodes(delivery->forwards) > 0)) 
                                delivery->dsn.class = DSN_CLASS_OK;
                        else
                                /* Temporary transient failure. */
                                delivery->dsn.class = DSN_CLASS_TEMP;

                        delivery->dsn.subject = 1;      /* Address related. 
*/
                        delivery->dsn.detail = 5;       /* Valid. */
                        break;
                case DSN_CLASS_FAIL:
                        delivery->dsn.class = DSN_CLASS_FAIL;   /* Permanent 
failure. */
                        delivery->dsn.subject = 1;      /* Address related. 
*/
                        delivery->dsn.detail = 1;       /* Does not exist. */
                        break;
                }

sould be: 
case DSN_CLASS_FAIL:
                        delivery->dsn.class = DSN_CLASS_FAIL;   /* Permanent 
failure. */
                        delivery->dsn.subject = 2;      /* Mailbox Status */
                        delivery->dsn.detail = 2;       /* Mailbox full */
                        break;
                }

(But I do not understand, why switch (dsnuser_worstcase_int(has_2, has_4, 
has_5)) is used why not handled in the first case part...(only one has_x can 
be set))  

But because it is possible to make more aliases of the same mailbox, and it 
works, like a shared folder, it can be found a other solution too,
but then when qouta is on the question is of accepting it or not, if one is 
overqouta.... in this case now , beacuse the 4xx error the mailbox is under 
qouta limit, becomes the message all time, the MTA tries to deliver the 
message.






Best Regards,
Udo Attila Fischer

Reply via email to