--- lib/RT/Crypt/GnuPG.pm	2008-08-29 15:50:00.000000000 +0000
+++ local/lib/RT/Crypt/GnuPG.pm	2008-09-04 19:45:39.000000000 +0000
@@ -435,6 +435,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnuPGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined $args{'Passphrase'};
+
     $opt{'digest-algo'} ||= 'SHA1';
     $opt{'default_key'} = $args{'Signer'}
         if $args{'Sign'} && $args{'Signer'};
@@ -446,10 +451,6 @@
 
     my $entity = $args{'Entity'};
 
-    # handling passphrase in GnuPGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined $args{'Passphrase'};
-
     if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
         $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
     }
@@ -610,6 +611,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $opt{'default_key'} = $args{'Signer'}
         if $args{'Sign'} && $args{'Signer'};
@@ -619,10 +625,6 @@
         meta_interactive => 0,
     );
 
-    # handling passphrase in GnupGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
         $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
     }
@@ -694,6 +696,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $opt{'default_key'} = $args{'Signer'}
         if $args{'Sign'} && $args{'Signer'};
@@ -703,10 +710,6 @@
         meta_interactive => 0,
     );
 
-    # handling passphrase in GnupGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
         $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
     }
@@ -792,6 +795,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $opt{'default_key'} = $args{'Signer'}
         if $args{'Sign'} && $args{'Signer'};
@@ -801,10 +809,6 @@
         meta_interactive => 0,
     );
 
-    # handling passphrase in GnupGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     if ( $args{'Sign'} && !defined $args{'Passphrase'} ) {
         $args{'Passphrase'} = GetPassphrase( Address => $args{'Signer'} );
     }
@@ -1131,6 +1135,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $gnupg->options->hash_init(
         _PrepareGnuPGOptions( %opt ),
@@ -1142,10 +1151,6 @@
         RT::EmailParser->_DecodeBody($args{'Data'});
     }
 
-    # handling passphrase in GnupGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
@@ -1205,6 +1210,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnuPGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $gnupg->options->hash_init(
         _PrepareGnuPGOptions( %opt ),
@@ -1216,10 +1226,6 @@
         RT::EmailParser->_DecodeBody($args{'Data'});
     }
 
-    # handling passphrase in GnuPGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
@@ -1336,6 +1343,11 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnuPGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $gnupg->options->hash_init(
         _PrepareGnuPGOptions( %opt ),
@@ -1347,10 +1359,6 @@
         RT::EmailParser->_DecodeBody($args{'Data'});
     }
 
-    # handling passphrase in GnuPGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
@@ -1386,16 +1394,17 @@
 
     my $gnupg = new GnuPG::Interface;
     my %opt = RT->Config->Get('GnuPGOptions');
+
+    # handling passphrase in GnupGOptions
+    $args{'Passphrase'} = delete $opt{'passphrase'}
+        if !defined($args{'Passphrase'});
+
     $opt{'digest-algo'} ||= 'SHA1';
     $gnupg->options->hash_init(
         _PrepareGnuPGOptions( %opt ),
         meta_interactive => 0,
     );
 
-    # handling passphrase in GnupGOptions
-    $args{'Passphrase'} = delete $opt{'passphrase'}
-        if !defined($args{'Passphrase'});
-
     $args{'Passphrase'} = GetPassphrase()
         unless defined $args{'Passphrase'};
 
