Stuck at home amidst Covid19 lockdown at my place gave me the
opportunity to try out FreeBSD & Mac OSX. indimail-mta
(qmail+ucspi-tcp+daemontools+serialmail) now compiles/works on
FreeBSD & OSX. Have also spent some decent time on documentation.
The source installation on Linux, FreeBSD, OSX has a script
default.configure for each & every package. This script has to be run
once before make. This script hides the complexities & vagaries of
various UNIX distributions. The steps have been tested on
a) All (suse, redhat, debian) Linux distributions
b) FreeBSD 12.1-RELEASE-p10
c) Darwin 19.6.0; root:xnu-6153.141.2~1/RELEASE_X86_64
d) raspberry pi (2,3,4) (aarch64 and armv7l)
e) banana pi (armv7l) Debian 10
f) Sparky (armv7l) Debian 9 https://www.allo.com/sparky/sparky-sbc.html
(my music player that plays music using mpd and selects music
as per my taste, based on mpdev using the libqmail library).
There are however differences between the Linux & FreeBSD/OSX
versions. The difference between Linux, FreeBSD & OSX are
1. For a wildcard address, tcpserver on FreeBSD has to open two sockets
(ipv4 + ipv6). This is to address the limitation of FreeBSD not routing
ipv4 traffic to AF_INET6 sockets) - (output of netstat -an)
FreeBSD: tcp4 0 0 *.25 *.* LISTEN
tcp6 0 0 *.25 *.* LISTEN
Mac OSX: tcp46 0 0 *.25 *.* LISTEN
Linux : tcp6 0 0 :::25 :::* LISTEN
2. tcpserver uses dlmopen(3) on Linux to load qmail-smtpd, rblsmtpd shared
library objects. Since FreeBSD/OSX doesn't have dlmopen(3), dlopen(3) is
used instead.
3. Mac OSX has a crippled crypt(3) function. So, on OSX, indimail-mta uses
internal crypt functions from libqmail (md5, sha256, sha512) for SMTP,
IMAP, POP3 authentication & user account password management.
4. The linux setup uses alternatives command to set aliases for sendmail,
mailq, newaliases. The FreeBSD setup (mailwrapper) uses
/etc/mail/mailer.conf. Mac OSX however is broken. It doesn't allow
/usr/sbin/sendmail to be replaced with System Integrity Protection
enabled. Program/Scripts will have to use /usr/bin/sendmail or
qmail-inject
5. Linux setup uses /usr as the prefix. FreeBSD, OSX setup uses /usr/local.
On OSX, development files/libs go to /opt/local/include, /opt/local/lib
6. Linux uses systemctl, FreeBSD uses /usr/local/etc/rc.d/svscan. On
FreeBSD, rc startup uses daemon(8) to start svscan in supervised mode.
Additionally, svscan does a setsid(2) to become a session leader.
OSX uses launchctl unit file /Library/LaunchDaemons/org.indimail.svsan
7. FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581)
Apple clang version 12.0.0 on Mac OSX 19.6.0.
Linux gcc version 10.2.1 20200723 (Red Hat 10.2.1-1)
8. syscall deprecated on OSX, hence for Bruce Guenter's syncdir a new
syncdir.h included in qmail-local.c, qmail-queue.c, qmail-send/todo to
wrap open(), link(), unlink(), rename() syscalls
9. Mac OSX doesn't have a Name Service Switch (NSS). Hence on OSX,
indimail-mta cannot wrap calls like getpwnam, getpwent, getgrent to get
data from the IndiMail's MySQL database. Hence one has to write specific
auth modules for any IMAP/POP3 server that you may want to use with
indimail. On Linux & FreeBSD, you can use any IMAP/POP3 server without
modifying any code. No need to write code for creating authentication
modules. If your IMAP/POP3 has a PAM module that works, it will work
transparently with IndiMail users in MySQL database. On OSX you will be
restricted to use system accounts for IMAP/POP3 if you don't use
courier-imap. For courier-imap, indimail has a authmodule that works
on all platforms without PAM support.
10. On raspberry pi aarch64, the syscalls open, link, unlink, rename
had to be replaced with openat, linkat, unlinkat, renameat (syncdir.c)
Link to github source. The README.md comes with installation & setup
instructions.
https://github.com/mbhangui/libqmail
https://github.com/mbhangui/indimail-mta
Both indimail-mta & indimail-virtualdomains use libqmail for common
functions.
Wiki for indimail-mta, indimail
https://github.com/mbhangui/indimail-mta/wiki/IndiMail
Binary packages for Redhat/CentOS/Debian/Ubuntu
https://software.opensuse.org/download.html?project=home%3Aindimail&package=indimail-mta
Docker Image Repository
https://hub.docker.com/r/cprogrammer/indimail-mta
Also updated for FreeBSD/Darwin is the indimail-virtualdomains,
indimail-auth, indimail-access, indimail-spamfilter all available
at https://github.com/mbhangui/indimail-virtualdomains
If you try it and find bugs, let me know. I can say that I will spare no
efforts to fix them. Feel free to email me directly. If you have a Unix,
Linux distro that you like, I would love to make indimail-mta work on it.
--
Regards Manvendra - http://www.indimail.org
GPG Pub Key
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC7CBC760014D250C
opportunity to try out FreeBSD & Mac OSX. indimail-mta
(qmail+ucspi-tcp+daemontools+serialmail) now compiles/works on
FreeBSD & OSX. Have also spent some decent time on documentation.
The source installation on Linux, FreeBSD, OSX has a script
default.configure for each & every package. This script has to be run
once before make. This script hides the complexities & vagaries of
various UNIX distributions. The steps have been tested on
a) All (suse, redhat, debian) Linux distributions
b) FreeBSD 12.1-RELEASE-p10
c) Darwin 19.6.0; root:xnu-6153.141.2~1/RELEASE_X86_64
d) raspberry pi (2,3,4) (aarch64 and armv7l)
e) banana pi (armv7l) Debian 10
f) Sparky (armv7l) Debian 9 https://www.allo.com/sparky/sparky-sbc.html
(my music player that plays music using mpd and selects music
as per my taste, based on mpdev using the libqmail library).
There are however differences between the Linux & FreeBSD/OSX
versions. The difference between Linux, FreeBSD & OSX are
1. For a wildcard address, tcpserver on FreeBSD has to open two sockets
(ipv4 + ipv6). This is to address the limitation of FreeBSD not routing
ipv4 traffic to AF_INET6 sockets) - (output of netstat -an)
FreeBSD: tcp4 0 0 *.25 *.* LISTEN
tcp6 0 0 *.25 *.* LISTEN
Mac OSX: tcp46 0 0 *.25 *.* LISTEN
Linux : tcp6 0 0 :::25 :::* LISTEN
2. tcpserver uses dlmopen(3) on Linux to load qmail-smtpd, rblsmtpd shared
library objects. Since FreeBSD/OSX doesn't have dlmopen(3), dlopen(3) is
used instead.
3. Mac OSX has a crippled crypt(3) function. So, on OSX, indimail-mta uses
internal crypt functions from libqmail (md5, sha256, sha512) for SMTP,
IMAP, POP3 authentication & user account password management.
4. The linux setup uses alternatives command to set aliases for sendmail,
mailq, newaliases. The FreeBSD setup (mailwrapper) uses
/etc/mail/mailer.conf. Mac OSX however is broken. It doesn't allow
/usr/sbin/sendmail to be replaced with System Integrity Protection
enabled. Program/Scripts will have to use /usr/bin/sendmail or
qmail-inject
5. Linux setup uses /usr as the prefix. FreeBSD, OSX setup uses /usr/local.
On OSX, development files/libs go to /opt/local/include, /opt/local/lib
6. Linux uses systemctl, FreeBSD uses /usr/local/etc/rc.d/svscan. On
FreeBSD, rc startup uses daemon(8) to start svscan in supervised mode.
Additionally, svscan does a setsid(2) to become a session leader.
OSX uses launchctl unit file /Library/LaunchDaemons/org.indimail.svsan
7. FreeBSD clang version 8.0.1 (tags/RELEASE_801/final 366581)
Apple clang version 12.0.0 on Mac OSX 19.6.0.
Linux gcc version 10.2.1 20200723 (Red Hat 10.2.1-1)
8. syscall deprecated on OSX, hence for Bruce Guenter's syncdir a new
syncdir.h included in qmail-local.c, qmail-queue.c, qmail-send/todo to
wrap open(), link(), unlink(), rename() syscalls
9. Mac OSX doesn't have a Name Service Switch (NSS). Hence on OSX,
indimail-mta cannot wrap calls like getpwnam, getpwent, getgrent to get
data from the IndiMail's MySQL database. Hence one has to write specific
auth modules for any IMAP/POP3 server that you may want to use with
indimail. On Linux & FreeBSD, you can use any IMAP/POP3 server without
modifying any code. No need to write code for creating authentication
modules. If your IMAP/POP3 has a PAM module that works, it will work
transparently with IndiMail users in MySQL database. On OSX you will be
restricted to use system accounts for IMAP/POP3 if you don't use
courier-imap. For courier-imap, indimail has a authmodule that works
on all platforms without PAM support.
10. On raspberry pi aarch64, the syscalls open, link, unlink, rename
had to be replaced with openat, linkat, unlinkat, renameat (syncdir.c)
Link to github source. The README.md comes with installation & setup
instructions.
https://github.com/mbhangui/libqmail
https://github.com/mbhangui/indimail-mta
Both indimail-mta & indimail-virtualdomains use libqmail for common
functions.
Wiki for indimail-mta, indimail
https://github.com/mbhangui/indimail-mta/wiki/IndiMail
Binary packages for Redhat/CentOS/Debian/Ubuntu
https://software.opensuse.org/download.html?project=home%3Aindimail&package=indimail-mta
Docker Image Repository
https://hub.docker.com/r/cprogrammer/indimail-mta
Also updated for FreeBSD/Darwin is the indimail-virtualdomains,
indimail-auth, indimail-access, indimail-spamfilter all available
at https://github.com/mbhangui/indimail-virtualdomains
If you try it and find bugs, let me know. I can say that I will spare no
efforts to fix them. Feel free to email me directly. If you have a Unix,
Linux distro that you like, I would love to make indimail-mta work on it.
--
Regards Manvendra - http://www.indimail.org
GPG Pub Key
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xC7CBC760014D250C