From 419487240780f1e789c8f7d948167feb8f010e03 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 20 Mar 2011 23:13:01 +0100 Subject: Fix silly bug in last commit --- fripost-adduser | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'fripost-adduser') diff --git a/fripost-adduser b/fripost-adduser index ba97cdf..8f2486a 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -105,12 +105,12 @@ $msg->attr('content-type.charset' => 'utf-8'); { my ($vars, $data); $vars = {}; + $tt->process('new_user_mail.tt', $vars, \$data) || die $tt->error(), '\n'; - - $msg->replace(To => $user->{username}); $msg->data($data); + $msg->replace(To => $user->{username}); unless ($conf->{pretend}) { $msg->send() unless $conf->{pretend};; @@ -131,9 +131,9 @@ $msg->attr('content-type.charset' => 'utf-8'); pass => $user->{password}, real => $user->{name}, }; + $tt->process('user_info.tt', $vars, \$data) || die $tt->error(), '\n'; - $msg->data($data); dsay "-----------------------------------"; @@ -145,6 +145,7 @@ $msg->attr('content-type.charset' => 'utf-8'); confirm_or_abort("Send email with login information? "); my $to = prompt_email("Where should the email be sent? "); $msg->replace(To => $to); + if (!$conf->{pretend}) { $msg->send; say "Credentials sent."; -- cgit v1.2.3 From c2d0d8bc220db97f11d53460b3de3e7e90850b91 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 20 Mar 2011 23:54:10 +0100 Subject: Use correct encoding in adduser mail --- fripost-adduser | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fripost-adduser') diff --git a/fripost-adduser b/fripost-adduser index 8f2486a..368d4e4 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -1,8 +1,9 @@ #!/usr/bin/perl use 5.010_000; -use warnings; use strict; +use warnings; +use utf8; =head1 NAME @@ -10,12 +11,11 @@ fripost-adduser - Add a new mailbox to the system =cut -our $VERSION = '0.02'; - use FindBin qw($Bin); use lib "$Bin/lib"; use Data::Dumper; +use Encode qw(encode); use File::Slurp qw(slurp); use Fripost::Password; use Fripost::Prompt; @@ -94,8 +94,8 @@ my $tt = Template->new({ }) || die "$Template::ERROR\n"; my $msg = MIME::Lite->new( - From => 'Friposts administratörer ', - Subject => "=?UTF-8?B?" . encode_base64('Välkommen till Fripost!' . "?=", + From => encode('MIME-Q', 'Friposts administratörer') . ' ', + Subject => encode('MIME-Q', 'Välkommen till Fripost!'), Encoding => 'quoted-printable', ); -- cgit v1.2.3 From d08d7c879d1224b1bafb068996c760f4fa5d8957 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sun, 20 Mar 2011 23:54:22 +0100 Subject: Subscribe new users to announce mailing list --- fripost-adduser | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'fripost-adduser') diff --git a/fripost-adduser b/fripost-adduser index 368d4e4..e96c5f3 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -155,6 +155,16 @@ $msg->attr('content-type.charset' => 'utf-8'); } } +### Subscribe user to announce-list +{ + confirm_or_abort("Subscribe user to announce mailing list? "); + $msg->replace(From => $user->{username}); + $msg->replace(To => 'announce-subscribe@lists.fripost.org'); + $msg->replace(Subject => ''); + $msg->replace(Data => ''); + $msg->send(); +} + =head1 AUTHOR Stefan Kangas C<< >> -- cgit v1.2.3 From 7a522692d79d68d276fad9edf233530f68dadb7e Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Mon, 21 Mar 2011 22:24:24 +0100 Subject: Send confirmation when adding new alias --- fripost-adduser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fripost-adduser') diff --git a/fripost-adduser b/fripost-adduser index e96c5f3..b72ae30 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -113,7 +113,7 @@ $msg->attr('content-type.charset' => 'utf-8'); $msg->replace(To => $user->{username}); unless ($conf->{pretend}) { - $msg->send() unless $conf->{pretend};; + $msg->send() unless $conf->{pretend}; say "Sent welcome message."; } dsay "-----------------------------------"; -- cgit v1.2.3 From 205da09d85274f993fe7343b6517f96c2f2b78dc Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 5 Apr 2011 22:12:10 +0200 Subject: Do not ask for real name when adding user --- fripost-adduser | 4 ---- 1 file changed, 4 deletions(-) (limited to 'fripost-adduser') diff --git a/fripost-adduser b/fripost-adduser index b72ae30..db312a2 100755 --- a/fripost-adduser +++ b/fripost-adduser @@ -51,7 +51,6 @@ my $schema = Fripost::Schema->connect( my $user; { my $username = prompt_email("New username: ", 'is_user'); - my $name = prompt "Full (real) name: "; my $domain = (split /\@/, $username)[1]; my $maildir = "$domain/". (split /\@/, $username)[0] . "/Maildir/"; # trailing slash important my $active = 1; @@ -59,7 +58,6 @@ my $user; $user = { username => $username, - name => $name, domain => $domain, maildir => $maildir, active => $active, @@ -67,7 +65,6 @@ my $user; }; say "User name: $user->{username}"; - say "Real name: $user->{name}"; say "Password: (hidden)"; confirm_or_abort(); @@ -129,7 +126,6 @@ $msg->attr('content-type.charset' => 'utf-8'); $vars = { user => $user->{username}, pass => $user->{password}, - real => $user->{name}, }; $tt->process('user_info.tt', $vars, \$data) -- cgit v1.2.3