Enable SMTP on OS X Server?

Posted:
in Genius Bar edited January 2014
I have a couple OS X Servers (10.3.4) in production. They provide AFP and SMB services.



I would like to set up a cronjob to run every night that does the following:



1) run the du and df commands (disk information), etc

2) emails me the info from setp 1. to my home email account.



Thus, I need to set up a way for my servers to email me. My servers are NOT e-mail servers by the way, just file servers.



What is the best way to set up my servers so they can send outgoing messages over the 'Net to my home account?



Thanks!

Comments

  • Reply 1 of 1
    123123 Posts: 278member
    I don't know OS X Server but I suppose postfix is installed. You should be able to use the sendmail command without having to configure anything. (man sendmail)



    It reads from stdin, so you can just pipe your command. You can test it like this:



    [dstranathan@localhost]$ sendmail [email protected]

    from: asdasdasd <[email protected]>

    to: [email protected]



    message body

    more content

    .



    (don't forget the period on a single line, or ^d)





    Since you want to use cron anyway, you can also create an email alias for the particular cron job's user as cron sends output created by cron jobs to the local user.



    add a line in /etc/aliases:

    dstranathan: [email protected]



    update the alias db:

    sudo postalias /etc/aliases



    cron output should now be sent to the email address [email protected].
Sign In or Register to comment.