Postfix Script to send email automatic
-
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 youThis 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
if someone else has a better idea how to modify the script by all means#!/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
-
It should be done through neither. Zimbra is your email client, not something you script. Postfix is an MTA, again, not something you script.
Just use a command line mail client like MailX. Automating that is its purpose and trivially easy. It then talks to your default MTA (Postfix if that is what it is) and sends.
This is the industry standard way, it's so quick, easy, efficient and standard that no one ever considers reinventing the wheel because the wheel is so good.
-
@scottalanmiller said in Postfix Script to send email automatic:
This is the industry standard way, it's so quick, easy, efficient and standard that no one ever considers reinventing the wheel because the wheel is so good.
People have repeatedly reinvented the wheel. . . .