[BlueOnyx:25802] Re: 5211R: errors in postfix, gui and mboxfix.pl

Michael Stauber mstauber at blueonyx.it
Thu Dec 8 14:33:45 -05 2022


Hi Juerg,

> Today I installed the system with yum (dnf groupinstall blueonyx) from 
> scratch in a fresh vm.

Thank you for that!

> First: mboxfix and the gui problem in network are fixed now, thanks!

Very well!

> But the postfix problem still persists. Here my 
> /tmp/blueonyx-glue-post-install.log
>
> Ran external /usr/sausalito/scripts/init.sh to complete post-install
> 
> After your update, the script was executed and /usr/sausalito/runonce is 
> empty.
> 
> But the sendmail.cf is still invalid and newaliases don't work. Running 
> /usr/sausalito/scripts/initSendmail.sh manually doesn't fix the problem.

You're right. The conditionals in initSendmail.sh to rotate the right 
sendmail.mc in were garbage. The code for that is something that's been 
the same since the 5106R days and has only been adapted once majordomo 
go replaced with mailman. It rotates the right sendmail.mc in if there 
is either majordomo *or* mailman. But if we have neither of those two 
(like on 5211R) it does nothing useful.

I just ditched that entire section and rewrote it:

https://devel.blueonyx.it/trac/changeset/4443/BlueOnyx/5211R

That should now make sure that the right sendmail.mc is copied over on 
initial setup. And ONLY then.

Because there is something else: We do NOT want the entire batch of 
symlinked initial setup-script to be run whenever the RPM 
"base-blueonyx" is updated. Because it does a lot of redundant stuff and 
also edits /root/.bashrc to redirect you to the network_settings.sh 
script, which is highly annoying if it IS NOT a freshly installed system.

So I also modified the Systemd Unit file "blueonyx.service" and 
/usr/sausalito/sbin/bx_runonce.sh to check if the GUI based initial 
setup has been completed. And if so, then it will just remove the 
symlinks from /usr/sausalito/runonce/ and will not execute ANY 
setup-scripts.

However: How do we fix installs like yours where the initial web based 
setup has already been completed, but sendmail.mc is still borked?

https://devel.blueonyx.it/trac/changeset/4444/BlueOnyx/5211R

I also edited "hotfixes.sh" of "swatch", which runs every 15 minutes and 
also after each "yum update".

That now checks if /etc/mail/sendmail.mc still has /etc/aliases set and 
if so, it executes /usr/sausalito/scripts/initSendmail.sh selectively to 
fix the issue.

Both fixes combined should fix the issue on both new and also on 
existing installs.

> And there's today on my new vm also a problem to send mails to 
> admin at blueonyx9.home.local. blueonyx9.home.local is my FQDN of the 
> server, in this setup I haven't created any vhosts.

Yeah, email to "admin" (or user not associated to a Vsite such as "Extra 
Admins" goes to the hostname of the server itself.

So if you box is called "blueonyx9.home.local", then 
admin at blueonyx9.home.local would be the email address of user "admin".

For this to work you either need the proper entry in /etc/hosts or 
working DNS records for it.

In fact the top of your /etc/hosts should already look like this, as the 
GUI does this automatically for you:

--------------------------------------------------------------------
# /etc/hosts
# Auto-generated file. Please put your customizations at the very end.

# Entries for localhost and primary IP address:
127.0.0.1                   localhost.localdomain           localhost
<your-ip>                   blueonyx9.home.local            blueonyx9
[...]
--------------------------------------------------------------------

 > Also check the if around this block:
 > /bin/grep 'setup for BlueOnyx' /etc/mail/sendmail.mc > /dev/null 2>&1
 >
 > IMHO, this line also needs to be inverted, you would patch the file

Yeah, that's "the old way" of doing it and I never found it to be that 
transparent in meaning.

These days I prefer to do it like shown below, which is a lot easier to 
read and understand:

-----------------------------------------------------------------------
CFGDONE=$(cat /etc/mail/sendmail.mc|grep 'setup for BlueOnyx'|wc -l)
if [ "$CFGDONE" -eq '0' ];then
	# Do something
else
	# Or don't
fi
-----------------------------------------------------------------------

Using "cat" and "grep" to search through a file for a string and then 
passing the result through "wc -l" to see how many matching results were 
there. That yields either "0" if there is nothing or the number of 
results it found. That's then also a hell of a lot easier to use in 
conditionals as you can do numerical compares: -eq, -lt or -gt

Anyway: I just published these YUM updates, a new ISO image for 5211R 
and new disk images.

In your case installing the YUM updates should fix your BlueOnyx 5211R 
as it will now make sure that the right sendmail.mc is present.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list