[Koha] Configuring smtp mail server to work with Koha

Paul Hoffman paul at flo.org
Thu Dec 7 03:44:03 NZDT 2017


Better yet, do this in the Perl debugger:

c C4::Letters::SendQueuedMessages
c sendmail
$mailcfg{'debug'} = 1
c

That should produce much less verbose debugging output.

Paul.

On Wed, Dec 06, 2017 at 09:39:09AM -0500, Paul Hoffman wrote:
> Javed,
> 
> Here's what I would do.  Note that the two export commands (setting the 
> environment variables PERL5LIB and KOHA_CONF) are unnecessary -- 
> koha-shell sets them for you.
> 
> $ koha-shell library
> $ cd /usr/share/koha/bin/cronjobs
> $ perl -d process_message_queue.pl
> 
> This puts you in the Perl debugger -- you should see a bunch of text 
> ending with a prompt something like this:
> 
>   DB<1>
> 
> At the prompt, enter the command "c C4::Letters::SendQueuedMessages" -- 
> that tells the debugger to run the script, stopping when it gets to the 
> C4::Letters::SendQueuedMessages() function.  Then enter the command "c 
> sendmail" to continue up until the sendmail() function.  Then enter the 
> command "t" to turn tracing on.  Then enter the command "r" to continue 
> until the sendmail() function returns.
> 
> With any luck, somewhere in the voluminous text that flashes by will be 
> a clue that helps us solve your problem.  Copy all of the text into a 
> message to this list.
> 
> Paul.
> 
> On Wed, Dec 06, 2017 at 04:26:21PM +0500, Javed Sahil wrote:
> > Hi Pedro,
> > 
> >   I am facing a problem with koha notifications similar to that you had
> > been facing in the past, your message details at the end of this email.
> > 
> > When I use following commands.
> > 
> > 1.    koha-shell library
> > 2.    export PERL5LIB="/usr/share/koha/lib"
> > 3.    export KOHA_CONF="/etc/koha/sites/library/koha-conf.xml"
> > 4.    cd /usr/share/koha/bin/cronjobs
> > 
> > above all go fine, but when i use following command:
> > 
> > 5.    ./process_message_queue.pl
> > 
> > this error message appears:
> > 
> > connect to localhost failed (Connection refused)
> > connect to localhost failed
> > connect to localhost failed (Connection refused) no (more) retries!
> >  at ./process_message_queue.pl line 66.
> > 
> > 
> > Then in patron accounts, email status changes to "failed".
> > 
> > Help Plz.
> > 
> > Below is your problem detail.
> > 
> > Hello,
> > 
> > I have solved the problem:
> > Sendmail.pm needs to have smtp => 'localhost' and port => 25 and the e-mail
> > notifications are now working.
> > 
> > Thank you,
> > 
> > Pedro Amorim
> > 
> > 2015-10-30 14:23 GMT-01:00 Pedro Amorim <pjamorim91 at gmail.com>:
> > 
> > > Hello Galen,
> > >
> > > Thank you for your reply.
> > > I have changed the Sendmail.pm file to point to smtp.gmail.com instead of
> > > localhost and am now receiving these errors:
> > >
> > > # koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/
> > > process_message_queue.pl -v
> > > koha: sending email message to patron: Admin at
> > > /usr/share/koha/lib/C4/Letters.pm line 937.
> > > koha: MAIL FROM: error (530 5.7.0 Must issue a STARTTLS command first.
> > > uj4sm7521289wjc.34 - gsmtp
> > > koha: )
> > > koha: Server said: 530 5.7.0 Must issue a STARTTLS command first.
> > > uj4sm7521289wjc.34 - gsmtp
> > > koha:  at /usr/share/koha/bin/cronjobs/process_message_queue.pl line 66
> > >
> > > I do not know much about configuring mail servers, should I keep the
> > > Sendmail.pm file pointing to localhost and postfix takes care of the
> > > redirecting?
> > >
> > > Thanks again,
> > >
> > > Pedro Amorim
> > 
> > -- 
> > 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
> > _______________________________________________
> > Koha mailing list  http://koha-community.org
> > Koha at lists.katipo.co.nz
> > https://lists.katipo.co.nz/mailman/listinfo/koha
> 
> -- 
> Paul Hoffman <paul at flo.org>
> Software Manager
> Fenway Library Organization
> 550 Huntington Ave.
> Boston, MA 02115
> (617) 442-2384 (FLO main number)

-- 
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