diff --git a/templates/td-agent.conf b/templates/td-agent.conf
index ff15fcc36b2967936379d4c54277838b2a7155e6..7f0570276db704063fd32806c500008d1ce802de 100644
--- a/templates/td-agent.conf
+++ b/templates/td-agent.conf
@@ -192,6 +192,19 @@
     pattern \/server-status\?auto
   </exclude>
 </filter>
+{% if fluentd_mail_output is defined %}
+
+<match mail>
+  @type mail
+  host {{ fluentd_mail_output.host }}
+  port {{ fluentd_mail_output.port }}
+  from {{ fluentd_mail_output.from }}
+  to {{ fluentd_mail_output.to }}
+  subject {{ fluentd_mail_output.subject }}
+  subject_out_keys {{ fluentd_mail_output.subject_out_keys }}
+  out_keys {{ fluentd_mail_output.out_keys }}
+</match>
+{% endif %}
 {% if 'logserver' in groups and inventory_hostname in groups.logserver %}
 
 <source>