--- postgrey.orig	Wed Mar 22 15:05:50 2006
+++ postgrey	Wed Mar 22 15:40:24 2006
@@ -384,6 +384,7 @@
         'lookup-by-subnet', 'lookup-by-host', 'auto-whitelist-clients:s', 
         'whitelist-clients=s@', 'whitelist-recipients=s@',
         'retry-window=s', 'greylist-action=s', 'greylist-text=s', 'privacy',
+        'noreuse|no-reuse|r',
     ) or exit(1);
     # note: lookup-by-subnet can be given for compatibility, but it is default
     # so do not do nothing with it...
@@ -461,6 +462,7 @@
             whitelist_recipients_files => $opt{'whitelist-recipients'} ||
                 [ '/usr/local/etc/postfix/postgrey_whitelist_recipients' ],
             privacy => defined $opt{'privacy'},
+            no_reuse => defined $opt{'noreuse'},
         },
     }, 'postgrey';
 
@@ -579,6 +581,11 @@
                 }
                 # give answer
                 print $fh "action=$action\n\n";
+                # close the filehandle if --no-reuse is set
+                if ($self->{net_server}->{postgrey}{no_reuse}) {
+                    close($fh);
+                    last;
+                } 
             }
             $self->{postgrey_attr} = {};
         }
@@ -628,6 +635,7 @@
                                   whitelisted (turned on by default with value 5)
                                   specify N=0 to disable.
      --privacy           store data using one-way hash functions
+     --no-reuse          don't reuse a socket for more than one query (exim compatible)
 
  Note that the --whitelist-x options can be specified multiple times,
  and that per default /usr/local/etc/postfix/postgrey_whitelist_clients.local is
