1 |
use strict; |
use strict; |
2 |
|
|
3 |
|
my $mail_from = q<webmaster@suika.fam.cx>; |
4 |
|
my $mail_to = q<webmaster@suika.fam.cx>; |
5 |
|
my $subject_prefix = q<[suika.fam.cx account]>; |
6 |
|
|
7 |
my $user_data_dir_name = 'data/'; |
my $user_data_dir_name = 'data/'; |
8 |
my $user_prop_file_suffix = '.user'; |
my $user_prop_file_suffix = '.user'; |
9 |
|
|
216 |
return $pass_crypted; |
return $pass_crypted; |
217 |
} # check_password |
} # check_password |
218 |
|
|
219 |
|
sub send_mail ($$) { |
220 |
|
require Net::SMTP; |
221 |
|
require Encode; |
222 |
|
|
223 |
|
my $smtp = Net::SMTP->new ('localhost'); |
224 |
|
$smtp->mail ($mail_from); |
225 |
|
$smtp->to ($mail_to); |
226 |
|
## NOTE: What's wrong with UTF-8 Subject? :-) |
227 |
|
$smtp->data (Encode::encode ('utf-8', "From: <$mail_from> |
228 |
|
To: <$mail_to> |
229 |
|
Subject: $_[0] |
230 |
|
Content-Type: text/plain; charset=utf-8 |
231 |
|
MIME-Version: 1.0 |
232 |
|
|
233 |
|
$_[1]")); |
234 |
|
$smtp->send; |
235 |
|
} # send_mail |
236 |
|
|
237 |
sub system_ (@) { |
sub system_ (@) { |
238 |
(system join (' ', map {quotemeta $_} @_) . " > /dev/null") == 0 |
(system join (' ', map {quotemeta $_} @_) . " > /dev/null") == 0 |
239 |
or die "$0: $?"; |
or die "$0: $?"; |