I got this working with a bit of hacking about. Here are
some notes:
1) In IMAPAssassin you'll need to set up your own socket:
use IO::Socket::SSL;
$client = new IO::Socket::SSL($your_ssl_host_here);
where $your_ssl_host_here is in the form "host.name.com:993"
or whatever port your SSL IMAP host is listening on.
2) Don't send the Server arg to the new method for IMAPClient.
In fact, I ended up doing my own auth so I use no flags
at all:
It should still be possible to send the user name and
password
here and then do $IMAP->login, but my server didn't like
that.
my $IMAP = Mail::IMAPClient->new();
3) The FAQ indicates that you *should* be able to associate the
socket directly like this
$IMAP->Socket( $client ); // Did not work for me
$IMAP->Connected(1); // Did not work for me
but in my experience that did not work. What did work was
adding
a method called use_socket() to Mail/IMAPClient.pm (in
the lib dir)
and calling it like this:
// In IMAPAssassin:
$IMAP->use_socket($client);
// In IMAPClient.pm
sub use_socket {
my $self = shift;
my ($sock) = @_;
The only difference here is that I am setting the state to
Connected, and there is a method that *should* do that as
well, but
I could not get it to work right. (Yes, and also
autoflush, but you
could do that in step 1 as well if you wanted to.)
That did the trick for me!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I would like to request an easier way for users of IMAPasassin to take advantage of SSL support. Perhaps a simple option in the configuration file would be useful?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Logged In: NO
I got this working with a bit of hacking about. Here are
some notes:
1) In IMAPAssassin you'll need to set up your own socket:
use IO::Socket::SSL;
$client = new IO::Socket::SSL($your_ssl_host_here);
where $your_ssl_host_here is in the form "host.name.com:993"
or whatever port your SSL IMAP host is listening on.
2) Don't send the Server arg to the new method for IMAPClient.
In fact, I ended up doing my own auth so I use no flags
at all:
It should still be possible to send the user name and
password
here and then do $IMAP->login, but my server didn't like
that.
my $IMAP = Mail::IMAPClient->new();
3) The FAQ indicates that you *should* be able to associate the
socket directly like this
$IMAP->Socket( $client ); // Did not work for me
$IMAP->Connected(1); // Did not work for me
but in my experience that did not work. What did work was
adding
a method called use_socket() to Mail/IMAPClient.pm (in
the lib dir)
and calling it like this:
// In IMAPAssassin:
$IMAP->use_socket($client);
// In IMAPClient.pm
sub use_socket {
my $self = shift;
my ($sock) = @_;
$self->Socket($sock);
$self->State(Connected);
$sock->autoflush(1);
}
The only difference here is that I am setting the state to
Connected, and there is a method that *should* do that as
well, but
I could not get it to work right. (Yes, and also
autoflush, but you
could do that in step 1 as well if you wanted to.)
That did the trick for me!
Logged In: YES
user_id=248045
Originator: NO
I would like to request an easier way for users of IMAPasassin to take advantage of SSL support. Perhaps a simple option in the configuration file would be useful?