| 1 | package Net::IMAP::Server::Command::Check; | ||
| 2 | |||
| 3 | use warnings; | ||
| 4 | use strict; | ||
| 5 | |||
| 6 | use base qw/Net::IMAP::Server::Command/; | ||
| 7 | |||
| 8 | sub validate { | ||
| 9 | my $self = shift; | ||
| 10 | |||
| 11 | return $self->bad_command("Login first") if $self->connection->is_unauth; | ||
| 12 | return $self->bad_command("Select a mailbox first") | ||
| 13 | unless $self->connection->is_selected; | ||
| 14 | |||
| 15 | my @options = $self->parsed_options; | ||
| 16 | return $self->bad_command("Too many options") if @options; | ||
| 17 | |||
| 18 | return 1; | ||
| 19 | } | ||
| 20 | |||
| 21 | sub run { | ||
| 22 | my $self = shift; | ||
| 23 | $self->connection->poll; | ||
| 24 | $self->ok_completed(); | ||
| 25 | } | ||
| 26 | |||
| 27 | 1; |