Install mdadm without postfix in ubuntu trusty
The mdadm
package recommends a MTA so as to send an email if a disk fails. It's a useful feature, so I recommend that you do ensure that email is working.
Postfix is overkill for a system that does nothing but send emails to a relay. I recommend adding nullmailer
to your list of packages, and configure it appropriately.
Since you're doing an automated installation, you should use the preseed feature.
neofug's comment works more generally, in the case where you want to install mdadm
without an MTA at all:
apt-get --no-install-recommends install mdadm
This won't pull in postfix
or any other MTA. As the other answers suggest though, if you can configure your system to send an email when things go wrong, it's better to do so.
You can pre-seed the selections using debconf-set-selections
debconf-set-selections <<< "postfix postfix/mailname string your.hostname.com"
debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Local Only'"
apt-get install -y postfix
Appendix B. Automating the installation using preseeding : https://www.debian.org/releases/jessie/amd64/apbs03.html.en
Postfix configuration options : http://www.postfix.org/postconf.5.html