[BlueOnyx:25016] Re: Bulk mailing

Michael Stauber mstauber at blueonyx.it
Thu Jul 22 14:31:47 -05 2021


Hi Colin,

> I want to email all users on one of our servers to warn of some
> disruption during upgrades.
> 
> I haven’t done this for years but seem to remember there was a quick and
> easy way of doing it in the past.

You can do this via email forwarding on a BlueOnyx. Create a new account
somewhere. For example let us create user 'mailall'.

Then you activate email forwarding of that user and forward all emails
he receives to (for example) your support account.

Then you run a conglomerate of shell commands to get a list of all users
and append that list (properly formatted) to the .forward which user
'mailall' has.

Like this for example:

cat /etc/passwd|grep '.sites'|grep -v mailall|grep -v '\-logs'|cut -d :
-f1|sort -n|awk {'print "\\"$1'} >> ~mailall/.forward

Please note that this is with a user named 'mailall' in mind. We exclude
his user name from the output and we append to his .forward file at the end.

The aggregated user names are added in this format:

\admin
\s1_admin
\s1_berta
\s1_dora
\s2_admin
\s2_info

So they all have a backslash in front of their username.

When you now email to user 'mailall', it forwards the email to every
user in the .forward file.

That's why it's *REALLY* important that you get rid of that .forward
file as soon as you're done. Turn off email forwarding in the GUI and
make doubly sure that your ~mailall/.forward is gone or at least no
longer has the list of all users.

Because otherwise you just created a dream scenario for a spammer. With
one email he could reach all your users on that box in one shot as well. :p

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list