Postfix sending Email to everyone?

Discuss your pilot or production implementation with other Zimbra admins or our engineers.
Post Reply
killmasta93
Posts: 47
Joined: Tue Oct 04, 2016 9:54 pm

Postfix sending Email to everyone?

Post by killmasta93 »

Hi
I was wondering if its possible what im trying to do, I want to send an email automatically every day to all the users and new users when created automatically. Im not sure if its done though zimbra or though postfix?
any ideas
Thank you

This is what i have so far, currently i have to add the email manually in the addresses.txt and could not figure out how to add the subject

Code: Select all

#!/bin/sh
SENDER="sistemas@mydomain"
ADDRESSFILE="/root/addresses.txt"
SENDMAIL="/usr/sbin/sendmail"

for RECIPIENT in $(cat ${ADDRESSFILE}); do

cat <<EOF | ${SENDMAIL} -i -f "${SENDER}" "${RECIPIENT}"

Hello User,
this is a reminder 
EOF


done
7224jobe
Outstanding Member
Outstanding Member
Posts: 283
Joined: Sat Sep 13, 2014 1:55 am
ZCS/ZD Version: 8.8.15_FOSS Patch38

Re: Postfix sending Email to everyone?

Post by 7224jobe »

Hi, you can use 'zmprov -l gaa' command to retrieve the list of all users in your domain, and integrate that in your script.
killmasta93
Posts: 47
Joined: Tue Oct 04, 2016 9:54 pm

Re: Postfix sending Email to everyone?

Post by killmasta93 »

Perfect that did the trick but how can i add the subject?


edit: got it hadd to add

Subject: $SUBJECT

SUBJECT="Testing some mail stuff"
killmasta93
Posts: 47
Joined: Tue Oct 04, 2016 9:54 pm

Re: Postfix sending Email to everyone?

Post by killmasta93 »

7224jobe wrote:Hi, you can use 'zmprov -l gaa' command to retrieve the list of all users in your domain, and integrate that in your script.

Quick question how can i add it to the cronb job of zimbra i tried adding it on crontab -e

at the bottom

# alert email

11 11 * * * /opt/zimbra/backup/alert.sh >/dev/null 2>&1


but not working
Post Reply