Re: [Exim] Mails stay in queue longer than retry allows?

Top Page
Delete this message
Reply to this message
Author: Philip Hazel
Date:  
To: Michael Haardt
CC: exim-users
Subject: Re: [Exim] Mails stay in queue longer than retry allows?
On Thu, 11 Mar 2004, Michael Haardt wrote:

> 15:09:20 23799 locking /var/exim/spool/db/retry.lockfile
> 15:09:20 23799 locked /var/exim/spool/db/retry.lockfile
> 15:09:20 23799 opened hints database /var/exim/spool/db/retry: flags=0
> 15:09:20 23799 dbfn_read: key=T:vsmtp1.nbip.net:221.136.64.179
> 15:09:20 23799 dbfn_read: key=T:vsmtp1.nbip.net:221.136.64.179:1ArAJE-00066H-Jk
> 15:09:20 23799 no host retry record
> 15:09:20 23799 no message retry record
> 15:09:20 23799 vsmtp1.nbip.net [221.136.64.179] status = usable
>
> Why does it lock the retry database? When does it unlock it?


So that another process cannot modify it while it is reading it. It is a
read lock. The lock goes away when the lockfile is closed.

> The sessions ends with:


> 15:09:29 23798 LOG: MAIN
> 15:09:29 23798   == steve@??? R=outgoing T=t_outgoing defer (0): SMTP error from remote mailer after end of data: host vsmtp1.nbip.net [221.136.64.179]: 850 System is busy. aaQmAFlyUEBRITKE.1(26)
> 15:09:29 23798 ---0 Rst 0x81a9878    **      deliver.c 1000 16400
> 15:09:29 23798 >>>>>>>>>>>>>>>> deliveries are done >>>>>>>>>>>>>>>>
> 15:09:29 23798 changed uid/gid: post-delivery tidying
> 15:09:29 23798   uid=47 gid=47 pid=23798
> 15:09:29 23798   auxiliary group list: <none>
> 15:09:29 23798 set_process_info: 23798 tidying up after delivering 1ArAJE-00066H-Jk
> 15:09:29 23798 Processing retry items
> 15:09:29 23798 Succeeded addresses:
> 15:09:29 23798 Failed addresses:
> 15:09:29 23798 Deferred addresses:
> 15:09:29 23798 steve@???: no retry items

                                 ^^^^^^^^^^^^^^


That explains the observed effect. The question is "why"? I have put
this issue on my work list to look at more deeply. A very quick check
suggests starting around line 1582 of transports/smtp.c where this code
is to be found:

    /* If there's an errno, the message contains just the identity of
    the host. */


    if (code == '4')
      {
      if (save_errno > 0)
        message = US string_sprintf("%s: %s", message, strerror(save_errno));
      if (host->next != NULL) log_write(0, LOG_MAIN, "%s", message);
      deliver_msglog("%s %s\n", tod_stamp(tod_log), message);
      *message_defer = TRUE;
      }
    }


It may be that the first line should really be

if (code != '5')

to allow for weird responses like the 850 you were getting.

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book