Configuration & operations
How to configure SMTP in Koha so notices actually send
Koha queues every notice and a cron job delivers them. Configure the SMTP server, turn email on for the instance, and check the queue — in that order.
Updated 2026-08-09 · Tested against Koha 26.05
Koha does not send email when a notice is generated. It writes the notice to a queue, and a cron job delivers the queue every 15 minutes. So "notices are not sending" is almost always one of three things: no SMTP server configured, email not enabled for the instance, or the queue job not running. Fix them in that order.
This article is for a package install
koha-common package, which is what koha-create gives you. On a git install the same three things are true, but the cron entries are yours to write and koha-email-enable does not exist.Step 1Add an SMTP server in the staff interface
Since Koha 20.05 the mail server is configured in the database, not in a config file. Every instance starts with one implicit default — localhost on port 25, no encryption — which works only if a mail transfer agent is running on the same box and is allowed to relay. Most servers have neither.
- 1Go to Administration → Additional parameters → SMTP servers.
- 2Click New SMTP server.
- 3Name — anything you will recognise later, e.g.
Library mail. - 4Host — your provider's server, e.g.
smtp.example.org. - 5Port —
587for STARTTLS,465for SSL,25only for an unauthenticated relay on your own network. - 6SSL mode —
STARTTLSwith port 587,SSLwith port 465,Disabledwith port 25. - 7User name and Password — leave both blank for an unauthenticated relay; otherwise the mailbox credentials.
- 8Tick Default so every library uses it, then Submit.
Port and SSL mode must agree
SSL, or port 465 with STARTTLS, fails at connect time — and Koha records the failure in the queue rather than on screen, so the save looks successful. If nothing sends after this step, that pairing is the first thing to re-check.Step 2Set the addresses notices come from
A message with no sender is rejected by most receiving servers before it reaches a mailbox. Koha takes the from-address from the branch first and falls back to a system preference.
- 1Set Administration → Libraries → your library → Email address. This is what patrons see and reply to.
- 2Set Administration → System preferences →
KohaAdminEmailAddressas the fallback. - 3If your provider only accepts mail from an address it hosts, both must be an address at that domain — not a personal address forwarded to it.
Step 3Turn email on for the instance
This is the step almost every published guide leaves out, and the reason a correctly configured SMTP server still sends nothing. The package's cron entry runs the queue only for instances that have email enabled, which is a flag file on disk — not a setting in the staff interface.
$ sudo koha-email-enable libraryReplace library with your instance name; sudo koha-list prints it. Confirm the flag took:
$ sudo koha-list --email libraryIf your instance is not in that list, the delivery job is skipping it and nothing else you change will matter.
Step 4Drain the queue and watch it work
Do not wait 15 minutes to find out. Run the delivery job by hand, with verbose output:
$ sudo koha-foreach --chdir --enabled --email \ /usr/share/koha/bin/cronjobs/process_message_queue.pl -vA working run prints one line per message sent. A run that prints nothing at all means the queue is empty — generate a test notice first, for example by triggering a password reset or checking an item out to a patron with an email address and messaging preferences set.
Read the queue directly when you need the truth
sudo koha-mysql library -e "SELECT message_id, status, time_queued, LEFT(to_address,40) FROM message_queue ORDER BY message_id DESC LIMIT 20;". A row sitting at pending was never attempted; failed was attempted and refused.Why it works this way
Koha queues rather than sends because sending is slow and unreliable and the thing that triggered it is not. A checkout that had to wait for an SMTP handshake would block the circulation desk every time the mail server was busy, and would fail the checkout outright when the mail server was down. Writing a row and moving on means a delivery problem is a delivery problem, never a circulation one.
The cost is that email has three independent failure points instead of one, and none of them reports to the screen where the notice was generated. The queue is the seam: anything before it is a Koha configuration problem, anything after it is a mail problem, and the status column tells you which side you are on.
The per-instance email flag exists because one server runs many instances. A test instance restored from a production backup still holds every real patron address, and an operator who did not want it emailing them would have no way to stop it if delivery were simply always on.
It is still not sending
| What you see | What it usually is |
|---|---|
| Queue rows stay at <code>pending</code> forever | The instance is not in koha-list --email, so the cron job skips it. Run koha-email-enable. |
| Rows go to <code>failed</code> immediately | Wrong port/SSL-mode pairing, or credentials the provider rejected. Re-check step 1. |
| Nothing is ever queued | The patron has no email address, or no messaging preference is ticked for that notice type — EnhancedMessagingPreferences must be on, and the notice must be enabled per patron category. |
| Sent, but nothing arrives | The from-address is not one your provider is allowed to send as. Check the provider's own rejection log; Koha only knows the message was accepted. |
| Works by hand, not on schedule | The koha-common cron entry was edited or the package cron file is missing. See Koha cron jobs. |
If you are using a Gmail or Google Workspace mailbox as the sending account, the credentials work differently — see using a Gmail account as Koha's SMTP server.
Would rather not do this yourself? We do it as a service — and if you would rather it were already done, it is on Koha Cloud before you log in.
Related
More on configuration & operations
Answers to the questions that usually arrive with this one.
Koha internal server error: finding the line that caused it
A 500 page is Koha telling you nothing on purpose. The real message is in that instance's error log — here is which file to read, and the two causes that produce most of them.
Rebuilding the Zebra index when Koha search results go stale
A record you can open by its number but cannot find by searching means the index is behind, not that the record is missing. Here is how to rebuild it properly.
Backing up Koha with koha-dump — and restoring it
A package install already backs itself up nightly, keeps two days, and writes to a disk that dies with the server. Here is how to check it, and how to restore.
Koha cron jobs: which ones matter, and what breaks silently without each
A package install schedules about fifteen jobs. This is what each one does, when it runs, and the exact symptom a library sees when it stops.

