Changeset 194

Show
Ignore:
Timestamp:
09/14/07 11:28:56 (16 months ago)
Author:
tgenannt
Message:

- Added some logging to listMailer.pl

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/localization

    • Property svn:ignore
      •  

        old new  
        1 *.mo 
         1de_DE.UTF-8/LC_MESSAGES/cpves.mo 
  • trunk/system_scripts/listMailer.pl

    r168 r194  
    1717#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. 
    1818 
    19 use strict; 
     19#use strict; 
    2020use MIME::Entity; 
    2121use Email::Simple; 
     
    2424use Config::General; 
    2525use Net::SMTP; 
     26use Sys::Syslog; 
    2627 
    2728my $sender; 
     
    3839$config{'mailserver_smtp'} = "127.0.0.1" unless defined $config{'mailserver_smtp'}; 
    3940$config{'ml_postmaster'} = 'postmaster@localhost' unless defined $config{'ml_postmaster'}; 
     41my $dsn = "DBI:mysql:database=".$config{'db_name'}.";host=".$config{'db_host'}; 
    4042 
    41 my $dsn = "DBI:mysql:database=".$config{'db_name'}.";host=".$config{'db_host'}; 
     43openlog('listMailer', "ndelay,pid", LOG_MAIL); 
    4244 
    4345while (<stdin>) { 
     
    5759if( $efinder->find(\$mail->header("From")) != 1 ) { 
    5860 #end, because of invalid email! 
     61 syslog(LOG_ERR, 'No valid sender address given'); 
    5962 exit(0); 
    6063} 
     
    7376 $sth->finish(); 
    7477 $dbh->disconnect(); 
     78 syslog(LOG_ERR, 'No valid mailinglist found '); 
    7579 exit(0); 
    7680} 
     
    148152  $e_send_to->send; 
    149153  $e_send_to->stringify; 
     154  syslog(LOG_WARNING, sprintf('sender %s is not allowed for private list %s', $sender, $list)); 
    150155 } else { 
    151156  # Send Mail to all subscribed 
    152157  @addresses = getAllAddresses($row->{id}); 
     158  syslog(LOG_INFO, sprintf('sending from %s for private listid %s', $sender, $list)); 
    153159  sendto($mail->as_string , $sender); 
    154160 } 
     
    156162 # Send Mail to all subscribed 
    157163 @addresses = getAllAddresses($row->{id}); 
     164 syslog(LOG_INFO, sprintf('sending from %s for public listid %s', $sender, $list)); 
    158165 sendto($mail->as_string , $sender); 
    159166}