commit 4a735b997384098182ff11ac0c93cb0b0a794984 from: jrmu date: Tue Mar 07 03:09:24 2023 UTC Moved mail out of Mail module so Mail can be disabled commit - f8e21ca0c3b0a799d18704d6ce806af11b1fe289 commit + 4a735b997384098182ff11ac0c93cb0b0a794984 blob - 28bd1adf6bf5711fbf93dfaf8e265d7ab65b1bd2 blob + 461514fc5dc2a77ba272186f663be6b698eae990 --- BNC.pm +++ BNC.pm @@ -435,7 +435,7 @@ reply in order to keep your account. IRCNow EOF - Mail::mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); + main::mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); } sub mtaillog { blob - d6c2d94abc841244afc88265e509634ce5f38a8b blob + 81631a1683bc2333835448ed59facc6cd8d9e20a --- Mail.pm +++ Mail.pm @@ -195,25 +195,6 @@ sub mmail { } } -sub mail { - my( $from, $to, $fromname, $subject, $body )=@_; -my $msg = <<"EOF"; -From: $from -To: $to -Subject: $subject -MIME-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline - -$body -EOF -open(my $fh, "| /usr/sbin/sendmail -tv -F '$fromname' -f $from") or die "Could not send mail $!"; -print $fh $msg; -close $fh; -return "true"; -} - - sub mailmail { my( $username, $password, $email )=@_; my $approvemsg; @@ -247,7 +228,7 @@ Connection Instructions: https://wiki.ircnow.org/?n=Em IRCNow EOF - mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); + main::mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); } blob - 085e7ba30c93824409b73dacdd0fd3285a5919da blob + 700b136f4bfa8609343c6c4c342096683b4b07ca --- Shell.pm +++ Shell.pm @@ -221,7 +221,7 @@ reply in order to keep your account. IRCNow EOF - Mail::mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); + main::mail($mailfrom, $email, $mailname, "Verify IRCNow Account", $body); } blob - 967a11bd5552fb045109026b6e9bf75fc918c3ba blob + 258bb9db5be5d0996d84148bf4f038769cea4a55 --- botnow +++ botnow @@ -56,6 +56,24 @@ sub date { my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); my $localtime = sprintf("%04d%02d%02d", $year+1900, $mon+1, $mday); return $localtime; +} + +sub mail { + my( $from, $to, $fromname, $subject, $body )=@_; +my $msg = <<"EOF"; +From: $from +To: $to +Subject: $subject +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +$body +EOF +open(my $fh, "| /usr/sbin/sendmail -tv -F '$fromname' -f $from") or die "Could not send mail $!"; +print $fh $msg; +close $fh; +return "true"; } # Path to configuration file