ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Postfix Script to send email automatic

    IT Discussion
    3
    3
    267
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      killmasta93
      last edited by

      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
      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
      
      1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller
        last edited by

        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.

        DustinB3403D 1 Reply Last reply Reply Quote 2
        • DustinB3403D
          DustinB3403 @scottalanmiller
          last edited by DustinB3403

          @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. . . .

          stone wheel.jpg
          wheel.jpg

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          • First post
            Last post