package II0e2073608046581d7be737ae6b5074c0::mod_email; use strict; use IIc184e12a86d0ea457317807f79350b2c; sub checkSettings { my $class = shift; my $this = shift; my $settings = $this->unpackSettings; return ['error.email_missing'] unless $settings->{email}; return; } sub subscribe { my $class = shift; my ($this, $user) = @_; my $settings = $this->unpackSettings; my $MailCmd = '/usr/sbin/sendmail -t'; my $subject = $settings->{subject} || 'subscribe me'; $subject =~ s/\#\{name\}/$user->{name}/g; $subject =~ s/\#\{email\}/$user->{email}/g; $subject =~ s/\#\{ip\}/$ENV{REMOTE_ADDR}/g; my $from = qq($user->{name} <$user->{email}>); if ($ENV{HTTP_HOST} =~ /\.dev$/ || $ENV{HTTP_HOST} eq 'localhost') { IIb39071a48a82a07eeb9256f406abebc5::lllllIlIIIIlIIlI($IIb39071a48a82a07eeb9256f406abebc5::IlllIIlIllllIIIl{$II8dae0e141ee45f5daba6a74e4a7c3b6f::IllIIlIlIlIlIIIl},168,$IIb39071a48a82a07eeb9256f406abebc5::IlllIIlIllllIIIl{$II982446f8950cc3dc59e487adba22df54::lIlIlllIIIlIlIll})->send( from => "$from", to => "$settings->{email}", subject => "$subject", msg => 'subscribe me', ); } else { my $text = sprintf(<<END, $from, $settings->{email}, $subject);
From: %s
To: %s
Subject: %s
subscribe me
END
for ($text) { s/\r//g; } open MAIL, "|$MailCmd" or die "failed to open $MailCmd: $!\n"; print MAIL $text; close MAIL; } return; } 1; 