Hi Mike,
I put this code together and it works for me under GMail 2.2.0:
Code:
#!/usr/bin/perl -w
use strict;
use lib '/path/to/gmail/admin';
use GMail qw/:objects/;
#GMail::init('/path/to/gmail/admin');
my $sth = $DB->table('users')->select ( {}, ['email']);
my $users = $sth->fetchall_arrayref;
print $IN->header;
print "<pre>\n";
print "GMail users with forwarding turned on:\n";
print "--------------------------------------\n";
foreach my $user (@$users) {
$USER->load_user($user->[0]); # load the user
-f "$USER->{dir}/.prefs" or next;
print "$user->[0] has forwarding enabled.\n"
if $USER->{opts}->{mailbox}->{forward_email};
}
print "--------------------------------------\n";
I'm not sure how well it will work for you but drop me a note if it doesn't. You will need to edit the
use lib '...' and
GMail::init(...) lines for your install. Hmm, now that I think about it, you should comment out the
GMail::init line for anything under GMail 2.2.0.
~Charlie