@@ -131,7 +131,8 @@ sub show_usage {
131131 $imapauth , $oauthclientid , $oauthuri ,
132132 $imapdmarcfolder , $imapdmarcproc , $imapdmarcerr ,
133133 $imaptlsfolder , $imaptlsproc , $imaptlserr ,
134- $tlsverify , $processInfo );
134+ $tlsverify , $processInfo ,
135+ $clear_token );
135136
136137# defaults
137138$maxsize_xml = 50000;
@@ -142,6 +143,7 @@ sub show_usage {
142143$dmarc_only = 1;
143144$reports_replace = 0;
144145$imapauth = ' simple' ;
146+ $clear_token = 0;
145147
146148# used in messages
147149my $scriptname = ' Open Report Parser' ;
@@ -198,7 +200,7 @@ sub show_usage {
198200 TS_MBOX_FILE => 3,
199201 TS_ZIP_FILE => 4,
200202 TS_JSON_FILE => 5 };
201- GetOptions( \%options , ' d' , ' r' , ' x' , ' j' , ' m' , ' e' , ' i' , ' z' , ' delete' , ' info' , ' c' => \$conf_file );
203+ GetOptions( \%options , ' d' , ' r' , ' x' , ' j' , ' m' , ' e' , ' i' , ' z' , ' delete' , ' info' , ' c' => \$conf_file , ' clear ' );
202204
203205# locate conf file or die
204206if ( -e $conf_file ) {
@@ -299,6 +301,7 @@ sub show_usage {
299301if (exists $options {delete }) {$delete_reports = 1;}
300302if (exists $options {info }) {$processInfo = 1;}
301303if (exists $options {tls }) {$dmarc_only = -1;}
304+ if (exists $options {clear }) {$clear_token = 1;}
302305
303306# Cludgy, but it lets us preserve filename for dbx_postgres.pl
304307my $dbitype = ' mysql' ;
@@ -415,7 +418,7 @@ sub show_usage {
415418 elsif ($imapauth eq ' oauth2' ) {
416419 printDebug(" using oauth2" );
417420 # get the bearer token
418- my $oauth2token = OAuth::get_oauth($oauthuri , $oauthclientid , $dbh , $db_tx_support );
421+ my $oauth2token = OAuth::get_oauth($oauthuri , $oauthclientid , $dbh , $db_tx_support , $clear_token );
419422
420423 # authenticate
421424 my $oauth_b64 = encode_base64(" user=" .$imapuser ." \x01 auth=Bearer " .$oauth2token ." \x01\x01 " ,' ' );
0 commit comments