[exim] [Patch] LMTP Ignorequota extension

Página Inicial
Delete this message
Reply to this message
Autor: Adam Stephens
Data:  
Para: exim-users
Assunto: [exim] [Patch] LMTP Ignorequota extension
Here's a patch for exim's LMTP transport, implementing the IGNOREQUOTA
extension to LMTP*. Set 'ignore_quota = yes' in the transport options to
deliver even to overquota mailboxes.

This has had minimal testing only, so please don't blame me if it eats
your email.

Adam.
*http://www.oceana.com/ftp/drafts/draft-murchison-lmtp-ignorequota-02.txt
--------------------------------
Adam Stephens
Network Specialist - Email & DNS
adam.stephens@???diff -cr src/transports/lmtp.c src/transports.new/lmtp.c
*** src/transports/lmtp.c    2005-07-11 16:33:42.412468200 +0100
--- src/transports.new/lmtp.c    2005-07-11 15:43:28.400667000 +0100
***************
*** 28,33 ****
--- 28,35 ----
        (void *)offsetof(transport_instance, batch_max) },
    { "command",           opt_stringptr,
        (void *)offsetof(lmtp_transport_options_block, cmd) },
+   { "ignore_quota",     opt_bool,
+       (void *)offsetof(lmtp_transport_options_block, ignore_quota) },
    { "socket",            opt_stringptr,
        (void *)offsetof(lmtp_transport_options_block, skt) },
    { "timeout",           opt_time,
***************
*** 44,49 ****
--- 46,52 ----
  
  lmtp_transport_options_block lmtp_transport_option_defaults = {
    NULL,           /* cmd */
+   FALSE,      /* ignore_quota */
    NULL,           /* skt */
    5*60,           /* timeout */
    0               /* options */
***************
*** 455,460 ****
--- 458,464 ----
  int fd_in = -1, fd_out = -1;
  int code, save_errno;
  BOOL send_data;
+ BOOL ignore_quota = ob->ignore_quota;
  BOOL yield = FALSE;
  address_item *addr;
  uschar *sockname = NULL;
***************
*** 575,582 ****
  send_data = FALSE;
  for (addr = addrlist; addr != NULL; addr = addr->next)
    {
!   if (!lmtp_write_command(fd_in, "RCPT TO:<%s>\r\n",
!        transport_rcpt_address(addr, tblock->rcpt_include_affixes)))
      goto WRITE_FAILED;
    if (lmtp_read_response(out, buffer, sizeof(buffer), '2', timeout))
      {
--- 579,588 ----
  send_data = FALSE;
  for (addr = addrlist; addr != NULL; addr = addr->next)
    {
!   if ( ignore_quota == TRUE ) Ustrcpy(buffer, " IGNOREQUOTA");
!   else Ustrcpy(buffer, "");
!   if (!lmtp_write_command(fd_in, "RCPT TO:<%s>%s\r\n",
!        transport_rcpt_address(addr, tblock->rcpt_include_affixes), buffer ))
      goto WRITE_FAILED;
    if (lmtp_read_response(out, buffer, sizeof(buffer), '2', timeout))
      {
diff -cr src/transports/lmtp.h src/transports.new/lmtp.h
*** src/transports/lmtp.h    2005-07-11 16:33:42.983381408 +0100
--- src/transports.new/lmtp.h    2005-07-11 15:42:52.796080000 +0100
***************
*** 11,16 ****
--- 11,17 ----
  
  typedef struct {
    uschar *cmd;
+   BOOL    ignore_quota;
    uschar *skt;
    int   timeout;
    int   options;