[Koha] Configuring smtp mail server to work with Koha

Paul Hoffman paul at flo.org
Thu Dec 7 07:59:52 NZDT 2017


Javed,

(Please reply to my message rather than starting a new thread.)

Could you please repeat this, but with a somewhat different sequence of 
commands?

    c C4::Letters::SendQueuedMessages
    c sendmail
    x \%mailcfg
    $mailcfg{'debug'} = 2
    r

Then post all of the output to the list.

Paul.

On Wed, Dec 06, 2017 at 11:47:18PM +0500, Javed Sahil wrote:
> Hi Paul,
> 
> here are your required results.
> 
> -- javed at iolhost:~$ koha-shell library
> [sudo] password for javed:
> library-koha at iolhost:~$ cd /usr/share/koha/bin/cronjobs
> library-koha at iolhost:/usr/share/koha/bin/cronjobs$ perl -d
> process_message_queue.pl
> 
> Loading DB routines from perl5db.pl version 1.49
> Editor support available.
> 
> Enter h or 'h h' for help, or 'man perldebug' for more help.
> 
> main::(process_message_queue.pl:32):
> 32:    my $username = undef;
>   DB<1> c C4::Letters::sendqueuedmessages
> Subroutine C4::Letters::sendqueuedmessages not found.
>   DB<2> c C4::Letters::SendQueuedMessages
> C4::Letters::SendQueuedMessages(/usr/share/koha/lib/C4/Letters.pm:1032):
> 1032:        my $params = shift;
>   DB<3> c sendmail
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:170):
> 170:        $error = '';
>   DB<4> t
> Trace = on
>   DB<4> r
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:171):
> 171:        $log = "Mail::Sendmail v. $VERSION - "    . scalar(localtime())
> . "\n";
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:173):
> 173:        my $CRLF = "\015\012";
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:174):
> 174:        local $/ = $CRLF;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:175):
> 175:        local $\ = ''; # to protect us from outside settings
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:176):
> 176:        local $_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:178):
> 178:        my (%mail, $k,
> 179:            $smtp, $server, $port, $connected, $localhost,
> 180:            $fromaddr, $recip, @recipients, $to, $header,
> 181:            %esmtp, @wanted_methods,
> 182:           );
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:232):
> 232:        foreach $k (keys %mailcfg) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:233):
> 233:            if ($k =~ /[A-Z]/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:239):
> 239:        while (@_) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:240):
> 240:            $k = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:241):
> 241:            if (!$k and $^W) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:246):
> 246:            $k = ucfirst lc($k);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:248):
> 248:            $k =~ s/\s*:\s*$//o; # kill colon (and possible spaces) at
> end, we add it later.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:251):
> 251:            $k =~ s/-(.)/"-" . uc($1)/ge;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:252):
> 252:            $mail{$k} = shift @_;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:253):
> 253:            if ($k !~ /^(Message|Body|Text)$/i) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:255):
> 255:                $mail{$k} =~ s/\015\012?/\012/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:256):
> 256:                $mail{$k} =~ s/\012/$CRLF/go;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:260):
> 260:        $smtp = $mail{'Smtp'} || $mail{'Server'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:261):
> 261:        unshift @{$mailcfg{'smtp'}}, $smtp if ($smtp and
> $mailcfg{'smtp'}->[0] ne $smtp);
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:267):
> 267:        delete $mail{'Smtp'}; delete $mail{'Server'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:267):
> 267:        delete $mail{'Smtp'}; delete $mail{'Server'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:269):
> 269:        $mailcfg{'port'} = $mail{'Port'} || $mailcfg{'port'} || 25;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:270):
> 270:        delete $mail{'Port'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:272):
> 272:        my $auth = $mail{'Auth'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:273):
> 273:        delete $mail{'Auth'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:277):
> 277:            local $^W = 0;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:277):
> 277:            local $^W = 0;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:278):
> 278:            $mail{'Message'} = join("", $mail{'Message'},
> $mail{'Body'}, $mail{'Text'});
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:282):
> 282:        delete $mail{'Body'}; delete $mail{'Text'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:282):
> 282:        delete $mail{'Body'}; delete $mail{'Text'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:286):
> 286:        $fromaddr = $mail{'Sender'} || $mail{'From'} ||
> $mailcfg{'from'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:288):
> 288:        unless ($fromaddr =~ /$address_rx/) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:291):
> 291:        $fromaddr = $1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:294):
> 294:        $mail{Date} ||= time_to_date() ;
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:143):
> 143:        my $time = $_[0] || time(); # default to now if no argument
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:145):
> 145:        my @months = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov
> Dec);
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:146):
> 146:        my @wdays  = qw(Sun Mon Tue Wed Thu Fri Sat);
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:148):
> 148:        my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
> 149:            = localtime($time);
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:151):
> 151:        my $TZ = $mailcfg{'tz'};
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:152):
> 152:        if ( $TZ eq "" ) {
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:154):
> 154:            my $offset  = sprintf "%.1f", (timegm(localtime) - time) /
> 3600;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:98):
> 98:        my ( $sec, $min, $hour, $mday, $month, $year ) = @_;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:100):
> 100:        if ( $year >= 1000 ) {
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:107):
> 107:        unless ( $Options{no_range_check} ) {
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:108):
> 108:            croak "Month '$month' out of range 0..11"
> 109:                if $month > 11
> 110:                or $month < 0;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:112):
> 112:        my $md = $MonthDays[$month];
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:113):
> 113:            ++$md
> 114:                if $month == 1 && _is_leap_year( $year + 1900 );
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:116):
> 116:            croak "Day '$mday' out of range 1..$md"  if $mday > $md or
> $mday < 1;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:117):
> 117:            croak "Hour '$hour' out of range 0..23"  if $hour > 23  or
> $hour < 0;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:118):
> 118:            croak "Minute '$min' out of range 0..59" if $min > 59   or
> $min < 0;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:119):
> 119:            croak "Second '$sec' out of range 0..59" if $sec >= 60  or
> $sec < 0;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:122):
> 122:        my $days = _daygm( undef, undef, undef, $mday, $month, $year );
> Time::Local::_daygm(/usr/share/perl/5.22/Time/Local.pm:75):
> 75:            $Cheat{ pack( 'ss', @_[ 4, 5 ] ) } ||= do {
> Time::Local::_daygm(/usr/share/perl/5.22/Time/Local.pm:76):
> 76:                my $month = ( $_[4] + 10 ) % 12;
> Time::Local::_daygm(/usr/share/perl/5.22/Time/Local.pm:77):
> 77:                my $year  = $_[5] + 1900 - int($month / 10);
> Time::Local::_daygm(/usr/share/perl/5.22/Time/Local.pm:79):
> 79:                ( ( 365 * $year )
> 80:                  + int( $year / 4 )
> 81:                  - int( $year / 100 )
> 82:                  + int( $year / 400 )
> 83:                  + int( ( ( $month * 306 ) + 5 ) / 10 )
> 84:                )
> 85:                - $Epoc;
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:124):
> 124:        unless ($Options{no_range_check} or abs($days) < $MaxDay) {
> Time::Local::timegm(/usr/share/perl/5.22/Time/Local.pm:134):
> 134:        return $sec
> 135:               + $SecOff
> 136:               + ( SECS_PER_MINUTE * $min )
> 137:               + ( SECS_PER_HOUR * $hour )
> 138:               + ( SECS_PER_DAY * $days );
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:155):
> 155:            my $minutes = sprintf "%02d", abs( $offset - int($offset) )
> * 60;
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:156):
> 156:            $TZ  = sprintf("%+03d", int($offset)) . $minutes;
> Mail::Sendmail::time_to_date(/usr/share/perl5/Mail/Sendmail.pm:158):
> 158:        return join(" ",
> 159:                        ($wdays[$wday] . ','),
> 160:                         $mday,
> 161:                         $months[$mon],
> 162:                         $year+1900,
> 163:                         sprintf("%02d:%02d:%02d", $hour, $min, $sec),
> 164:                         $TZ
> 165:                   );
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:295):
> 295:        $log .= "Date: $mail{Date}\n";
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:298):
> 298:        $mail{'Message'} =~ s/\r\n/\n/go;     # normalize line endings,
> step 1 of 2 (next step after MIME encoding)
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:300):
> 300:        $mail{'Mime-Version'} ||= '1.0';
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:301):
> 301:        $mail{'Content-Type'} ||= 'text/plain; charset="iso-8859-1"';
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:303):
> 303:        unless ( $mail{'Content-Transfer-Encoding'}
> 304:              || $mail{'Content-Type'} =~ /multipart/io )
> 305:        {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:306):
> 306:            if ($mailcfg{'mime'}) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:307):
> 307:                $mail{'Content-Transfer-Encoding'} = 'quoted-printable';
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:308):
> 308:                $mail{'Message'} = encode_qp($mail{'Message'});
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:321):
> 321:        $mail{'Message'} =~ s/^\./\.\./gom;     # handle . as first
> character
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:322):
> 322:        $mail{'Message'} =~ s/\n/$CRLF/go; # normalize line endings,
> step 2.
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:326):
> 326:            local $^W = 0;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:326):
> 326:            local $^W = 0;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:327):
> 327:            $recip = join(", ", $mail{To}, $mail{Cc}, $mail{Bcc});
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:330):
> 330:        delete $mail{'Bcc'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:332):
> 332:        @recipients = ();
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:333):
> 333:        while ($recip =~ /$address_rx/go) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:334):
> 334:            push @recipients, $1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:336):
> 336:        unless (@recipients) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:341):
> 341:        $localhost = hostname_long() || hostname() || 'localhost';
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:161):
> 161:        return $hostlong if defined $hostlong;     # Cached copy (takes
> a while to lookup sometimes)
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:162):
> 162:        my ($ip, $debug) = @_;
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:164):
> 164:        $hostlong = dispatcher('uname');
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:143):
> 143:        my ($method, @rest) = @_;
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:144):
> 144:        $lastdispatch = $method;
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:145):
> 145:        return $dispatch{$method}{exec}(@rest);
> Sys::Hostname::Long::CODE(0x1dd7a50)(/usr/share/perl5/Sys/Hostname/Long.pm:51):
> 51:                return eval {
> Sys::Hostname::Long::CODE(0x1dd7a50)(/usr/share/perl5/Sys/Hostname/Long.pm:52):
> 52:                    local $SIG{__DIE__};
> Sys::Hostname::Long::CODE(0x1dd7a50)(/usr/share/perl5/Sys/Hostname/Long.pm:53):
> 53:                    require POSIX;
> Sys::Hostname::Long::CODE(0x1dd7a50)(/usr/share/perl5/Sys/Hostname/Long.pm:54):
> 54:                    (POSIX::uname())[1];
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:166):
> 166:        unless ($hostlong =~ m|.*\..*|) {
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:167):
> 167:            if ($^O eq 'MacOS') {
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:193):
> 193:                $hostlong = dispatcher('exec_hostname_fqdn');
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:143):
> 143:        my ($method, @rest) = @_;
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:144):
> 144:        $lastdispatch = $method;
> Sys::Hostname::Long::dispatcher(/usr/share/perl5/Sys/Hostname/Long.pm:145):
> 145:        return $dispatch{$method}{exec}(@rest);
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:77):
> 77:                my $tmp;
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:78):
> 78:                if ( $^O ne 'darwin' ) {
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:79):
> 79:                    if ($< == 0) {
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:82):
> 82:                        $tmp = `hostname --fqdn`;
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:84):
> 84:                    $tmp =~ tr/\0\r\n//d;
> Sys::Hostname::Long::CODE(0x1de1810)(/usr/share/perl5/Sys/Hostname/Long.pm:86):
> 86:                return $tmp;
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:196):
> 196:            if (!defined($hostlong) || $hostlong eq "") {
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:202):
> 202:            if ($ip && !defined($hostlong) || $hostlong eq "") {
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:206):
> 206:        warn "Sys::Hostname::Long - Last Dispatch method =
> $lastdispatch" if ($debug);
> Sys::Hostname::Long::hostname_long(/usr/share/perl5/Sys/Hostname/Long.pm:207):
> 207:        return $hostlong;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:343):
> 343:        foreach $server ( @{$mailcfg{'smtp'}} ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:343):
> 343:        foreach $server ( @{$mailcfg{'smtp'}} ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:346):
> 346:            unless ( socket S, AF_INET, SOCK_STREAM,
> scalar(getprotobyname 'tcp') ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:350):
> 350:            print "- trying $server\n" if $mailcfg{'debug'} > 1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:352):
> 352:            $server =~ s/\s+//go; # remove spaces just in case of a typo
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:354):
> 354:            $port = ($server =~ s/:(\d+)$//o) ? $1 : $mailcfg{'port'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:355):
> 355:            $smtp = $server; # save $server for use outside foreach loop
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:357):
> 357:            my $smtpaddr = inet_aton $server;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:358):
> 358:            unless ($smtpaddr) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:363):
> 363:            my $retried = 0; # reset retries for each server
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:364):
> 364:            while ( ( not $connected = connect S,
> pack_sockaddr_in($port, $smtpaddr) )
> 365:                and ( $retried < $mailcfg{'retries'} )
> 366:                  ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:367):
> 367:                $retried++;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:368):
> 368:                $error .= "connect to $server failed ($!)\n";
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:369):
> 369:                print "- connect to $server failed ($!)\n" if
> $mailcfg{'debug'} > 1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:370):
> 370:                print "retrying in $mailcfg{'delay'} seconds...\n" if
> $mailcfg{'debug'} > 1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:371):
> 371:                sleep $mailcfg{'delay'};
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:374):
> 374:            if ( $connected ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:379):
> 379:                $error .= "connect to $server failed\n";
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:380):
> 380:                print "- connect to $server failed, next server...\n"
> if $mailcfg{'debug'} > 1;
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:381):
> 381:                next; # next server
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:385):
> 385:        unless ( $connected ) {
> Mail::Sendmail::sendmail(/usr/share/perl5/Mail/Sendmail.pm:386):
> 386:            return fail("connect to $smtp failed ($!) no (more)
> retries!")
> Mail::Sendmail::fail(/usr/share/perl5/Mail/Sendmail.pm:187):
> 187:            $error .= join(" ", @_) . "\n";
> Mail::Sendmail::fail(/usr/share/perl5/Mail/Sendmail.pm:188):
> 188:            if ($server_reply) {
> Mail::Sendmail::fail(/usr/share/perl5/Mail/Sendmail.pm:192):
> 192:            close S;
> Mail::Sendmail::fail(/usr/share/perl5/Mail/Sendmail.pm:193):
> 193:            return 0;
> scalar context return from Mail::Sendmail::sendmail: 0
> C4::Letters::_send_message_by_email(/usr/share/koha/lib/C4/Letters.pm:1349):
> 1349:            _set_message_status( { message_id =>
> $message->{'message_id'},
> 1350:                    status     => 'failed' } );
>   DB<4>
> 
> Regards,
> 
> Javed Shoukat
> 
> Management Trainee Officer (MTO)
> Lahore University of
> Management Sciences (LUMS),
> Lahore.
> 
> Contact #: +92 300 6548748 <+92%20300%206548748>
> Email: javedshoukat900 at gmail.com

-- 
Paul Hoffman <paul at flo.org>
Software Manager
Fenway Library Organization
550 Huntington Ave.
Boston, MA 02115
(617) 442-2384 (FLO main number)


More information about the Koha mailing list