Sending mail from a Bash shell script

前端 未结 12 1677
梦毁少年i
梦毁少年i 2021-01-29 22:54

I am writing a Bash shell script for Mac that sends an email notification by opening an automator application that sends email out with the default mail account in Mail.app. The

12条回答
  •  半阙折子戏
    2021-01-29 23:38

    1) Why not configure postfix to handle outbound mail only and relay it via a mail gateway? Its biggest advantage is that it is already installed on OS X clients.

    2) Install and configure one of the lightweight MTAs that handle only outbound mail, like nullmailer or ssmtp (available via MacPorts).

    In both cases use mailx(1) (or mutt if you want to get fancy) to send the mails from a shell script.

    There are several questions on Server Fault that go into the details.

提交回复
热议问题