summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-06-22 09:48:47 +0100
committerGianni Ceccarelli <gianni.ceccarelli@broadbean.com>2023-06-22 09:48:47 +0100
commitaf611931b37945bf28c76c13460b63448a3de25b (patch)
treee08dfc76b81761806e792e8dc10ee0fd8e28f41d /lib
parentremove bad dep (diff)
downloadconfig-clawsmail-af611931b37945bf28c76c13460b63448a3de25b.tar.gz
config-clawsmail-af611931b37945bf28c76c13460b63448a3de25b.tar.bz2
config-clawsmail-af611931b37945bf28c76c13460b63448a3de25b.zip
move account section mangling
Diffstat (limited to 'lib')
-rw-r--r--lib/Config/ClawsMail/Account.pm5
-rw-r--r--lib/Config/ClawsMail/PasswordStoreParser.pm7
2 files changed, 3 insertions, 9 deletions
diff --git a/lib/Config/ClawsMail/Account.pm b/lib/Config/ClawsMail/Account.pm
index 67fc707..9f4b493 100644
--- a/lib/Config/ClawsMail/Account.pm
+++ b/lib/Config/ClawsMail/Account.pm
@@ -27,6 +27,7 @@ sub new_from_config {
return unless $config->{protocol} eq '1';
my $section = $args->{account_section};
+ (my $password_section = $section)=~ s{Account: }{account:};
my $password_store = $args->{password_store};
@@ -41,7 +42,7 @@ sub new_from_config {
),
ssl => $ssl_string[$config->{ssl_imap}],
%{$config}{qw(user_id)},
- password => $password_store->password_for($section,'recv'),
+ password => $password_store->password_for($password_section,'recv'),
});
my $smtp_server = Config::ClawsMail::Server->new({
@@ -56,7 +57,7 @@ sub new_from_config {
ssl => $ssl_string[$config->{ssl_smtp}],
( $config->{use_smtp_auth} ? (
user_id => $config->{smtp_user_id} || $config->{user_id},
- password => $password_store->password_for($section,'send') || $password_store->password_for($section,'recv')
+ password => $password_store->password_for($password_section,'send') || $password_store->password_for($password_section,'recv')
) : () ),
});
diff --git a/lib/Config/ClawsMail/PasswordStoreParser.pm b/lib/Config/ClawsMail/PasswordStoreParser.pm
index fe76b1e..0b875d8 100644
--- a/lib/Config/ClawsMail/PasswordStoreParser.pm
+++ b/lib/Config/ClawsMail/PasswordStoreParser.pm
@@ -6,13 +6,6 @@ use warnings;
use parent 'Config::INI::Reader';
# ABSTRACT: Config::INI::Reader tweaked for passwordstorerc
-sub parse_section_header {
- my ($head) = $_[1] =~ /^\s*\[\s*(.+?)\s*\]\s*$/
- or return;
- $head =~ s{account:}{Account: };
- return $head;
-}
-
sub parse_value_assignment {
return ($1, $2) if $_[1] =~ /^\s*([^\s\pC]+?)\s+(.*?)\s*$/;
return;