This question about Installation of Foswiki: Answered

Email from timlegge/docker-foswiki

Hi, I spent a day to get outgoing mail working from a container started from timlegge/docker-foswiki.

Docker is great to experiment with and it is easy to start with a clean slate. Considering all the rabbit holes I went down, I thought it would be useful to document a working solution.

The starting point is an out-of-the-box running container:
sudo docker run --name foswiki -idt -p 8001:80 timlegge/docker-foswiki

Set the admin password with:
sudo docker exec -it foswiki sh -c "cd /var/www/foswiki; \
               tools/configure -save -set {Password}='insecure';
Change the password when you enter =configure=

In configure select Mail>{WebMasterEmail}>Autoconfigure. I get the following message:

  1. Attempting to configure a mailer program
  2. Unable to locate a known external mail program, trying sendmail
  3. Unable to identify /usr/bin/busybox.
  4. Mail configuration failed. Foswiki will not be able to send mail.

Point 3 is correct /usr/bin/busybox does not exist. Busybox is in /bin. Fixed with:
sudo docker exec -it foswiki ln -s /bin/busybox /usr/bin/busybox

To get the mail to work, you need to set the following configuration variables:
sudo docker exec -it foswiki sh -c "cd /var/www/foswiki; \
   tools/configure -save -set {WebMasterName}='YOUR_NAME'; \
   tools/configure -save -set {WebMasterEmail}='YOUR_EMAIL'; \
   tools/configure -save -set {Email}{MailMethod}='MailProgram'; \
   tools/configure -save -set {MailProgram}='/usr/sbin/sendmail -S YOUR_SMTP -t -oi -oeq -f YOUR_EMAIL'; \
   tools/configure -save -set {EnableEmail}='1' "
Don't bother with Autoconfigure. With this configuration Send Test Email works.

Notes:
  • YOUR_NAME is your regular name. Example: Bram van Oosterhout.
  • YOUR_EMAIL is your regular email address. Example me@google.com
  • YOUR_SMTP is the SMTP server of your ISP. Example: mail.google.com

A bit of gore about the {MailProgram}

  • -f YOUR_EMAIL' is required, because without it, the sender of the mail is root@... sendmail croaks with:
sendmail: recv:'553 #5.1.8 Domain of sender address <root@25d86b63c02c> does not exist'
sendmail: MAIL FROM:<root@25d86b63c02c> failed
  • -S YOUR_SMTP is required. sendmail works fine when the environment variable SMTPHOST is set. But that variable is not available to Foswiki in Net.pm. I tried adding SMTPHOST in Security and Authentication > Environment > {AccessibleENV} but to no avail.

-- BramVanOosterhout - 06 Oct 2022

Why did you not just continue the related question you had already posted at Question2130? Perhaps you could reference this one there and close that one out.

-- LynnwoodBrown - 06 Oct 2022

Hi Lynwood,

Hard to believe, but I could not find it. I scanned the Asked page and searched for "legge" and it did not turn up. So I thought I forgot to save it when I closed the browser.

Anyway, there it is Question2129. I'll close that one with a reference to this one.

Thanks for the pointer.

-- BramVanOosterhout - 06 Oct 2022
 

QuestionForm edit

Subject Installation of Foswiki
Extension
Version Foswiki 2.1.7
Status Answered
Related Topics
Topic revision: r3 - 06 Oct 2022, BramVanOosterhout
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy