From: Kevin G. <ke...@go...> - 2002-09-19 00:09:08
|
It's almost certainly a routing/DNS/email problem with that machine, you'll have to track that down on your end. If you're having trouble running the debugger with Log4perl, try using Log::Dispatch by itself. Jose Vicente Nunez Zuleta wrote: > Is really bizarre... i tested the code on another machine and it works. But if i use your code in the same machine then no email is sent. > > At least i known that the "server" property works :) > > I went and run a small program i have that uses Net::SMTP directly and this is what i got (the email is sent): > > Net::SMTP: Net::SMTP(2.15) > Net::SMTP: Net::Cmd(2.18) > Net::SMTP: Exporter(5.562) > Net::SMTP: IO::Socket::INET(1.25) > Net::SMTP: IO::Socket(1.26) > Net::SMTP: IO::Handle(1.21) > > Net::SMTP=GLOB(0x103244)<<< 220 ZZZZ ESMTP Sendmail WWW/WWW; Wed, 18 Sep 2002 18:08:38 -0400 > Net::SMTP=GLOB(0x103244)>>> EHLO YYYY > Net::SMTP=GLOB(0x103244)<<< 250-ZZZZZ Hello sol0001.ZZZZZ [XX.XX.XX.XX], pleased to meet you > Net::SMTP=GLOB(0x103244)<<< 250-ENHANCEDSTATUSCODES > Net::SMTP=GLOB(0x103244)<<< 250-8BITMIME > Net::SMTP=GLOB(0x103244)<<< 250-SIZE > Net::SMTP=GLOB(0x103244)<<< 250-DSN > Net::SMTP=GLOB(0x103244)<<< 250-ONEX > Net::SMTP=GLOB(0x103244)<<< 250-ETRN > Net::SMTP=GLOB(0x103244)<<< 250-XUSR > Net::SMTP=GLOB(0x103244)<<< 250 HELP > Net::SMTP=GLOB(0x103244)>>> MAIL FROM:<KKKKK> > Net::SMTP=GLOB(0x103244)<<< 250 2.1.0 <KKKKK>... Sender ok > Net::SMTP=GLOB(0x103244)>>> RCPT TO:<KKKKK> > Net::SMTP=GLOB(0x103244)<<< 250 2.1.5 <KKKK>... Recipient ok > Net::SMTP=GLOB(0x103244)>>> DATA > Net::SMTP=GLOB(0x103244)<<< 354 Enter mail, end with "." on a line by itself > Net::SMTP=GLOB(0x103244)>>> To: KKKK > Net::SMTP=GLOB(0x103244)>>> Subject: Testing mail program > Net::SMTP=GLOB(0x103244)>>> > Net::SMTP=GLOB(0x103244)>>> This is a test message > > Net::SMTP=GLOB(0x103244)>>> . > Net::SMTP=GLOB(0x103244)<<< 250 2.0.0 g8IM8cu32649 Message accepted for delivery > Net::SMTP=GLOB(0x103244)>>> QUIT > Net::SMTP=GLOB(0x103244)<<< 221 2.0.0 ZZZZZ closing connection > > I'm clueless here. There is a way i can activate the Debug option from the logger so i can see whats going on? > > Thanks in advance. > > JV. > > On Wed, 18 Sep 2002 14:53:24 -0700 > Kevin Goess <ke...@go...> wrote: > > >>Jose, this works for me, I get an email just fine, note that mail.server >>should be your outgoing smtp server, right? >> >>--------------------------------------------- >>use Log::Log4perl; >> >>Log::Log4perl->init(\' >>log4perl.logger.Veronicad=DEBUG, screen, mail >>log4perl.appender.screen=Log::Dispatch::Screen >>log4perl.appender.screen.stderr=0 >>log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout >>log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>log4perl.appender.mail=Log::Dispatch::Email::MailSend >>log4perl.appender.mail.name=Veronicad >>log4perl.appender.mail.subject=Veronicad event >>log4perl.appender.mail.to=yo...@yo... *** >>log4perl.appender.mail.from=yo...@yo... *** >>log4perl.appender.mail.buffered=0 >>log4perl.appender.mail.server=mail.yourdomain.com *** >>log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout >>log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>'); >>my $logger = Log::Log4perl::get_logger("Veronicad"); >> >>$logger->error("Testing errors"); >>--------------------------------------------------------------- >> >>Jose Vicente Nunez Zuleta wrote: >> >>>First of all thanks for this cool port of the Log4j API; This tool is going to make our lives easier :) >>> >>>So far i managed to add the logging functionality to my application (part of my perl code): >>> >>>use constant OK_CODE => 0; >>>use constant ERROR_CODE => 1; >>>use constant LOG_CONFIG => "/usr/local/sysadmin/VeronicadLog4perl.properties"; >>>use constant REFRESH_LOG_CONFIG => 300; >>> >>># ----- END User configurable parameters -------- >>> >>># Start the logger >>>Log::Log4perl->init_and_watch(LOG_CONFIG, REFRESH_LOG_CONFIG); >>>my $logger = get_logger("Veronicad"); >>> >>>$logger->error("Testing errors"); >>> >>>And here is my configuration file info with three appenders: >>> >>>log4perl.logger.Veronicad=DEBUG, syslog, screen, mail >>>log4perl.appender.screen=Log::Dispatch::Screen >>>log4perl.appender.screen.stderr=0 >>>log4perl.appender.screen.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.screen.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>>log4perl.appender.syslog=Log::Dispatch::Syslog >>>log4perl.appender.syslog.name=Veronicad >>>log4perl.appender.syslog.facility=daemon >>>log4perl.appender.syslog.socket=inet >>>log4perl.appender.syslog.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.syslog.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>>log4perl.appender.mail=Log::Dispatch::Email::MailSend >>>log4perl.appender.mail.name=Veronicad >>>log4perl.appender.mail.subject=Veronicad event >>>log4perl.appender.mail.to=my...@em...dress >>>log4perl.appender.mail.from=sm...@em...dress >>>log4perl.appender.mail.buffered=0 >>>log4perl.appender.mail.server=my.mail.server <--- NOT SURE ABOUT THIS!!!!!! >>>log4perl.appender.mail.layout=Log::Log4perl::Layout::PatternLayout >>>log4perl.appender.mail.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n >>> >>>But the application doesn't sends an email when i got an error (just runs without sending the email): >>> >>>bash-2.04# ./Veronicad.pl >>>2002/09/18 14:36:16 ERROR> Veronicad.pl:34 main:: - Testing errors >>>2002/09/18 14:36:16 INFO> Veronicad.pl:45 main:: - [Server ./Veronicad.pl accepting clients] >>> >>> >>>So far reading the man page i found that "Log::Dispatch::Email::MailSend" is a subclass of 'Mail::Send' wich also inherits >>>from 'Mail::Mailer'. 'Mail::Mailer' can specify to use an external SMTP server like this: >>> >>>""smtp"" >>> Use the "smtp" protocol via Net::SMTP to deliver the >>> mail. The server to use can be specified in "@args" >>> with >>> >>> $mailer = new Mail::Mailer 'smtp', Server => $server; >>> >>> The smtp mailer does not handle "Cc" and "Bcc" lines, >>> neither their "Resent-*" fellows. The "Debug" options >>> enables debugging output from "Net::SMTP". >>> >>> >>>How i can achieve the same using 'Log::Dispatch::Email::MailSend' class? >>> >>>There is a environment variable i can set so i can force the ussage of this SMTP server? >>> >>>There is a way to debug if this is working? >>> >>>I can send email using the external mail server using Net::SMTP and that class is already installed on my system. >>> >>>Thanks in advance, >>> >>>Jose Vicente. >>> >>> >>> >> >> >>-- >>Happy Trails . . . >> >>Kevin M. Goess >>(and Anne and Frank) >>904 Carmel Ave. >>Albany, CA 94706 >>(510) 525-5217 >> > > > -- Happy Trails . . . Kevin M. Goess (and Anne and Frank) 904 Carmel Ave. Albany, CA 94706 (510) 525-5217 |