- Timestamp:
- 12/12/11 17:57:31 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r196 r197 38 38 &domStatus &importAXFR 39 39 &export 40 &mailNotify 40 41 %typemap %reverse_typemap %config 41 42 %permissions @permtypes $permlist … … 57 58 &domStatus &importAXFR 58 59 &export 60 &mailNotify 59 61 %typemap %reverse_typemap %config 60 62 %permissions @permtypes $permlist … … 2046 2048 2047 2049 2050 ## DNSDB::mailNotify() 2051 # Sends notification mail to recipients regarding an IPDB operation 2052 sub mailNotify { 2053 my $dbh = shift; 2054 my ($subj,$message) = @_; 2055 2056 return if $config{mailhost} eq 'smtp.example.com'; # do nothing if still using default SMTP host. 2057 2058 my $mailer = Net::SMTP->new($config{mailhost}, Hello => "dnsadmin.$config{domain}"); 2059 2060 my $mailsender = ($config{mailsender} ? $config{mailsender} : $config{mailnotify}); 2061 2062 $mailer->mail($mailsender); 2063 $mailer->to($config{mailnotify}); 2064 $mailer->data("From: \"$config{mailname}\" <$mailsender\n", 2065 "To: $config{mailnotify}\n", 2066 "Date: ".strftime("%a, %d %b %Y %H:%M:%S %z",localtime)."\n", 2067 "Subject: $subj\n", 2068 "X-Mailer: DNSAdmin Notify v".sprintf("%.1d",$DNSDB::VERSION)."\n", 2069 "Organization: $config{orgname}\n", 2070 "\n$message\n"); 2071 $mailer->quit; 2072 } 2073 2048 2074 # shut Perl up 2049 2075 1;
Note:
See TracChangeset
for help on using the changeset viewer.