Blame
Date:
Sun Oct 2 04:00:24 2022
UTC
Message:
Daily backup
10
2022-02-07
targets=Opensmtpd.Configure,Dovecot.Install,Opensmtpd.Test,Php.Install,Relayd.TLSMulti,Openhttpd.Intro,Unbound.Configure
11
2022-02-07
text=(:title Install SquirrelMail:)%0a%0aSquirrelMail is webmail written in PHP. It uses HTML 4.0 with no JavaScript required, making it compatible across many browsers. It does not require any databases and is very easy to install and configure. It is GPL-licensed.%0a%0aIts main drawback is its use of frames, which is bad for accessibility. Development, unfortunately, has stalled, so a C-based replacement will be needed.%0a%0a!! Required%0a%0aBefore installing squirrelmail, [[opensmtpd/configure|opensmtpd]] must be properly configured, and [[dovecot/install|dovecot]] must be installed and properly configured. Please [[opensmtpd/test|test]] both sending and receiving email using another mail client before attempting to setup Squirrelmail.%0a%0aYou must install and configure [[Php.Install|php]].%0a%0a[@%0a$ ftp https://snapshots.squirrelmail.org/squirrelmail-20220205_0200-SVN.stable.tar.gz%0a$ tar xvzf squirrelmail-20220205_0200-SVN.stable.tar.gz%0a@]%0a%0a''Optional'': you can delete the original tarball once you are done extracting:%0a%0a[@%0a$ rm squirrelmail-20220205_0200-SVN.stable.tar.gz%0a@]%0a%0aNext, you want to move squirrelmail into your web documents folder. Make sure to replace @@mail.example.com@@ with your actual domain:%0a%0a[@%0a$ doas mv squirrelmail.stable/squirrelmail /var/www/htdocs/mail.example.com%0a$ doas chown -R www:daemon /var/www/htdocs/mail.example.com/%0a@]%0a%0a'''NOTE''': make sure to replace @@mail.example.com@@ with your actual domain.%0a%0aIf the domain does not already exist, add the subdomain mail in /var/nsd/zones/master/example.com:%0a%0a[@%0amail A 10.0.0.1%0amail AAAA 2001:db8::%0a@]%0a%0aReplace 10.0.0.1 and 2001:db8:: with your real IPv4 and IPv6 addresses. Make sure to update the serial number, then:%0a%0a[@%0a$ doas nsd-control reload%0a@]%0a%0aAdd this to /etc/httpd.conf:%0a%0a[@%0aserver "mail.example.com" {%0a listen on * port 80%0a location "/.well-known/acme-challenge/*" {%0a root "/acme"%0a request strip 2%0a }%0a location "*.php" {%0a fastcgi socket "/run/php-fpm.sock"%0a root "/htdocs/mail.example.com"%0a }%0a directory index "index.php"%0a connection max request body 26214400%0a log access "webmail_access.log"%0a log error "webmail_error.log"%0a}%0a@]%0a(:if false:)%0a location "/class/*" {%0a block return 403%0a }%0a location "/config/*" {%0a block return 403%0a }%0a location "/contrib/*" {%0a block return 403%0a }%0a location "/data/*" {%0a block return 403%0a }%0a location "/doc/*" {%0a block return 403%0a }%0a location "/functions/*" {%0a block return 403%0a }%0a location "/help/*" {%0a block return 403%0a }%0a location "/include/*" {%0a block return 403%0a }%0a location "/locale/*" {%0a block return 403%0a }%0a location "/po/*" {%0a block return 403%0a }%0a(:ifend:)%0a%0aFor SSL/TLS, we recommend you use [[relayd/TLSMulti|relayd for TLS acceleration]] rather than httpd's native SSL. This is so you can provide web services that do not use [[openhttpd/intro|openhttpd]].%0a%0a!! TLS with relayd%0a%0aWhen [[relayd/TLSMulti|using relayd for TLS acceleration]], all that is needed are a few lines in /etc/relayd.conf:%0a%0a[@%0atls { keypair mail.example.com }%0a@]%0a%0aReplace @@mail.example.com@@ with your real domain. This provides the TLS cert for webmail.%0a%0aIn /etc/acme-client.conf, add this block:%0a%0a[@%0adomain mail.example.com {%0a alternative names { example.com imap.example.com smtp.example.com pop.example.com pop3.example.com}%0a domain key "/etc/ssl/private/mail.example.com.key"%0a domain full chain certificate "/etc/ssl/mail.example.com.crt"%0a sign with letsencrypt%0a}%0a@]%0a%0aRequest the cert:%0a%0a[@%0a$ doas acme-client -v mail.example.com%0a@]%0a%0aNormally, the user www has no login shell for security. However, squirrelmail has this unusual perl configuration script that www needs to run. So first, we give www the default ksh shell:%0a%0a[@%0a$ doas chsh -s /bin/ksh www%0a@]%0a%0aThen, we switch to the user www and run the config script:%0a%0a[@%0a$ doas su www%0a$ cd /var/www/htdocs/mail.example.com/config%0a$ perl conf.pl%0a@]%0a%0aYou should see the interactive menu:%0a%0a[@%0aSquirrelMail Configuration : Read: config_default.php (1.4.0)%0a---------------------------------------------------------%0aMain Menu --%0a1. Organization Preferences%0a2. Server Settings%0a3. Folder Defaults%0a4. General Options%0a5. Themes%0a6. Address Books%0a7. Message of the Day (MOTD)%0a8. Plugins%0a9. Database%0a10. Languages%0a%0aD. Set pre-defined settings for specific IMAP servers%0a%0aC Turn color on%0aS Save data%0aQ Quit%0a%0aCommand >> 2%0a@]%0a%0aType 2 to edit Server Settings:%0a%0a[@%0aServer Settings%0a%0aGeneral%0a-------%0a1. Domain : mail.example.com%0a2. Invert Time : false%0a3. Sendmail or SMTP : SMTP%0a%0aIMAP Settings%0a--------------%0a4. IMAP Server : localhost%0a5. IMAP Port : 143%0a6. Authentication type : login%0a7. Secure IMAP (TLS) : false%0a8. Server software : dovecot%0a9. Delimiter : detect%0a%0aB. Change Sendmail Config : /usr/sbin/sendmail%0aH. Hide IMAP Server Settings%0a%0aR Return to Main Menu%0aC Turn color on%0aS Save data%0aQ Quit%0a%0aCommand >> B%0a@]%0a%0aOnce you're done with configuration, save your work and quit:%0a%0a[@%0aCommand >> S%0aData saved in config.php%0aPress enter to continue...%0a%0aCommand >> Q%0aExiting conf.pl.%0aYou might want to test your configuration by browsing to%0ahttp://your-squirrelmail-location/src/configtest.php%0aHappy SquirrelMailing!%0a@]%0a%0aLogout by typing ctrl+d and then disable the login shell for www:%0a%0a[@%0a$ ^D%0a$ doas chsh -s /sbin/nologin www%0a@]%0a%0aBecause Squirrelmail will connect to IMAP via localhost, you will need a listener for 127.0.0.1 in /etc/dovecot/dovecot.conf:%0a%0a[@%0alisten = 10.0.0.1, 2001:db8::, 127.0.0.1%0a@]%0a%0aMake sure to replace 10.0.0.1 and 2001:db8:: with your real public IPv4 and IPv6 address.%0a%0aYou will want to restart dovecot if you need to make the change:%0a%0a[@%0a$ doas rcctl restart dovecot%0a@]%0a%0aWe need to create folders that squirrelmail can write data to:%0a%0a[@%0a$ doas mkdir -p /var/www/var/local/squirrelmail/data%0a$ doas mkdir -p /var/www/var/local/squirrelmail/attach%0a$ doas chown -R www:daemon /var/www/var/local/squirrelmail%0a@]%0a%0aRemember, openhttpd runs chrooted in /var/www by default, which means you will%0aneed to copy some essential system files.%0a%0aIf it does not exist already, create /var/www/etc/resolv.conf:%0a%0a[@%0alookup file bind%0anameserver 127.0.0.1%0a@]%0a%0aThis provides information on where to lookup DNS records. You will need%0ato [[unbound/configure|configure unbound]].%0a%0aIf it does not exist already, create /var/www/etc/hosts:%0a%0a[@%0a127.0.0.1 localhost%0a::1 localhost%0a@]%0a%0aThis defines localhost to be 127.0.0.1, which is necessary since squirrelmail will query IMAP and SMTP by using localhost.%0a%0aTroubleshooting:%0a%0a!!! Error opening%0a%0a[@%0aERROR%0aError opening ../data/default_pref%0aCould not create initial preference file!%0a/var/local/squirrelmail/data/ should be writable by user%0aPlease contact your system administrator and report this error.%0aGo to the login page%0a@]%0a%0aMake sure to create folders that squirrelmail can write to:%0a%0a[@%0a$ doas mkdir -p /var/www/var/local/squirrelmail/data%0a$ doas mkdir -p /var/www/var/local/squirrelmail/attach%0a$ doas chown -R www:daemon /var/www/var/local/squirrelmail%0a@]%0a%0a!!! Squirrelmail cannot connect to IMAP%0a%0aMake sure you have a listener for 127.0.0.1 in /etc/dovecot/dovecot.conf:%0a%0a[@%0alisten = 10.0.0.1, 2001:db8::, 127.0.0.1%0a@]%0a%0aReplace 10.0.0.1 and 2001:db8:: with your real IPv4 and IPv6 addresses.%0a%0aAfterwards, restart dovecot if any changes were made:%0a%0a[@%0a$ doas rcctl restart dovecot%0a@]%0a%0aIf Squirrelmail cannot resolve the name localhost, make sure you have the file /var/www/etc/hosts defined (see above).%0a%0a!!! Check logs%0a%0aCheck /var/www/logs/error.log for additional logs for debugging.%0a%0a!! Sendmail%0a%0aSquirrelmail should be able to use sendmail instead of SMTP. However, on OpenBSD 6.9, there appears to be some issues with the replacement femail instead of sendmail.%0a%0a'''WARNING''': This setup has errors.%0a%0aTo setup femail:%0a%0a$ doas mkdir -p /var/www/etc/%0a%0aCreate /var/www/etc/femail.conf:%0a%0a[@%0asmtphost=127.0.0.1%0amyname=mail.example.com%0a@]%0a%0aTest if femail works%0a%0a[@%0a$ doas chroot -u www -g daemon /var/www /bin/femail -t -fusername@mail.example.com%0aTo: other@domain.com%0aSubject: Alpha Bravo%0aMIME-Version: 1.0%0aContent-Type: text/plain; charset=us-ascii%0aContent-Disposition: inline%0a%0aCharlie Delta Echo Foxtrot%0a@]%0a%0aType ctrl+d to end the message%0a%0a%0a!! Baytuch notes%0a%0a!! Permissions%0a%0a[@%0acd /var/www/htdocs/%0adoas chown root:bin webmail%0adoas find ./webmail -type d -exec chmod 755 {} \;%0adoas find ./webmail -type f -exec chmod 644 {} \;%0adoas rm /var/www/htdocs/webmail/README %0adoas rm /var/www/htdocs/webmail/configure%0a@]%0a%0a!! PHP 7 compatibility fix%0a[@%0afunctions/global.php (451):%0afunction sqsession_is_active() {%0a if (session_status() === PHP_SESSION_ACTIVE) { return; }%0a sqsession_start();%0a}%0a@]%0a%0a!! Configuring%0a[@%0adoas touch /var/www/htdocs/webmail/config/config.php%0adoas chown www:www /var/www/htdocs/webmail/config/config.php%0adoas chmod 400 /var/www/htdocs/webmail/config/config.php%0a@]%0a%0a!! Security%0a%0a(:if false:)%0a[@%0a$ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a$ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a@]%0a(:ifend:)%0a%0a[[https://wiki.ircnow.org/uploads/Openbsd/config.php.zip|config.php.zip]]%0a
16
2022-02-07
diff:1644139506:1639920227:=11,12c11,14%0a%3c You must install and configure [[Php.Install|php]].%0a%3c %0a---%0a> You must install and configure [[php74/install|php-7.4.22]]. The latest release of Squirrelmail cannot run on php-8.0 without modifications.%0a> %0a> '''WARNING''': You must use php-7.4.22%0a> %0a14,15c16,17%0a%3c $ ftp https://snapshots.squirrelmail.org/squirrelmail-20220205_0200-SVN.stable.tar.gz%0a%3c $ tar xvzf squirrelmail-20220205_0200-SVN.stable.tar.gz%0a---%0a> $ ftp https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a> $ tar xvzf squirrelmail-webmail-1.4.22.tar.gz%0a21c23%0a%3c $ rm squirrelmail-20220205_0200-SVN.stable.tar.gz%0a---%0a> $ rm squirrelmail-webmail-1.4.22.tar.gz%0a27c29%0a%3c $ doas mv squirrelmail.stable/squirrelmail /var/www/htdocs/mail.example.com%0a---%0a> $ doas mv squirrelmail-webmail-1.4.22 /var/www/htdocs/mail.example.com%0a337a340,348%0a> !! PHP 8.0%0a> %0a> When using PHP 8.0+, PHP complains that Squirrelmail is trying to use curly braces in a way that is no longer supported. You should see error messages like the following in /var/www/logs/error.log:%0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.example.com/functions/strings.php on line 634%0a> %0a> You need to look up every instance of misused {} curly braces and replace them with brackets [].%0a> %0a> $String .= $chars[mt_rand(0, $j)];%0a
19
2021-12-19
diff:1639920227:1637967048:=30a31%0a> $ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a240a242%0a> $ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a283a286%0a> $ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a378,386d380%0a%3c %0a%3c !! Security%0a%3c %0a%3c (:if false:)%0a%3c [@%0a%3c $ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a%3c $ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a%3c @]%0a%3c (:ifend:)%0a
23
2021-12-17
diff:1637967048:1637798105:=183c183%0a%3c 4. IMAP Server : localhost%0a---%0a> 4. IMAP Server : 127.0.0.1%0a
26
2021-12-17
diff:1637798105:1631278989:=183c183%0a%3c 4. IMAP Server : 127.0.0.1%0a---%0a> 4. IMAP Server : localhost%0a
29
2021-12-17
diff:1631278989:1630422956:=3,4c3,4%0a%3c SquirrelMail is webmail written in PHP. It uses HTML 4.0 with no JavaScript required, making it compatible across many browsers. It does not require any databases and is very easy to install and configure. It is GPL-licensed.%0a%3c %0a---%0a> SquirrelMail is webmail written in PHP. It uses HTML 4.0 with no JavaScript required, making it compatible across many browsers. It does not require any databases and is very easy to install and configure.%0a> %0a5a6,8%0a> %0a> SquirrelMail is GPL-licensed., so there are no license fees to worry about.%0a> More about the license %0a
32
2021-12-17
diff:1630422956:1628331745:=228c228%0a%3c listen = 10.0.0.1, 2001:db8::, 127.0.0.1%0a---%0a> listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a231,232d230%0a%3c Make sure to replace 10.0.0.1 and 2001:db8:: with your real public IPv4 and IPv6 address.%0a%3c %0a297c295%0a%3c listen = 10.0.0.1, 2001:db8::, 127.0.0.1%0a---%0a> listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a299,300d296%0a%3c %0a%3c Replace 10.0.0.1 and 2001:db8:: with your real IPv4 and IPv6 addresses.%0a
35
2021-12-17
diff:1628331745:1628331523:=19c19%0a%3c $ ftp https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a---%0a> $ ftp https://managedway.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a352,356c352,374%0a%3c !! Baytuch notes%0a%3c %0a%3c !! Permissions%0a%3c %0a%3c [@%0a---%0a> %0a> '''Creating an environment for the application to work'''%0a> [=%0a> doas mkdir /var/www/webmail%0a> doas mkdir /var/www/webmail/data%0a> doas mkdir /var/www/webmail/attachments%0a> %0a> doas chown www:www /var/www/webmail%0a> doas chown www:www /var/www/webmail/data%0a> doas chown www:www /var/www/webmail/attachments%0a> %0a> doas chmod 700 /var/www/webmail%0a> doas chmod 700 /var/www/webmail/data%0a> doas chmod 700 /var/www/webmail/attachments%0a> =]%0a> %0a> '''Installing the application on the server'''%0a> [=%0a> cd ~/%0a> wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a> tar -xvzf squirrelmail-webmail-1.4.22.tar.gz%0a> doas cp -r squirrelmail-webmail-1.4.22/ /var/www/htdocs/webmail/%0a> %0a363,366c381,384%0a%3c @]%0a%3c %0a%3c !! PHP 7 compatibility fix%0a%3c [@%0a---%0a> =]%0a> %0a> '''PHP 7 compatibility fix'''%0a> [=%0a372,375c390,393%0a%3c @]%0a%3c %0a%3c !! Configuring%0a%3c [@%0a---%0a> =]%0a> %0a> '''Configuring'''%0a> [=%0a379c397%0a%3c @]%0a---%0a> =]%0a
38
2021-12-17
diff:1628331523:1628331107:=12,13d11%0a%3c Before installing squirrelmail, [[opensmtpd/configure|opensmtpd]] must be properly configured, and [[dovecot/install|dovecot]] must be installed and properly configured. Please [[opensmtpd/test|test]] both sending and receiving email using another mail client before attempting to setup Squirrelmail.%0a%3c %0a39,40c37,38%0a%3c If the domain does not already exist, add the subdomain mail in /var/nsd/zones/master/example.com:%0a%3c %0a---%0a> Add this to /etc/httpd.conf:%0a> %0a42,54d39%0a%3c mail A 10.0.0.1%0a%3c mail AAAA 2001:db8::%0a%3c @]%0a%3c %0a%3c Replace 10.0.0.1 and 2001:db8:: with your real IPv4 and IPv6 addresses. Make sure to update the serial number, then:%0a%3c %0a%3c [@%0a%3c $ doas nsd-control reload%0a%3c @]%0a%3c %0a%3c Add this to /etc/httpd.conf:%0a%3c %0a%3c [@%0a351,353c336,340%0a%3c %0a%3c %0a%3c '''Creating an environment for the application to work'''%0a---%0a> For the application to work, the mail system must already be configured and started on the server.%0a> %0a> %0a> '''Create a new subdomain to host the application'''%0a> %0a355,365c342,348%0a%3c doas mkdir /var/www/webmail%0a%3c doas mkdir /var/www/webmail/data%0a%3c doas mkdir /var/www/webmail/attachments%0a%3c %0a%3c doas chown www:www /var/www/webmail%0a%3c doas chown www:www /var/www/webmail/data%0a%3c doas chown www:www /var/www/webmail/attachments%0a%3c %0a%3c doas chmod 700 /var/www/webmail%0a%3c doas chmod 700 /var/www/webmail/data%0a%3c doas chmod 700 /var/www/webmail/attachments%0a---%0a> /var/nsd/zones/master/example.com.zone:%0a> ; webmail service%0a> webmail A 10.10.10.10%0a> webmail AAAA 2605:6400:30:faa1::%0a> %0a> doas rcctl -d restart nsd%0a> doas rcctl -d restart unbound%0a368c351,358%0a%3c '''Installing the application on the server'''%0a---%0a> =]%0a> %0a> %0a> doas rcctl -d restart httpd%0a> %0a> %0a> '''Configuring the certificate generation service'''%0a> %0a370,380c360,367%0a%3c cd ~/%0a%3c wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a%3c tar -xvzf squirrelmail-webmail-1.4.22.tar.gz%0a%3c doas cp -r squirrelmail-webmail-1.4.22/ /var/www/htdocs/webmail/%0a%3c %0a%3c cd /var/www/htdocs/%0a%3c doas chown root:bin webmail%0a%3c doas find ./webmail -type d -exec chmod 755 {} \;%0a%3c doas find ./webmail -type f -exec chmod 644 {} \;%0a%3c doas rm /var/www/htdocs/webmail/README %0a%3c doas rm /var/www/htdocs/webmail/configure%0a---%0a> /etc/acme-client.conf:%0a> domain webmail.example.com {%0a> domain key "/etc/ssl/private/webmail.example.com.key"%0a> domain certificate "/etc/ssl/webmail.example.com.crt"%0a> domain full chain certificate "/etc/ssl/webmail.example.com.fullchain.pem"%0a> sign with letsencrypt%0a> challengedir "/var/www/acme"%0a> }%0a382,383c369,373%0a%3c %0a%3c '''PHP 7 compatibility fix'''%0a---%0a> doas acme-client -Fv webmail.example.com%0a> (!)you must set new certs to virtual host config and restart httpd again%0a> %0a> %0a> '''Creating an environment for the application to work'''%0a385,389c375,385%0a%3c functions/global.php (451):%0a%3c function sqsession_is_active() {%0a%3c if (session_status() === PHP_SESSION_ACTIVE) { return; }%0a%3c sqsession_start();%0a%3c }%0a---%0a> doas mkdir /var/www/webmail%0a> doas mkdir /var/www/webmail/data%0a> doas mkdir /var/www/webmail/attachments%0a> %0a> doas chown www:www /var/www/webmail%0a> doas chown www:www /var/www/webmail/data%0a> doas chown www:www /var/www/webmail/attachments%0a> %0a> doas chmod 700 /var/www/webmail%0a> doas chmod 700 /var/www/webmail/data%0a> doas chmod 700 /var/www/webmail/attachments%0a392c388%0a%3c '''Configuring'''%0a---%0a> '''Installing the application on the server'''%0a394,396c390,400%0a%3c doas touch /var/www/htdocs/webmail/config/config.php%0a%3c doas chown www:www /var/www/htdocs/webmail/config/config.php%0a%3c doas chmod 400 /var/www/htdocs/webmail/config/config.php%0a---%0a> cd ~/%0a> wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a> tar -xvzf squirrelmail-webmail-1.4.22.tar.gz%0a> doas cp -r squirrelmail-webmail-1.4.22/ /var/www/htdocs/webmail/%0a> %0a> cd /var/www/htdocs/%0a> doas chown root:bin webmail%0a> doas find ./webmail -type d -exec chmod 755 {} \;%0a> doas find ./webmail -type f -exec chmod 644 {} \;%0a> doas rm /var/www/htdocs/webmail/README %0a> doas rm /var/www/htdocs/webmail/configure%0a398a403,418%0a> '''PHP 7 compatibility fix'''%0a> [=%0a> functions/global.php (451):%0a> function sqsession_is_active() {%0a> if (session_status() === PHP_SESSION_ACTIVE) { return; }%0a> sqsession_start();%0a> }%0a> =]%0a> %0a> '''Configuring'''%0a> [=%0a> doas touch /var/www/htdocs/webmail/config/config.php%0a> doas chown www:www /var/www/htdocs/webmail/config/config.php%0a> doas chmod 400 /var/www/htdocs/webmail/config/config.php%0a> =]%0a> %0a399a420,646%0a> %0a> %0a> [@%0a> %0a> Warning: you must use php-7.4.22%0a> %0a> $ ftp https://managedway.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a> $ tar xvzf squirrelmail-webmail-1.4.22.tar.gz%0a> $ doas mv squirrelmail-webmail-1.4.22 /var/www/htdocs/mail.example.com%0a> $ doas chown -R www:daemon /var/www/htdocs/mail.example.com/%0a> $ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a> %0a> Add this to /etc/httpd.conf:%0a> %0a> server "mail.example.com" {%0a> listen on * port 80%0a> location "/.well-known/acme-challenge/*" {%0a> root "/acme"%0a> request strip 2%0a> }%0a> location "*.php" {%0a> fastcgi socket "/run/php-fpm.sock"%0a> root "/htdocs/mail.example.com"%0a> }%0a> directory {%0a> index "index.php"%0a> }%0a> connection max request body 26214400%0a> }%0a> %0a> In /etc/relayd.conf:%0a> %0a> tls { keypair mail.host.ircnow.org }%0a> %0a> In /etc/acme-client.conf:%0a> %0a> domain mail.jrmu.host.ircnow.org {%0a> alternative names { jrmu.host.ircnow.org imap.jrmu.host.ircnow.org smtp.jrmu.hos%0a> t.ircnow.org pop.jrmu.host.ircnow.org pop3.jrmu.host.ircnow.org }%0a> domain key "/etc/ssl/private/mail.jrmu.host.ircnow.org.key"%0a> domain full chain certificate "/etc/ssl/mail.jrmu.host.ircnow.org.crt"%0a> sign with letsencrypt%0a> }%0a> %0a> $ doas chsh -s /bin/ksh www%0a> $ doas su www%0a> $ cd /var/www/htdocs/mail.example.com/config%0a> $ perl conf.pl%0a> %0a> SquirrelMail Configuration : Read: config_default.php (1.4.0)%0a> ---------------------------------------------------------%0a> Main Menu --%0a> 1. Organization Preferences%0a> 2. Server Settings%0a> 3. Folder Defaults%0a> 4. General Options%0a> 5. Themes%0a> 6. Address Books%0a> 7. Message of the Day (MOTD)%0a> 8. Plugins%0a> 9. Database%0a> 10. Languages%0a> %0a> D. Set pre-defined settings for specific IMAP servers%0a> %0a> C Turn color on%0a> S Save data%0a> Q Quit%0a> %0a> Command >> 2%0a> %0a> Server Settings%0a> %0a> General%0a> -------%0a> 1. Domain : jrmu.host.ircnow.org%0a> 2. Invert Time : false%0a> 3. Sendmail or SMTP : Sendmail%0a> %0a> IMAP Settings%0a> --------------%0a> 4. IMAP Server : 127.0.0.1%0a> 5. IMAP Port : 143%0a> 6. Authentication type : login%0a> 7. Secure IMAP (TLS) : false%0a> 8. Server software : dovecot%0a> 9. Delimiter : detect%0a> %0a> B. Change Sendmail Config : /usr/sbin/sendmail%0a> H. Hide IMAP Server Settings%0a> %0a> R Return to Main Menu%0a> C Turn color on%0a> S Save data%0a> Q Quit%0a> %0a> Command >> B%0a> %0a> %0a> SquirrelMail Configuration : Read: config.php (1.4.0)%0a> ---------------------------------------------------------%0a> Server Settings%0a> %0a> General%0a> -------%0a> 1. Domain : jrmu.host.ircnow.org%0a> 2. Invert Time : false%0a> 3. Sendmail or SMTP : Sendmail%0a> %0a> Sendmail%0a> --------%0a> 4. Sendmail Path : /bin/femail%0a> 5. Sendmail arguments : -t%0a> 6. Header encryption key : %0a> %0a> A. Update IMAP Settings : 127.0.0.1:143 (dovecot)%0a> H. Hide Sendmail Settings%0a> %0a> R Return to Main Menu%0a> C Turn color on%0a> S Save data%0a> Q Quit%0a> %0a> Command >> %0a> %0a> %0a> SquirrelMail Configuration : Read: config_default.php (1.4.0)%0a> ---------------------------------------------------------%0a> Main Menu --%0a> 1. Organization Preferences%0a> 2. Server Settings%0a> 3. Folder Defaults%0a> 4. General Options%0a> 5. Themes%0a> 6. Address Books%0a> 7. Message of the Day (MOTD)%0a> 8. Plugins%0a> 9. Database%0a> 10. Languages%0a> %0a> D. Set pre-defined settings for specific IMAP servers%0a> %0a> C Turn color on%0a> S Save data%0a> Q Quit%0a> %0a> Command >> S%0a> %0a> Data saved in config.php%0a> Press enter to continue...%0a> %0a> Exiting conf.pl.%0a> You might want to test your configuration by browsing to%0a> http://your-squirrelmail-location/src/configtest.php%0a> Happy SquirrelMailing!%0a> %0a> jrmu$ ^D%0a> $ doas chsh -s /sbin/nologin www%0a> %0a> %0a> Make sure /etc/dovecot/dovecot.conf:%0a> %0a> listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a> %0a> need 127.0.0.1%0a> %0a> check /var/www/logs/error.log%0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/strings.php on line 634%0a> %0a> You need to change this one line in /var/www/htdocs/mail.example.com/functions/strings.php:%0a> %0a> $String .= $chars[mt_rand(0, $j)];%0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 468%0a> %0a> $char = $read[$i]; %0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 475%0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 637%0a> %0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_general.php on line 214%0a> PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_general.php on line 215%0a> %0a> $ doas mkdir -p /var/www/var/local/squirreilmail/data%0a> $ doas chown -R www:daemon /var/www/var/local/squirreilmail%0a> $ doas chmod -R o-rx /var/www/var/local/squirreilmail%0a> %0a> Setup femail:%0a> %0a> $ doas mkdir -p /var/www/etc/%0a> %0a> Create /var/www/etc/femail.conf:%0a> %0a> smtphost=127.0.0.1%0a> myname=mail.example.com%0a> %0a> Test if femail works%0a> %0a> $ doas chroot -u www -g daemon /var/www /bin/femail -t -fusername@mail.example.com%0a> To: other@domain.com%0a> Subject: Alpha Bravo%0a> MIME-Version: 1.0%0a> Content-Type: text/plain; charset=us-ascii%0a> Content-Disposition: inline%0a> %0a> Charlie Delta Echo Foxtrot%0a> %0a> Type ctrl+d to end the message%0a> %0a> %0a> Optional:%0a> %0a> $ rm squirrelmail-webmail-1.4.22.tar.gz%0a> %0a> Troubleshooting:%0a> %0a> ERROR%0a> Error opening ../data/default_pref%0a> Could not create initial preference file!%0a> /var/local/squirrelmail/data/ should be writable by user%0a> Please contact your system administrator and report this error.%0a> Go to the login page%0a> %0a> %0a> @]%0a
41
2021-12-17
diff:1628331107:1628271843:=1,40c1,20%0a%3c (:title Install SquirrelMail:)%0a%3c %0a%3c SquirrelMail is webmail written in PHP. It uses HTML 4.0 with no JavaScript required, making it compatible across many browsers. It does not require any databases and is very easy to install and configure.%0a%3c %0a%3c Its main drawback is its use of frames, which is bad for accessibility. Development, unfortunately, has stalled, so a C-based replacement will be needed.%0a%3c %0a%3c SquirrelMail is GPL-licensed., so there are no license fees to worry about.%0a%3c More about the license %0a%3c %0a%3c !! Required%0a%3c %0a%3c You must install and configure [[php74/install|php-7.4.22]]. The latest release of Squirrelmail cannot run on php-8.0 without modifications.%0a%3c %0a%3c '''WARNING''': You must use php-7.4.22%0a%3c %0a%3c [@%0a%3c $ ftp https://managedway.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a%3c $ tar xvzf squirrelmail-webmail-1.4.22.tar.gz%0a%3c @]%0a%3c %0a%3c ''Optional'': you can delete the original tarball once you are done extracting:%0a%3c %0a%3c [@%0a%3c $ rm squirrelmail-webmail-1.4.22.tar.gz%0a%3c @]%0a%3c %0a%3c Next, you want to move squirrelmail into your web documents folder. Make sure to replace @@mail.example.com@@ with your actual domain:%0a%3c %0a%3c [@%0a%3c $ doas mv squirrelmail-webmail-1.4.22 /var/www/htdocs/mail.example.com%0a%3c $ doas chown -R www:daemon /var/www/htdocs/mail.example.com/%0a%3c $ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a%3c @]%0a%3c %0a%3c '''NOTE''': make sure to replace @@mail.example.com@@ with your actual domain.%0a%3c %0a%3c Add this to /etc/httpd.conf:%0a%3c %0a%3c [@%0a%3c server "mail.example.com" {%0a---%0a> For the application to work, the mail system must already be configured and started on the server.%0a> %0a> %0a> '''Create a new subdomain to host the application'''%0a> %0a> [=%0a> /var/nsd/zones/master/example.com.zone:%0a> ; webmail service%0a> webmail A 10.10.10.10%0a> webmail AAAA 2605:6400:30:faa1::%0a> %0a> doas rcctl -d restart nsd%0a> doas rcctl -d restart unbound%0a> =]%0a> %0a> '''Creating a new virtual host where applications will be hosted''''%0a> %0a> [=%0a> /etc/httpd.conf:%0a> server "webmail.example.com.zone" {%0a42,44c22,30%0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a---%0a> #listen on * tls port 443%0a> #tls {%0a> # certificate "/etc/ssl/webmail.example.com.fullchain.pem"%0a> # key "/etc/ssl/private/webmail.example.com.org.key"%0a> #}%0a> directory index index.php%0a> root "/htdocs/webmail"%0a> location "/class/*" {%0a> block return 403%0a46,48c32,33%0a%3c location "*.php" {%0a%3c fastcgi socket "/run/php-fpm.sock"%0a%3c root "/htdocs/mail.example.com"%0a---%0a> location "/config/*" {%0a> block return 403%0a50,57c35%0a%3c directory index "index.php"%0a%3c connection max request body 26214400%0a%3c log access "webmail_access.log"%0a%3c log error "webmail_error.log"%0a%3c }%0a%3c @]%0a%3c (:if false:)%0a%3c location "/class/*" {%0a---%0a> location "/contrib/*" {%0a60c38%0a%3c location "/config/*" {%0a---%0a> location "/data/*" {%0a63c41%0a%3c location "/contrib/*" {%0a---%0a> location "/doc/*" {%0a66c44%0a%3c location "/data/*" {%0a---%0a> location "/functions/*" {%0a69c47%0a%3c location "/doc/*" {%0a---%0a> location "/help/*" {%0a72c50%0a%3c location "/functions/*" {%0a---%0a> location "/include/*" {%0a75c53%0a%3c location "/help/*" {%0a---%0a> location "/locale/*" {%0a78c56%0a%3c location "/include/*" {%0a---%0a> location "/po/*" {%0a81,82c59,61%0a%3c location "/locale/*" {%0a%3c block return 403%0a---%0a> location "/.well-known/acme-challenge/*" {%0a> root "/acme"%0a> request strip 2%0a84,85c63,64%0a%3c location "/po/*" {%0a%3c block return 403%0a---%0a> location "*.php" {%0a> fastcgi socket "/run/php-fpm.sock"%0a87,108c66,67%0a%3c (:ifend:)%0a%3c %0a%3c For SSL/TLS, we recommend you use [[relayd/TLSMulti|relayd for TLS acceleration]] rather than httpd's native SSL. This is so you can provide web services that do not use [[openhttpd/intro|openhttpd]].%0a%3c %0a%3c !! TLS with relayd%0a%3c %0a%3c When [[relayd/TLSMulti|using relayd for TLS acceleration]], all that is needed are a few lines in /etc/relayd.conf:%0a%3c %0a%3c [@%0a%3c tls { keypair mail.example.com }%0a%3c @]%0a%3c %0a%3c Replace @@mail.example.com@@ with your real domain. This provides the TLS cert for webmail.%0a%3c %0a%3c In /etc/acme-client.conf, add this block:%0a%3c %0a%3c [@%0a%3c domain mail.example.com {%0a%3c alternative names { example.com imap.example.com smtp.example.com pop.example.com pop3.example.com}%0a%3c domain key "/etc/ssl/private/mail.example.com.key"%0a%3c domain full chain certificate "/etc/ssl/mail.example.com.crt"%0a%3c sign with letsencrypt%0a---%0a> log access "webmail_access.log"%0a> log error "webmail_error.log"%0a110,350d68%0a%3c @]%0a%3c %0a%3c Request the cert:%0a%3c %0a%3c [@%0a%3c $ doas acme-client -v mail.example.com%0a%3c @]%0a%3c %0a%3c Normally, the user www has no login shell for security. However, squirrelmail has this unusual perl configuration script that www needs to run. So first, we give www the default ksh shell:%0a%3c %0a%3c [@%0a%3c $ doas chsh -s /bin/ksh www%0a%3c @]%0a%3c %0a%3c Then, we switch to the user www and run the config script:%0a%3c %0a%3c [@%0a%3c $ doas su www%0a%3c $ cd /var/www/htdocs/mail.example.com/config%0a%3c $ perl conf.pl%0a%3c @]%0a%3c %0a%3c You should see the interactive menu:%0a%3c %0a%3c [@%0a%3c SquirrelMail Configuration : Read: config_default.php (1.4.0)%0a%3c ---------------------------------------------------------%0a%3c Main Menu --%0a%3c 1. Organization Preferences%0a%3c 2. Server Settings%0a%3c 3. Folder Defaults%0a%3c 4. General Options%0a%3c 5. Themes%0a%3c 6. Address Books%0a%3c 7. Message of the Day (MOTD)%0a%3c 8. Plugins%0a%3c 9. Database%0a%3c 10. Languages%0a%3c %0a%3c D. Set pre-defined settings for specific IMAP servers%0a%3c %0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> 2%0a%3c @]%0a%3c %0a%3c Type 2 to edit Server Settings:%0a%3c %0a%3c [@%0a%3c Server Settings%0a%3c %0a%3c General%0a%3c -------%0a%3c 1. Domain : mail.example.com%0a%3c 2. Invert Time : false%0a%3c 3. Sendmail or SMTP : SMTP%0a%3c %0a%3c IMAP Settings%0a%3c --------------%0a%3c 4. IMAP Server : localhost%0a%3c 5. IMAP Port : 143%0a%3c 6. Authentication type : login%0a%3c 7. Secure IMAP (TLS) : false%0a%3c 8. Server software : dovecot%0a%3c 9. Delimiter : detect%0a%3c %0a%3c B. Change Sendmail Config : /usr/sbin/sendmail%0a%3c H. Hide IMAP Server Settings%0a%3c %0a%3c R Return to Main Menu%0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> B%0a%3c @]%0a%3c %0a%3c Once you're done with configuration, save your work and quit:%0a%3c %0a%3c [@%0a%3c Command >> S%0a%3c Data saved in config.php%0a%3c Press enter to continue...%0a%3c %0a%3c Command >> Q%0a%3c Exiting conf.pl.%0a%3c You might want to test your configuration by browsing to%0a%3c http://your-squirrelmail-location/src/configtest.php%0a%3c Happy SquirrelMailing!%0a%3c @]%0a%3c %0a%3c Logout by typing ctrl+d and then disable the login shell for www:%0a%3c %0a%3c [@%0a%3c $ ^D%0a%3c $ doas chsh -s /sbin/nologin www%0a%3c @]%0a%3c %0a%3c Because Squirrelmail will connect to IMAP via localhost, you will need a listener for 127.0.0.1 in /etc/dovecot/dovecot.conf:%0a%3c %0a%3c [@%0a%3c listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a%3c @]%0a%3c %0a%3c You will want to restart dovecot if you need to make the change:%0a%3c %0a%3c [@%0a%3c $ doas rcctl restart dovecot%0a%3c @]%0a%3c %0a%3c We need to create folders that squirrelmail can write data to:%0a%3c %0a%3c [@%0a%3c $ doas mkdir -p /var/www/var/local/squirrelmail/data%0a%3c $ doas mkdir -p /var/www/var/local/squirrelmail/attach%0a%3c $ doas chown -R www:daemon /var/www/var/local/squirrelmail%0a%3c $ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a%3c @]%0a%3c %0a%3c Remember, openhttpd runs chrooted in /var/www by default, which means you will%0a%3c need to copy some essential system files.%0a%3c %0a%3c If it does not exist already, create /var/www/etc/resolv.conf:%0a%3c %0a%3c [@%0a%3c lookup file bind%0a%3c nameserver 127.0.0.1%0a%3c @]%0a%3c %0a%3c This provides information on where to lookup DNS records. You will need%0a%3c to [[unbound/configure|configure unbound]].%0a%3c %0a%3c If it does not exist already, create /var/www/etc/hosts:%0a%3c %0a%3c [@%0a%3c 127.0.0.1 localhost%0a%3c ::1 localhost%0a%3c @]%0a%3c %0a%3c This defines localhost to be 127.0.0.1, which is necessary since squirrelmail will query IMAP and SMTP by using localhost.%0a%3c %0a%3c Troubleshooting:%0a%3c %0a%3c !!! Error opening%0a%3c %0a%3c [@%0a%3c ERROR%0a%3c Error opening ../data/default_pref%0a%3c Could not create initial preference file!%0a%3c /var/local/squirrelmail/data/ should be writable by user%0a%3c Please contact your system administrator and report this error.%0a%3c Go to the login page%0a%3c @]%0a%3c %0a%3c Make sure to create folders that squirrelmail can write to:%0a%3c %0a%3c [@%0a%3c $ doas mkdir -p /var/www/var/local/squirrelmail/data%0a%3c $ doas mkdir -p /var/www/var/local/squirrelmail/attach%0a%3c $ doas chown -R www:daemon /var/www/var/local/squirrelmail%0a%3c $ doas chmod -R o-rx /var/www/var/local/squirrelmail%0a%3c @]%0a%3c %0a%3c !!! Squirrelmail cannot connect to IMAP%0a%3c %0a%3c Make sure you have a listener for 127.0.0.1 in /etc/dovecot/dovecot.conf:%0a%3c %0a%3c [@%0a%3c listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a%3c @]%0a%3c %0a%3c Afterwards, restart dovecot if any changes were made:%0a%3c %0a%3c [@%0a%3c $ doas rcctl restart dovecot%0a%3c @]%0a%3c %0a%3c If Squirrelmail cannot resolve the name localhost, make sure you have the file /var/www/etc/hosts defined (see above).%0a%3c %0a%3c !!! Check logs%0a%3c %0a%3c Check /var/www/logs/error.log for additional logs for debugging.%0a%3c %0a%3c !! Sendmail%0a%3c %0a%3c Squirrelmail should be able to use sendmail instead of SMTP. However, on OpenBSD 6.9, there appears to be some issues with the replacement femail instead of sendmail.%0a%3c %0a%3c '''WARNING''': This setup has errors.%0a%3c %0a%3c To setup femail:%0a%3c %0a%3c $ doas mkdir -p /var/www/etc/%0a%3c %0a%3c Create /var/www/etc/femail.conf:%0a%3c %0a%3c [@%0a%3c smtphost=127.0.0.1%0a%3c myname=mail.example.com%0a%3c @]%0a%3c %0a%3c Test if femail works%0a%3c %0a%3c [@%0a%3c $ doas chroot -u www -g daemon /var/www /bin/femail -t -fusername@mail.example.com%0a%3c To: other@domain.com%0a%3c Subject: Alpha Bravo%0a%3c MIME-Version: 1.0%0a%3c Content-Type: text/plain; charset=us-ascii%0a%3c Content-Disposition: inline%0a%3c %0a%3c Charlie Delta Echo Foxtrot%0a%3c @]%0a%3c %0a%3c Type ctrl+d to end the message%0a%3c %0a%3c !! PHP 8.0%0a%3c %0a%3c When using PHP 8.0+, PHP complains that Squirrelmail is trying to use curly braces in a way that is no longer supported. You should see error messages like the following in /var/www/logs/error.log:%0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.example.com/functions/strings.php on line 634%0a%3c %0a%3c You need to look up every instance of misused {} curly braces and replace them with brackets [].%0a%3c %0a%3c $String .= $chars[mt_rand(0, $j)];%0a%3c For the application to work, the mail system must already be configured and started on the server.%0a%3c %0a%3c %0a%3c '''Create a new subdomain to host the application'''%0a%3c %0a%3c [=%0a%3c /var/nsd/zones/master/example.com.zone:%0a%3c ; webmail service%0a%3c webmail A 10.10.10.10%0a%3c webmail AAAA 2605:6400:30:faa1::%0a%3c %0a%3c doas rcctl -d restart nsd%0a%3c doas rcctl -d restart unbound%0a%3c =]%0a%3c %0a
44
2021-12-17
diff:1628271843:1628245866:=138,364d137%0a%3c %0a%3c %0a%3c [@%0a%3c %0a%3c Warning: you must use php-7.4.22%0a%3c %0a%3c $ ftp https://managedway.dl.sourceforge.net/project/squirrelmail/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a%3c $ tar xvzf squirrelmail-webmail-1.4.22.tar.gz%0a%3c $ doas mv squirrelmail-webmail-1.4.22 /var/www/htdocs/mail.example.com%0a%3c $ doas chown -R www:daemon /var/www/htdocs/mail.example.com/%0a%3c $ doas chmod -R o-rx /var/www/htdocs/mail.example.com/%0a%3c %0a%3c Add this to /etc/httpd.conf:%0a%3c %0a%3c server "mail.example.com" {%0a%3c listen on * port 80%0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a%3c }%0a%3c location "*.php" {%0a%3c fastcgi socket "/run/php-fpm.sock"%0a%3c root "/htdocs/mail.example.com"%0a%3c }%0a%3c directory {%0a%3c index "index.php"%0a%3c }%0a%3c connection max request body 26214400%0a%3c }%0a%3c %0a%3c In /etc/relayd.conf:%0a%3c %0a%3c tls { keypair mail.host.ircnow.org }%0a%3c %0a%3c In /etc/acme-client.conf:%0a%3c %0a%3c domain mail.jrmu.host.ircnow.org {%0a%3c alternative names { jrmu.host.ircnow.org imap.jrmu.host.ircnow.org smtp.jrmu.hos%0a%3c t.ircnow.org pop.jrmu.host.ircnow.org pop3.jrmu.host.ircnow.org }%0a%3c domain key "/etc/ssl/private/mail.jrmu.host.ircnow.org.key"%0a%3c domain full chain certificate "/etc/ssl/mail.jrmu.host.ircnow.org.crt"%0a%3c sign with letsencrypt%0a%3c }%0a%3c %0a%3c $ doas chsh -s /bin/ksh www%0a%3c $ doas su www%0a%3c $ cd /var/www/htdocs/mail.example.com/config%0a%3c $ perl conf.pl%0a%3c %0a%3c SquirrelMail Configuration : Read: config_default.php (1.4.0)%0a%3c ---------------------------------------------------------%0a%3c Main Menu --%0a%3c 1. Organization Preferences%0a%3c 2. Server Settings%0a%3c 3. Folder Defaults%0a%3c 4. General Options%0a%3c 5. Themes%0a%3c 6. Address Books%0a%3c 7. Message of the Day (MOTD)%0a%3c 8. Plugins%0a%3c 9. Database%0a%3c 10. Languages%0a%3c %0a%3c D. Set pre-defined settings for specific IMAP servers%0a%3c %0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> 2%0a%3c %0a%3c Server Settings%0a%3c %0a%3c General%0a%3c -------%0a%3c 1. Domain : jrmu.host.ircnow.org%0a%3c 2. Invert Time : false%0a%3c 3. Sendmail or SMTP : Sendmail%0a%3c %0a%3c IMAP Settings%0a%3c --------------%0a%3c 4. IMAP Server : 127.0.0.1%0a%3c 5. IMAP Port : 143%0a%3c 6. Authentication type : login%0a%3c 7. Secure IMAP (TLS) : false%0a%3c 8. Server software : dovecot%0a%3c 9. Delimiter : detect%0a%3c %0a%3c B. Change Sendmail Config : /usr/sbin/sendmail%0a%3c H. Hide IMAP Server Settings%0a%3c %0a%3c R Return to Main Menu%0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> B%0a%3c %0a%3c %0a%3c SquirrelMail Configuration : Read: config.php (1.4.0)%0a%3c ---------------------------------------------------------%0a%3c Server Settings%0a%3c %0a%3c General%0a%3c -------%0a%3c 1. Domain : jrmu.host.ircnow.org%0a%3c 2. Invert Time : false%0a%3c 3. Sendmail or SMTP : Sendmail%0a%3c %0a%3c Sendmail%0a%3c --------%0a%3c 4. Sendmail Path : /bin/femail%0a%3c 5. Sendmail arguments : -t%0a%3c 6. Header encryption key : %0a%3c %0a%3c A. Update IMAP Settings : 127.0.0.1:143 (dovecot)%0a%3c H. Hide Sendmail Settings%0a%3c %0a%3c R Return to Main Menu%0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> %0a%3c %0a%3c %0a%3c SquirrelMail Configuration : Read: config_default.php (1.4.0)%0a%3c ---------------------------------------------------------%0a%3c Main Menu --%0a%3c 1. Organization Preferences%0a%3c 2. Server Settings%0a%3c 3. Folder Defaults%0a%3c 4. General Options%0a%3c 5. Themes%0a%3c 6. Address Books%0a%3c 7. Message of the Day (MOTD)%0a%3c 8. Plugins%0a%3c 9. Database%0a%3c 10. Languages%0a%3c %0a%3c D. Set pre-defined settings for specific IMAP servers%0a%3c %0a%3c C Turn color on%0a%3c S Save data%0a%3c Q Quit%0a%3c %0a%3c Command >> S%0a%3c %0a%3c Data saved in config.php%0a%3c Press enter to continue...%0a%3c %0a%3c Exiting conf.pl.%0a%3c You might want to test your configuration by browsing to%0a%3c http://your-squirrelmail-location/src/configtest.php%0a%3c Happy SquirrelMailing!%0a%3c %0a%3c jrmu$ ^D%0a%3c $ doas chsh -s /sbin/nologin www%0a%3c %0a%3c %0a%3c Make sure /etc/dovecot/dovecot.conf:%0a%3c %0a%3c listen = 38.87.162.8, 2602:fccf:1:1008::, 127.0.0.1%0a%3c %0a%3c need 127.0.0.1%0a%3c %0a%3c check /var/www/logs/error.log%0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/strings.php on line 634%0a%3c %0a%3c You need to change this one line in /var/www/htdocs/mail.example.com/functions/strings.php:%0a%3c %0a%3c $String .= $chars[mt_rand(0, $j)];%0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 468%0a%3c %0a%3c $char = $read[$i]; %0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 475%0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_messages.php on line 637%0a%3c %0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_general.php on line 214%0a%3c PHP message: PHP Fatal error: Array and string offset access syntax with curly braces is no longer supported in /htdocs/mail.jrmu.host.ircnow.org/functions/imap_general.php on line 215%0a%3c %0a%3c $ doas mkdir -p /var/www/var/local/squirreilmail/data%0a%3c $ doas chown -R www:daemon /var/www/var/local/squirreilmail%0a%3c $ doas chmod -R o-rx /var/www/var/local/squirreilmail%0a%3c %0a%3c Setup femail:%0a%3c %0a%3c $ doas mkdir -p /var/www/etc/%0a%3c %0a%3c Create /var/www/etc/femail.conf:%0a%3c %0a%3c smtphost=127.0.0.1%0a%3c myname=mail.example.com%0a%3c %0a%3c Test if femail works%0a%3c %0a%3c $ doas chroot -u www -g daemon /var/www /bin/femail -t -fusername@mail.example.com%0a%3c To: other@domain.com%0a%3c Subject: Alpha Bravo%0a%3c MIME-Version: 1.0%0a%3c Content-Type: text/plain; charset=us-ascii%0a%3c Content-Disposition: inline%0a%3c %0a%3c Charlie Delta Echo Foxtrot%0a%3c %0a%3c Type ctrl+d to end the message%0a%3c %0a%3c %0a%3c Optional:%0a%3c %0a%3c $ rm squirrelmail-webmail-1.4.22.tar.gz%0a%3c %0a%3c Troubleshooting:%0a%3c %0a%3c ERROR%0a%3c Error opening ../data/default_pref%0a%3c Could not create initial preference file!%0a%3c /var/local/squirrelmail/data/ should be writable by user%0a%3c Please contact your system administrator and report this error.%0a%3c Go to the login page%0a%3c %0a%3c %0a%3c @]%0a
47
2021-12-17
diff:1628245866:1628245866:=1,137d0%0a%3c For the application to work, the mail system must already be configured and started on the server.%0a%3c %0a%3c %0a%3c '''Create a new subdomain to host the application'''%0a%3c %0a%3c [=%0a%3c /var/nsd/zones/master/example.com.zone:%0a%3c ; webmail service%0a%3c webmail A 10.10.10.10%0a%3c webmail AAAA 2605:6400:30:faa1::%0a%3c %0a%3c doas rcctl -d restart nsd%0a%3c doas rcctl -d restart unbound%0a%3c =]%0a%3c %0a%3c '''Creating a new virtual host where applications will be hosted''''%0a%3c %0a%3c [=%0a%3c /etc/httpd.conf:%0a%3c server "webmail.example.com.zone" {%0a%3c listen on * port 80%0a%3c #listen on * tls port 443%0a%3c #tls {%0a%3c # certificate "/etc/ssl/webmail.example.com.fullchain.pem"%0a%3c # key "/etc/ssl/private/webmail.example.com.org.key"%0a%3c #}%0a%3c directory index index.php%0a%3c root "/htdocs/webmail"%0a%3c location "/class/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/config/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/contrib/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/data/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/doc/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/functions/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/help/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/include/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/locale/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/po/*" {%0a%3c block return 403%0a%3c }%0a%3c location "/.well-known/acme-challenge/*" {%0a%3c root "/acme"%0a%3c request strip 2%0a%3c }%0a%3c location "*.php" {%0a%3c fastcgi socket "/run/php-fpm.sock"%0a%3c }%0a%3c log access "webmail_access.log"%0a%3c log error "webmail_error.log"%0a%3c }%0a%3c =]%0a%3c %0a%3c %0a%3c doas rcctl -d restart httpd%0a%3c %0a%3c %0a%3c '''Configuring the certificate generation service'''%0a%3c %0a%3c [=%0a%3c /etc/acme-client.conf:%0a%3c domain webmail.example.com {%0a%3c domain key "/etc/ssl/private/webmail.example.com.key"%0a%3c domain certificate "/etc/ssl/webmail.example.com.crt"%0a%3c domain full chain certificate "/etc/ssl/webmail.example.com.fullchain.pem"%0a%3c sign with letsencrypt%0a%3c challengedir "/var/www/acme"%0a%3c }%0a%3c =]%0a%3c doas acme-client -Fv webmail.example.com%0a%3c (!)you must set new certs to virtual host config and restart httpd again%0a%3c %0a%3c %0a%3c '''Creating an environment for the application to work'''%0a%3c [=%0a%3c doas mkdir /var/www/webmail%0a%3c doas mkdir /var/www/webmail/data%0a%3c doas mkdir /var/www/webmail/attachments%0a%3c %0a%3c doas chown www:www /var/www/webmail%0a%3c doas chown www:www /var/www/webmail/data%0a%3c doas chown www:www /var/www/webmail/attachments%0a%3c %0a%3c doas chmod 700 /var/www/webmail%0a%3c doas chmod 700 /var/www/webmail/data%0a%3c doas chmod 700 /var/www/webmail/attachments%0a%3c =]%0a%3c %0a%3c '''Installing the application on the server'''%0a%3c [=%0a%3c cd ~/%0a%3c wget https://sourceforge.net/projects/squirrelmail/files/stable/1.4.22/squirrelmail-webmail-1.4.22.tar.gz%0a%3c tar -xvzf squirrelmail-webmail-1.4.22.tar.gz%0a%3c doas cp -r squirrelmail-webmail-1.4.22/ /var/www/htdocs/webmail/%0a%3c %0a%3c cd /var/www/htdocs/%0a%3c doas chown root:bin webmail%0a%3c doas find ./webmail -type d -exec chmod 755 {} \;%0a%3c doas find ./webmail -type f -exec chmod 644 {} \;%0a%3c doas rm /var/www/htdocs/webmail/README %0a%3c doas rm /var/www/htdocs/webmail/configure%0a%3c =]%0a%3c %0a%3c '''PHP 7 compatibility fix'''%0a%3c [=%0a%3c functions/global.php (451):%0a%3c function sqsession_is_active() {%0a%3c if (session_status() === PHP_SESSION_ACTIVE) { return; }%0a%3c sqsession_start();%0a%3c }%0a%3c =]%0a%3c %0a%3c '''Configuring'''%0a%3c [=%0a%3c doas touch /var/www/htdocs/webmail/config/config.php%0a%3c doas chown www:www /var/www/htdocs/webmail/config/config.php%0a%3c doas chmod 400 /var/www/htdocs/webmail/config/config.php%0a%3c =]%0a%3c %0a%3c [[https://wiki.ircnow.org/uploads/Openbsd/config.php.zip|config.php.zip]]%0a