Configuring smtp mail server to work with Koha
Hello, I want to configure an smtp server so that Koha can use it to send e-mail notifications. I was expecting some sort of configuration file where I would configure the server, username, password and some other parameters but that is not the case. >From my research I found 2 possible ways: 1) Editting /usr/share/perl5/Mail/Sendmail.pm file and inserting the smtp server at the top of the file, but where do I insert the smtp credentials (user/pass) in that same file? or 2) Through some postfix configuration which I really would like to avoid. Would anyone shed some light on the matter or provide some sort of guidelines on how to do this? Thank you very much, Pedro Amorim
Update: I have installed and configured postfix on my machine and tested it using: echo "This is the body of the email" | mail -s "This is the subject line" user@example.com So I know it's well configured and my server is able to send mails. However, Koha still doesn't send any e-mail when I manually add a new patron. NOTE: 1) AutoEmailOpacUser is set to "send" in administration -> patrons; 2) All cronjobs were left as default. I also know they are running because my new records get indexed every 5 minutes. 2015-10-30 12:28 GMT-01:00 Pedro Amorim <pjamorim91@gmail.com>:
Hello,
I want to configure an smtp server so that Koha can use it to send e-mail notifications. I was expecting some sort of configuration file where I would configure the server, username, password and some other parameters but that is not the case.
From my research I found 2 possible ways: 1) Editting /usr/share/perl5/Mail/Sendmail.pm file and inserting the smtp server at the top of the file, but where do I insert the smtp credentials (user/pass) in that same file? or 2) Through some postfix configuration which I really would like to avoid.
Would anyone shed some light on the matter or provide some sort of guidelines on how to do this?
Thank you very much,
Pedro Amorim
Hi Pedro
However, Koha still doesn't send any e-mail when I manually add a new patron. NOTE: 1) AutoEmailOpacUser is set to "send" in administration -> patrons; 2) All cronjobs were left as default. I also know they are running because my new records get indexed every 5 minutes.
You might try the following command (where xyxx is the name of your Koha instance). # koha-email-enable xxx Hope this helps, Michael -- Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz T 0041 (0)61 261 55 61 · E mik@adminkuhn.ch · W www.adminkuhn.ch
Greetings, Assuming you installed using packages: http://wiki.koha-community.org/wiki/Commands_provided_by_the_Debian_packages... GPML, Mark Tompsett -----Original Message----- From: Pedro Amorim Sent: Friday, October 30, 2015 10:10 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Configuring smtp mail server to work with Koha Update: I have installed and configured postfix on my machine and tested it using: echo "This is the body of the email" | mail -s "This is the subject line" user@example.com So I know it's well configured and my server is able to send mails. However, Koha still doesn't send any e-mail when I manually add a new patron. NOTE: 1) AutoEmailOpacUser is set to "send" in administration -> patrons; 2) All cronjobs were left as default. I also know they are running because my new records get indexed every 5 minutes. 2015-10-30 12:28 GMT-01:00 Pedro Amorim <pjamorim91@gmail.com>:
Hello,
I want to configure an smtp server so that Koha can use it to send e-mail notifications. I was expecting some sort of configuration file where I would configure the server, username, password and some other parameters but that is not the case.
From my research I found 2 possible ways: 1) Editting /usr/share/perl5/Mail/Sendmail.pm file and inserting the smtp server at the top of the file, but where do I insert the smtp credentials (user/pass) in that same file? or 2) Through some postfix configuration which I really would like to avoid.
Would anyone shed some light on the matter or provide some sort of guidelines on how to do this?
Thank you very much,
Pedro Amorim
_______________________________________________ Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
Hello Michael and Mark, Thank you for your replies. Silly me, I forgot to mention I had already run the command koha-email-enable so that is not the reason. UPDATE: I had the following entry on the logs: Use of uninitialized value $OPACBaseURL in substitution $OPACBaseURL is a variable being used in the mail template so I'm guessing this was part of the reason. But I configured the OPACBaseURL parameter in the administration panel and still no e-mail is being sent. Although it doesn't log the message anymore. Instead of waiting for the cronjob to trigger, I ran: /usr/share/koha/bin/cronjobs/process_message_queue.pl Because I knew there was a record in message_queue with the status = "pending", but after running the above command I got the following message(s): connect to localhost failed (Connection refused) connect to localhost failed connect to localhost failed (Connection refused) no (more) retries! Cheers, Pedro Amorim 2015-10-30 13:21 GMT-01:00 Mark Tompsett <mtompset@hotmail.com>:
Greetings,
Assuming you installed using packages:
http://wiki.koha-community.org/wiki/Commands_provided_by_the_Debian_packages...
GPML, Mark Tompsett
-----Original Message----- From: Pedro Amorim Sent: Friday, October 30, 2015 10:10 AM To: koha@lists.katipo.co.nz Subject: Re: [Koha] Configuring smtp mail server to work with Koha
Update:
I have installed and configured postfix on my machine and tested it using:
echo "This is the body of the email" | mail -s "This is the subject line" user@example.com
So I know it's well configured and my server is able to send mails.
However, Koha still doesn't send any e-mail when I manually add a new patron. NOTE: 1) AutoEmailOpacUser is set to "send" in administration -> patrons; 2) All cronjobs were left as default. I also know they are running because my new records get indexed every 5 minutes.
2015-10-30 12:28 GMT-01:00 Pedro Amorim <pjamorim91@gmail.com>:
Hello,
I want to configure an smtp server so that Koha can use it to send e-mail notifications. I was expecting some sort of configuration file where I would configure the server, username, password and some other parameters but that is not the case.
From my research I found 2 possible ways: 1) Editting /usr/share/perl5/Mail/Sendmail.pm file and inserting the smtp server at the top of the file, but where do I insert the smtp credentials (user/pass) in that same file? or 2) Through some postfix configuration which I really would like to avoid.
Would anyone shed some light on the matter or provide some sort of guidelines on how to do this?
Thank you very much,
Pedro Amorim
_______________________________________________
Koha mailing list http://koha-community.org Koha@lists.katipo.co.nz https://lists.katipo.co.nz/mailman/listinfo/koha
Hi, On Fri, Oct 30, 2015 at 10:40 AM, Pedro Amorim <pjamorim91@gmail.com> wrote:
connect to localhost failed (Connection refused) connect to localhost failed connect to localhost failed (Connection refused) no (more) retries!
Koha expects there to be an MTA listening on port 25 on localhost. Since you've got postfix already running, I suggest checking its configuration for that -- specifically, inet_interfaces (to ensure that it's listening on that interface) and mynetworks (to verify that it will accept connects from with your Koha server). Alternatively, if the only thing you need is for email to get forwarded to your mail smarthost, you could try nullmailer instead of postfix. Regards, Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
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 2015-10-30 13:57 GMT-01:00 Galen Charlton <gmc@esilibrary.com>:
Hi,
On Fri, Oct 30, 2015 at 10:40 AM, Pedro Amorim <pjamorim91@gmail.com> wrote:
connect to localhost failed (Connection refused) connect to localhost failed connect to localhost failed (Connection refused) no (more) retries!
Koha expects there to be an MTA listening on port 25 on localhost. Since you've got postfix already running, I suggest checking its configuration for that -- specifically, inet_interfaces (to ensure that it's listening on that interface) and mynetworks (to verify that it will accept connects from with your Koha server).
Alternatively, if the only thing you need is for email to get forwarded to your mail smarthost, you could try nullmailer instead of postfix.
Regards,
Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
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@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
2015-10-30 13:57 GMT-01:00 Galen Charlton <gmc@esilibrary.com>:
Hi,
On Fri, Oct 30, 2015 at 10:40 AM, Pedro Amorim <pjamorim91@gmail.com> wrote:
connect to localhost failed (Connection refused) connect to localhost failed connect to localhost failed (Connection refused) no (more) retries!
Koha expects there to be an MTA listening on port 25 on localhost. Since you've got postfix already running, I suggest checking its configuration for that -- specifically, inet_interfaces (to ensure that it's listening on that interface) and mynetworks (to verify that it will accept connects from with your Koha server).
Alternatively, if the only thing you need is for email to get forwarded to your mail smarthost, you could try nullmailer instead of postfix.
Regards,
Galen -- Galen Charlton Infrastructure and Added Services Manager Equinox Software, Inc. / The Open Source Experts email: gmc@esilibrary.com direct: +1 770-709-5581 cell: +1 404-984-4366 skype: gmcharlt web: http://www.esilibrary.com/ Supporting Koha and Evergreen: http://koha-community.org & http://evergreen-ils.org
participants (4)
-
Galen Charlton -
Mark Tompsett -
Michael Kuhn -
Pedro Amorim