I believe this is a "ubuntu-ism" to have it as /etc/mdadm/nf. NOTE: Most distributions expect the nf file in /etc/, not /etc/mdadm. Step the Third - Configuring MDADM for e-mail notifications If you performed this how to, and did not require the manual sendmail symlink, please reply to this thread confirming. Sudo ln -s /usr/bin/msmtp /usr/sbin/sendmail Sudo mv /usr/sbin/sendmail /usr/sbin/sendmail.bak Should something go wrong with mdadm sending e-mail via "sendmail", please consider manually over-riding the sendmail symlink to msmtp as follows: Since this was part of the installation instructions above, we can proceed without this next code block. This is exciting because it means that if msmtp is compatible with sendmail commands and exit codes, we can simply use msmtp as our e-mail command line executable.įeedback from other users, and I personally tested on Ubuntu 10.04 LTS, has yielded that installing msmtp-mta performs the proper sendmail linkage automatically for us. Now, as per the homepage of msmtp ( msmtp is a "Sendmail compatible interface (command line options and exit codes)." Step the Second - Installing and Configuring our MUA ("sendmail") If things didn't go well, you can check the mail log files (/var/log/mail.log) for hints as to what went wrong, or perhaps even the msmtp executable will spit out some useful errors. Verify the output is correct as best as you know it to be.Įcho "This is a test e-mail from my server using msmtp" | msmtp -d all went well, you should receive an e-mail very shortly! Now it's time to test that e-mail works! First, we'll run a "pretend test" to make sure the settings we've just configured have taken affect. # Must be done within "account" sub-section above # Syslog logging with facility LOG_MAIL instead of the default LOG_USER. #tls_trust_file /etc/ssl/certs/ca-certificates.crt # Construct envelope-from addresses of the form on # Googling for "myisp outlook smtp" should help ![]() # Configuring for other ISPs is beyond the scope of this tutorial # Configuring for gmail is beyond the scope of this tutorial Tls_trust_file /etc/ssl/certs/ca-certificates.crt # This allows msmtp to be used like /usr/sbin/sendmail. # If it exists, it usually defines a default account. # A system wide configuration is optional. Here is a sample system configuration file: System configuration file name: /etc/msmtprc $ msmtp -version | grep "System configuration" It is recommended for you to confirm the same via msmtp -version: We're interested in a system wide configuration which will apply to all users, unless otherwise overrided by a user's own msmtp configuration file.Īt the time of writing, the version of msmtp I was using denoted that the system-wide configuration file was /etc/msmtprc. There are two methods for msmtp configuration system wide, and user base. Process the First - Installing and Configuring the MSA (msmtp) * mdadm e-mail notification by default looks for /usr/sbin/sendmail. * As you can see, to simplify things, we'll be using msmtp as both the MUA and the MSA. ![]() MSA (smtp middle man): msmtp (a simple MTA that gets mail from your local MTA to your real MTA or mailhub) MUA (the client): msmtp (a sendmail compatible interface) * Secondly, here's what our pieces of the puzzle are for e-mail: How does e-mail work? View the operations and diagram from wikipedia here (). This tutorial does not cover how to setup or configure RAID, but instead how to configure e-mail notifications for an already working mdadm RAID array. I assume here that you have a working server, with a working RAID device already configured. * I'm obviously running a particular setup and distro, but hopefully one could take this instructions and apply them to their own configuration as needed. If you have important or critical data, and you're not completely comfortable with linux server administration, please, get a professional to setup your RAID. This tutorial is accurate to the best of my knowledge, and has been tested to work, but use at your own risk. * I take no responsibility if, after following these guidelines, your server fails to notify you by e-mail of a failed drive. ![]() I don't want to have to configure a full Mail Transfer Agent (MTA). * E-mail configuring should be as simple as possible, and should authenticate against my ISP's SMTP server. The server should tell me, I shouldn't have to go looking for failures. * If a drive fails in any of my RAID arrays, I'd like to be notified by e-mail. This tutorial will assist a home server administrator to configure mdadm e-mail notifications without a full fledged MTA (such as postfix or exim).
0 Comments
Leave a Reply. |