<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jbmia</id>
	<title>ZoneMinder Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.staging.zoneminder.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jbmia"/>
	<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/Special:Contributions/Jbmia"/>
	<updated>2026-04-19T22:54:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4615</id>
		<title>How to install and configure Postfix as a Gmail SMTP relay for ZoneMinder email filter events.</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4615"/>
		<updated>2011-08-07T13:03:52Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a pretty rough guide at this point, but I felt compelled to put something down after spending many hours searching for a solution to obtain emails from ZM events.  In the end the solution is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prerequisites:  Basically command line knowledge, ability to use text editors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.  Install, configure, and test Postfix.  &lt;br /&gt;
&lt;br /&gt;
Postfix is a full featured mail server.  That said, the scope of this guide is merely to configure it for use as an &amp;quot;smtp&amp;quot; relay for Gmail. In other words, we&amp;#039;ll be using our gmail account credentials and their system to relay our event alert mail.  I found the following guide on the internet and used it to configure and test Postfix successfully:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A. Install&lt;br /&gt;
  &lt;br /&gt;
(Note the following install commands are based on yum/Fedora.  Alter based on your distribution&lt;br /&gt;
&lt;br /&gt;
Install Postfix and cyrus-sasl with your application manager of choice. If you&amp;#039;re compiling from source, be sure to make Postfix with the -DUSE_SASL_AUTH flag for SASL support and -DUSE_TLS for TLS support.&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;yum install postfix cyrus-sasl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Stop the sendmail service&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;/etc/init.d/sendmail stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Remove sendmail from the startup runlevels&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;chkconfig --del sendmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
B. Configure Postfix as Gmail SMTP relay&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re attempting to relay mail using Gmail, then it will be necessary to use TLS with Postfix. You&amp;#039;ll have to point Postfix at your server&amp;#039;s trusted CA root certificate bundle, but luckily &amp;quot;...client-side certificates are not required when relaying mail to GMail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
1. First, double-check that Postfix was configured with SSL support (ie. ldd should return at least one line starting with libssl):&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;whereis -b postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;ldd /usr/sbin/postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 libssl.so.6 =&amp;gt; /lib/libssl.so.6 (0x00111000)&lt;br /&gt;
&lt;br /&gt;
2. Now we need to find your server&amp;#039;s CA root certificate bundle, which is typically distributed with openssl. The bundle file is used by Postfix to verify Gmail&amp;#039;s SSL certificate (signed by Thawte). On my CentOS server, this file was located at /etc/pki/tls/certs/ca-bundle.crt, but may be in a different location on your box (ie. /etc/ssl/certs).  Mine was in /usr/share/doc/mutt.&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;locate ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 /etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
&lt;br /&gt;
3. Edit /etc/postfix/main.cf with the following values (edit-Postfix comes with a predefined template, I moved that to main.cf.bak and used Nano to create a blank file for the following content.  It was cleaner when it came to testing as the template comes with a bunch of text explanation for each setting.  If you&amp;#039;re blindly following a guide like this one, it just all gets in the way):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy/paste the following into a blank &amp;quot;/etc/postfix/main.cf&amp;quot; file using your favorite text editor (I like Nano):&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;relayhost = smtp.gmail.com:587&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;mydomain = local.domain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;myhostname = host.local.domain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;myorigin = $myhostname&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtpd_sasl_path = smtpd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_type = cyrus&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_auth_enable = yes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_use_tls  = yes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_tls_CAfile = /path/to/your/ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
4. Copy/paste the following into a blank &amp;quot;/etc/postfix/sasl_passwd&amp;quot; file.  Change username &amp;amp; password to your gmail username and password of course.&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# The server info must exactly match the value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;# for &amp;quot;relayhost&amp;quot; in /etc/postfix/main.cf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp.gmail.com:587 username:password&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
5. Generate a postfix lookup table from the previous file&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;postmap hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
5a.  Make sure that the hash &amp;quot;took&amp;quot; by checking it with the following command. The response should be the user:pass that you defined for the file.  Basically, we&amp;#039;re confirming that Postfix has the ability to pull up the user:pass when it needs it and you didn&amp;#039;t hose the command with the wrong path or file name or something:&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;postmap -q smtp.gmail.com:587 /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
6. Get rid of the clear text password file  (I&amp;#039;d really do this at the end, once it&amp;#039;s confirmed functional, but don&amp;#039;t forget)&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;rm /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
C1. Restart postfix and send a test email&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;postfix reload&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;sendmail email@example.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;Test relay thru Gmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
2. Go check your the email account you sent your test email to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Troubleshooting&lt;br /&gt;
&lt;br /&gt;
Monitor postfix mail log in a separate session with the following command&lt;br /&gt;
&lt;br /&gt;
 $ &amp;#039;&amp;#039;&amp;#039;tail -f /var/log/maillog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying the following error&lt;br /&gt;
 ...&lt;br /&gt;
 (Authentication failed: cannot SASL authenticate to server ...: no mechanism available)&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Then set this variable in /etc/postfix/main.cf&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying this error: &lt;br /&gt;
 &amp;quot;553 Sorry, that domain isn&amp;#039;t in my list of allowed rcpthosts. (in reply to RCPT TO command)&amp;quot;&lt;br /&gt;
Check your username and password in /etc/postfix/sasl_passwd. Your user name is usually your full email address. If you have to fix it, don&amp;#039;t forget to use postmap to generate a new lookup table.&lt;br /&gt;
&lt;br /&gt;
2. Configure ZoneMinder.   There&amp;#039;s not really alot to this.  Many of the forum posts I checked had me altering zmfilter.pl with User &amp;amp; Pass Auth values and suggesting ssmtp instead of smtp and so on... I didn&amp;#039;t have success with those methods.  With Postfix installed and confirmed running, zmfilter.pl doesn&amp;#039;t need to be modified in any way, so if you&amp;#039;ve already altered it, back those changes out or restore the backup you should have made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I won&amp;#039;t get into alot of detail on each field of the &amp;quot;email&amp;quot; tab in &amp;quot;options&amp;quot;, but thats where you need to be.. you need to put in your to email and your from email address and your smtp server.  That&amp;#039;s the only thing specific to this guide, the smptp, server, don&amp;#039;t put gmails there, since we&amp;#039;ve configured Postfix with all that.  Just put in &amp;quot;localhost&amp;quot;.  That&amp;#039;s really it.  That&amp;#039;s all there is that&amp;#039;s specific on the ZM side to getting ZM working with Postfix.  Pretty simple huh..  You can play around with email content settings later.  That&amp;#039;s out of scope for this guide, we&amp;#039;re just trying to get something/anything on the other end of the pipe...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.  Generate an alert event if you don&amp;#039;t have one already and create a filter that sends an email.  Refer to the docs for that step.. it&amp;#039;s basic stuff.. all you have to do is create a filter that will pick up at least one event and then tick the email box and click execute.  If you click save and then tick the &amp;quot;run filter in background&amp;quot; option it&amp;#039;ll sit there and wait for an event to occur (according to your filter properties) and automatically shoot an email out to you. Cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a rough guide (no pretty formatting or anything), but it got the job done quickly and easily for me after I&amp;#039;d spent maybe 48 hours combined pursuing other blind allies..  Good luck.  Huge thanks to a guy named Tim White at Zulius for putting together the Postfix portion of this guide. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4613</id>
		<title>How to install and configure Postfix as a Gmail SMTP relay for ZoneMinder email filter events.</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4613"/>
		<updated>2011-08-06T15:34:38Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a pretty rough guide at this point, but I felt compelled to put something down after spending many hours searching for a solution to obtain emails from ZM events.  In the end the solution is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prerequisites:  Basically command line knowledge, ability to use text editors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.  Install, configure, and test Postfix.  &lt;br /&gt;
&lt;br /&gt;
Postfix is a full featured mail server.  That said, the scope of this guide is merely to configure it for use as an &amp;quot;smtp&amp;quot; relay for Gmail. In other words, we&amp;#039;ll be using our gmail account credentials and their system to relay our event alert mail.  I found the following guide on the internet and used it to configure and test Postfix successfully:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A. Install&lt;br /&gt;
  &lt;br /&gt;
(Note the following install commands are based on yum/Fedora.  Alter based on your distribution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Postfix and cyrus-sasl with your application manager of choice. If you&amp;#039;re compiling from source, be sure to make Postfix with the -DUSE_SASL_AUTH flag for SASL support and -DUSE_TLS for TLS support.&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;yum install postfix cyrus-sasl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stop the sendmail service&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;/etc/init.d/sendmail stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove sendmail from the startup runlevels&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;chkconfig --del sendmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. Configure Postfix as Gmail SMTP relay&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re attempting to relay mail using Gmail, then it will be necessary to use TLS with Postfix. You&amp;#039;ll have to point Postfix at your server&amp;#039;s trusted CA root certificate bundle, but luckily &amp;quot;...client-side certificates are not required when relaying mail to GMail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. First, double-check that Postfix was configured with SSL support (ie. ldd should return at least one line starting with libssl):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;whereis -b postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;ldd /usr/sbin/postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
libssl.so.6 =&amp;gt; /lib/libssl.so.6 (0x00111000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Now we need to find your server&amp;#039;s CA root certificate bundle, which is typically distributed with openssl. The bundle file is used by Postfix to verify Gmail&amp;#039;s SSL certificate (signed by Thawte). On my CentOS server, this file was located at /etc/pki/tls/certs/ca-bundle.crt, but may be in a different location on your box (ie. /etc/ssl/certs).  Mine was in /usr/share/doc/mutt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;locate ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
/etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Edit /etc/postfix/main.cf with the following values (edit-Postfix comes with a predefined template, I moved that to main.cf.bak and used Nano to create a blank file for the following content.  It was cleaner when it came to testing as the template comes with a bunch of text explanation for each setting.  If you&amp;#039;re blindly following a guide like this one, it just all gets in the way):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy/paste the following into a blank &amp;quot;/etc/postfix/main.cf&amp;quot; file using your favorite text editor (I like Nano):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;relayhost = smtp.gmail.com:587&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mydomain = local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myhostname = host.local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myorigin = $myhostname&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtpd_sasl_path = smtpd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_type = cyrus&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_auth_enable = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_use_tls  = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_tls_CAfile = /path/to/your/ca-bundle.crt&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Copy/paste the following into a blank &amp;quot;/etc/postfix/sasl_passwd&amp;quot; file.  Change username &amp;amp; password to your gmail username and password of course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# The server info must exactly match the value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# for &amp;quot;relayhost&amp;quot; in /etc/postfix/main.cf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp.gmail.com:587 username:password&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Generate a postfix lookup table from the previous file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postmap hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a.  Make sure that the hash &amp;quot;took&amp;quot; by checking it with the following command, the response should be the user:pass that you defined for the file.  Basically, we&amp;#039;re confirming that Postfix has the ability to pull up the user:pass when it needs it and you didn&amp;#039;t hose the command with the wrong path or file name or something:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;postmap -q&amp;#039;: postmap -q smtpout.secureserver.net /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Get rid of the clear text password file  (I&amp;#039;d really do this at the end, once it&amp;#039;s confirmed functional, but don&amp;#039;t forget)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;rm /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C1. Restart postfix and send a test email&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postfix reload&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;sendmail email@example.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Test relay thru Gmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go check your the email account you sent your test email to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Troubleshooting&lt;br /&gt;
&lt;br /&gt;
Monitor postfix mail log in a separate session with the following command&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;tail -f /var/log/maillog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying the following error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Authentication failed: cannot SASL authenticate to server ...: no mechanism available)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then set this variable in /etc/postfix/main.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the log is displaying this error: &amp;quot;553 Sorry, that domain isn&amp;#039;t in my list of allowed rcpthosts. (in reply to RCPT TO command)&amp;quot;, &lt;br /&gt;
Check your username and password in /etc/postfix/sasl_passwd. Your user name is usually your full email address. If you have to fix it, don&amp;#039;t forget to use postmap to generate a new lookup table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure ZoneMinder.   There&amp;#039;s not really alot to this.  Many of the forum posts I checked had me altering zmfilter.pl with User &amp;amp; Pass Auth values and suggesting ssmtp instead of smtp and so on... I didn&amp;#039;t have success with those methods.  With Postfix installed and confirmed running, zmfilter.pl doesn&amp;#039;t need to be modified in any way, so if you&amp;#039;ve already altered it, back those changes out or restore the backup you should have made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I won&amp;#039;t get into alot of detail on each field of the &amp;quot;email&amp;quot; tab in &amp;quot;options&amp;quot;, but thats where you need to be.. you need to put in your to email and your from email address and your smtp server.  That&amp;#039;s the only thing specific to this guide, the smptp, server, don&amp;#039;t put gmails there, since we&amp;#039;ve configured Postfix with all that.  Just put in &amp;quot;localhost&amp;quot;.  That&amp;#039;s really it.  That&amp;#039;s all there is that&amp;#039;s specific on the ZM side to getting ZM working with Postfix.  Pretty simple huh..  You can play around with email content settings later.  That&amp;#039;s out of scope for this guide, we&amp;#039;re just trying to get something/anything on the other end of the pipe...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.  Generate an alert event if you don&amp;#039;t have one already and create a filter that sends an email.  Refer to the docs for that step.. it&amp;#039;s basic stuff.. all you have to do is create a filter that will pick up at least one event and then tick the email box and click execute.  If you click save and then tick the &amp;quot;run filter in background&amp;quot; option it&amp;#039;ll sit there and wait for an event to occur (according to your filter properties) and automatically shoot an email out to you. Cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a rough guide (no pretty formatting or anything), but it got the job done quickly and easily for me after I&amp;#039;d spent maybe 48 hours combined pursuing other blind allies..  Good luck.  Huge thanks to a guy named Tim White at Zulius for putting together the Postfix portion of this guide. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4612</id>
		<title>How to install and configure Postfix as a Gmail SMTP relay for ZoneMinder email filter events.</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4612"/>
		<updated>2011-08-06T15:34:00Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: /* How to install and configure Postfix (as a Gmail smtp relay) + ZoneMinder for successful email delivery of alerts for Dummies...  ;-) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a pretty rough guide at this point, but felt compelled to put something down after spending many hours searching for a solution to obtain emails from ZM events.  In the end the solution is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prerequisites:  Basically command line knowledge, ability to use text editors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.  Install, configure, and test Postfix.  &lt;br /&gt;
&lt;br /&gt;
Postfix is a full featured mail server.  That said, the scope of this guide is merely to configure it for use as an &amp;quot;smtp&amp;quot; relay for Gmail. In other words, we&amp;#039;ll be using our gmail account credentials and their system to relay our event alert mail.  I found the following guide on the internet and used it to configure and test Postfix successfully:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A. Install&lt;br /&gt;
  &lt;br /&gt;
(Note the following install commands are based on yum/Fedora.  Alter based on your distribution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Postfix and cyrus-sasl with your application manager of choice. If you&amp;#039;re compiling from source, be sure to make Postfix with the -DUSE_SASL_AUTH flag for SASL support and -DUSE_TLS for TLS support.&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;yum install postfix cyrus-sasl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stop the sendmail service&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;/etc/init.d/sendmail stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove sendmail from the startup runlevels&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;chkconfig --del sendmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. Configure Postfix as Gmail SMTP relay&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re attempting to relay mail using Gmail, then it will be necessary to use TLS with Postfix. You&amp;#039;ll have to point Postfix at your server&amp;#039;s trusted CA root certificate bundle, but luckily &amp;quot;...client-side certificates are not required when relaying mail to GMail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. First, double-check that Postfix was configured with SSL support (ie. ldd should return at least one line starting with libssl):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;whereis -b postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;ldd /usr/sbin/postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
libssl.so.6 =&amp;gt; /lib/libssl.so.6 (0x00111000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Now we need to find your server&amp;#039;s CA root certificate bundle, which is typically distributed with openssl. The bundle file is used by Postfix to verify Gmail&amp;#039;s SSL certificate (signed by Thawte). On my CentOS server, this file was located at /etc/pki/tls/certs/ca-bundle.crt, but may be in a different location on your box (ie. /etc/ssl/certs).  Mine was in /usr/share/doc/mutt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;locate ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
/etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Edit /etc/postfix/main.cf with the following values (edit-Postfix comes with a predefined template, I moved that to main.cf.bak and used Nano to create a blank file for the following content.  It was cleaner when it came to testing as the template comes with a bunch of text explanation for each setting.  If you&amp;#039;re blindly following a guide like this one, it just all gets in the way):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy/paste the following into a blank &amp;quot;/etc/postfix/main.cf&amp;quot; file using your favorite text editor (I like Nano):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;relayhost = smtp.gmail.com:587&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mydomain = local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myhostname = host.local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myorigin = $myhostname&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtpd_sasl_path = smtpd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_type = cyrus&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_auth_enable = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_use_tls  = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_tls_CAfile = /path/to/your/ca-bundle.crt&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Copy/paste the following into a blank &amp;quot;/etc/postfix/sasl_passwd&amp;quot; file.  Change username &amp;amp; password to your gmail username and password of course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# The server info must exactly match the value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# for &amp;quot;relayhost&amp;quot; in /etc/postfix/main.cf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp.gmail.com:587 username:password&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Generate a postfix lookup table from the previous file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postmap hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a.  Make sure that the hash &amp;quot;took&amp;quot; by checking it with the following command, the response should be the user:pass that you defined for the file.  Basically, we&amp;#039;re confirming that Postfix has the ability to pull up the user:pass when it needs it and you didn&amp;#039;t hose the command with the wrong path or file name or something:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;postmap -q&amp;#039;: postmap -q smtpout.secureserver.net /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Get rid of the clear text password file  (I&amp;#039;d really do this at the end, once it&amp;#039;s confirmed functional, but don&amp;#039;t forget)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;rm /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C1. Restart postfix and send a test email&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postfix reload&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;sendmail email@example.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Test relay thru Gmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go check your the email account you sent your test email to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Troubleshooting&lt;br /&gt;
&lt;br /&gt;
Monitor postfix mail log in a separate session with the following command&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;tail -f /var/log/maillog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying the following error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Authentication failed: cannot SASL authenticate to server ...: no mechanism available)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then set this variable in /etc/postfix/main.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the log is displaying this error: &amp;quot;553 Sorry, that domain isn&amp;#039;t in my list of allowed rcpthosts. (in reply to RCPT TO command)&amp;quot;, &lt;br /&gt;
Check your username and password in /etc/postfix/sasl_passwd. Your user name is usually your full email address. If you have to fix it, don&amp;#039;t forget to use postmap to generate a new lookup table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure ZoneMinder.   There&amp;#039;s not really alot to this.  Many of the forum posts I checked had me altering zmfilter.pl with User &amp;amp; Pass Auth values and suggesting ssmtp instead of smtp and so on... I didn&amp;#039;t have success with those methods.  With Postfix installed and confirmed running, zmfilter.pl doesn&amp;#039;t need to be modified in any way, so if you&amp;#039;ve already altered it, back those changes out or restore the backup you should have made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I won&amp;#039;t get into alot of detail on each field of the &amp;quot;email&amp;quot; tab in &amp;quot;options&amp;quot;, but thats where you need to be.. you need to put in your to email and your from email address and your smtp server.  That&amp;#039;s the only thing specific to this guide, the smptp, server, don&amp;#039;t put gmails there, since we&amp;#039;ve configured Postfix with all that.  Just put in &amp;quot;localhost&amp;quot;.  That&amp;#039;s really it.  That&amp;#039;s all there is that&amp;#039;s specific on the ZM side to getting ZM working with Postfix.  Pretty simple huh..  You can play around with email content settings later.  That&amp;#039;s out of scope for this guide, we&amp;#039;re just trying to get something/anything on the other end of the pipe...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.  Generate an alert event if you don&amp;#039;t have one already and create a filter that sends an email.  Refer to the docs for that step.. it&amp;#039;s basic stuff.. all you have to do is create a filter that will pick up at least one event and then tick the email box and click execute.  If you click save and then tick the &amp;quot;run filter in background&amp;quot; option it&amp;#039;ll sit there and wait for an event to occur (according to your filter properties) and automatically shoot an email out to you. Cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a rough guide (no pretty formatting or anything), but it got the job done quickly and easily for me after I&amp;#039;d spent maybe 48 hours combined pursuing other blind allies..  Good luck.  Huge thanks to a guy named Tim White at Zulius for putting together the Postfix portion of this guide. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4611</id>
		<title>How to install and configure Postfix as a Gmail SMTP relay for ZoneMinder email filter events.</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_to_install_and_configure_Postfix_as_a_Gmail_SMTP_relay_for_ZoneMinder_email_filter_events.&amp;diff=4611"/>
		<updated>2011-08-06T15:33:34Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: Created page with &amp;quot;== How to install and configure Postfix (as a Gmail smtp relay) + ZoneMinder for successful email delivery of alerts for Dummies...  ;-) ==  This is a pretty rough guide at this ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to install and configure Postfix (as a Gmail smtp relay) + ZoneMinder for successful email delivery of alerts for Dummies...  ;-) ==&lt;br /&gt;
&lt;br /&gt;
This is a pretty rough guide at this point, but felt compelled to put something down after spending many hours searching for a solution to obtain emails from ZM events.  In the end the solution is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prerequisites:  Basically command line knowledge, ability to use text editors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.  Install, configure, and test Postfix.  &lt;br /&gt;
&lt;br /&gt;
Postfix is a full featured mail server.  That said, the scope of this guide is merely to configure it for use as an &amp;quot;smtp&amp;quot; relay for Gmail. In other words, we&amp;#039;ll be using our gmail account credentials and their system to relay our event alert mail.  I found the following guide on the internet and used it to configure and test Postfix successfully:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A. Install&lt;br /&gt;
  &lt;br /&gt;
(Note the following install commands are based on yum/Fedora.  Alter based on your distribution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Postfix and cyrus-sasl with your application manager of choice. If you&amp;#039;re compiling from source, be sure to make Postfix with the -DUSE_SASL_AUTH flag for SASL support and -DUSE_TLS for TLS support.&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;yum install postfix cyrus-sasl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stop the sendmail service&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;/etc/init.d/sendmail stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove sendmail from the startup runlevels&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;chkconfig --del sendmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. Configure Postfix as Gmail SMTP relay&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re attempting to relay mail using Gmail, then it will be necessary to use TLS with Postfix. You&amp;#039;ll have to point Postfix at your server&amp;#039;s trusted CA root certificate bundle, but luckily &amp;quot;...client-side certificates are not required when relaying mail to GMail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. First, double-check that Postfix was configured with SSL support (ie. ldd should return at least one line starting with libssl):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;whereis -b postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;ldd /usr/sbin/postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
libssl.so.6 =&amp;gt; /lib/libssl.so.6 (0x00111000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Now we need to find your server&amp;#039;s CA root certificate bundle, which is typically distributed with openssl. The bundle file is used by Postfix to verify Gmail&amp;#039;s SSL certificate (signed by Thawte). On my CentOS server, this file was located at /etc/pki/tls/certs/ca-bundle.crt, but may be in a different location on your box (ie. /etc/ssl/certs).  Mine was in /usr/share/doc/mutt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;locate ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
/etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Edit /etc/postfix/main.cf with the following values (edit-Postfix comes with a predefined template, I moved that to main.cf.bak and used Nano to create a blank file for the following content.  It was cleaner when it came to testing as the template comes with a bunch of text explanation for each setting.  If you&amp;#039;re blindly following a guide like this one, it just all gets in the way):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy/paste the following into a blank &amp;quot;/etc/postfix/main.cf&amp;quot; file using your favorite text editor (I like Nano):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;relayhost = smtp.gmail.com:587&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mydomain = local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myhostname = host.local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myorigin = $myhostname&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtpd_sasl_path = smtpd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_type = cyrus&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_auth_enable = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_use_tls  = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_tls_CAfile = /path/to/your/ca-bundle.crt&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Copy/paste the following into a blank &amp;quot;/etc/postfix/sasl_passwd&amp;quot; file.  Change username &amp;amp; password to your gmail username and password of course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# The server info must exactly match the value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# for &amp;quot;relayhost&amp;quot; in /etc/postfix/main.cf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp.gmail.com:587 username:password&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Generate a postfix lookup table from the previous file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postmap hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a.  Make sure that the hash &amp;quot;took&amp;quot; by checking it with the following command, the response should be the user:pass that you defined for the file.  Basically, we&amp;#039;re confirming that Postfix has the ability to pull up the user:pass when it needs it and you didn&amp;#039;t hose the command with the wrong path or file name or something:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;postmap -q&amp;#039;: postmap -q smtpout.secureserver.net /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Get rid of the clear text password file  (I&amp;#039;d really do this at the end, once it&amp;#039;s confirmed functional, but don&amp;#039;t forget)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;rm /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C1. Restart postfix and send a test email&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postfix reload&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;sendmail email@example.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Test relay thru Gmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go check your the email account you sent your test email to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Troubleshooting&lt;br /&gt;
&lt;br /&gt;
Monitor postfix mail log in a separate session with the following command&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;tail -f /var/log/maillog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying the following error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Authentication failed: cannot SASL authenticate to server ...: no mechanism available)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then set this variable in /etc/postfix/main.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the log is displaying this error: &amp;quot;553 Sorry, that domain isn&amp;#039;t in my list of allowed rcpthosts. (in reply to RCPT TO command)&amp;quot;, &lt;br /&gt;
Check your username and password in /etc/postfix/sasl_passwd. Your user name is usually your full email address. If you have to fix it, don&amp;#039;t forget to use postmap to generate a new lookup table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure ZoneMinder.   There&amp;#039;s not really alot to this.  Many of the forum posts I checked had me altering zmfilter.pl with User &amp;amp; Pass Auth values and suggesting ssmtp instead of smtp and so on... I didn&amp;#039;t have success with those methods.  With Postfix installed and confirmed running, zmfilter.pl doesn&amp;#039;t need to be modified in any way, so if you&amp;#039;ve already altered it, back those changes out or restore the backup you should have made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I won&amp;#039;t get into alot of detail on each field of the &amp;quot;email&amp;quot; tab in &amp;quot;options&amp;quot;, but thats where you need to be.. you need to put in your to email and your from email address and your smtp server.  That&amp;#039;s the only thing specific to this guide, the smptp, server, don&amp;#039;t put gmails there, since we&amp;#039;ve configured Postfix with all that.  Just put in &amp;quot;localhost&amp;quot;.  That&amp;#039;s really it.  That&amp;#039;s all there is that&amp;#039;s specific on the ZM side to getting ZM working with Postfix.  Pretty simple huh..  You can play around with email content settings later.  That&amp;#039;s out of scope for this guide, we&amp;#039;re just trying to get something/anything on the other end of the pipe...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.  Generate an alert event if you don&amp;#039;t have one already and create a filter that sends an email.  Refer to the docs for that step.. it&amp;#039;s basic stuff.. all you have to do is create a filter that will pick up at least one event and then tick the email box and click execute.  If you click save and then tick the &amp;quot;run filter in background&amp;quot; option it&amp;#039;ll sit there and wait for an event to occur (according to your filter properties) and automatically shoot an email out to you. Cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a rough guide (no pretty formatting or anything), but it got the job done quickly and easily for me after I&amp;#039;d spent maybe 48 hours combined pursuing other blind allies..  Good luck.  Huge thanks to a guy named Tim White at Zulius for putting together the Postfix portion of this guide. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=How_To&amp;diff=4610</id>
		<title>How To</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=How_To&amp;diff=4610"/>
		<updated>2011-08-06T15:32:38Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[User:Stagecoach|stagecoach]] 14:11, 16 October 2010 (BST)&lt;br /&gt;
&lt;br /&gt;
Go back to the [[Contents]] page&lt;br /&gt;
&lt;br /&gt;
This section contains additional hands-on instructions to accomplish certain tasks in ZoneMinder. For the detailed documentation navigate to  the [[Main Documentation]]&lt;br /&gt;
&lt;br /&gt;
=Administration=&lt;br /&gt;
[[How to check a camera is working]]&lt;br /&gt;
&lt;br /&gt;
[[Add a user to ZoneMinder| How to add a user]]&lt;br /&gt;
&lt;br /&gt;
[[how to login| How to login]]&lt;br /&gt;
&lt;br /&gt;
[[How to enable user login]]&lt;br /&gt;
&lt;br /&gt;
[[How to change user permissions]]&lt;br /&gt;
&lt;br /&gt;
[[How to enable extra logging and debugging information]]&lt;br /&gt;
&lt;br /&gt;
=Setting up ZoneMinder Monitors=&lt;br /&gt;
[[How to setup motion detection]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup motion detection#Configure motion detection areas|How to configure motion detection areas]]&lt;br /&gt;
&lt;br /&gt;
[[How to Setup an Axis211A with MPEG-4 streaming|How to setup an Axis211A with MPEG-4 streaming]]&lt;br /&gt;
&lt;br /&gt;
[[Setup axis210 with motion jpeg|How to setup an Axis210 with M-JPEG streaming]]&lt;br /&gt;
&lt;br /&gt;
[[How to Setup an Axis 210 with JPEG streaming|How to setup an Axis 210 with JPEG streaming]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup an axis 213 with pan tilt zoom|How to setup an Axis213 with pan tilt zoom]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup a File monitor]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup MPEG-4 (part 2) streaming with RTP/RTSP monitor from an Axis 225FD camera]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup MPEG-4 (part 2) streaming with RTP/RTSP monitor from an Axis 241S video encoder]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup MPEG-4 streaming with RTSP monitor from a Vivotek IP8332 camera]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup H.264 streaming with Ffmpeg monitor from an Axis P3343-VE-12mm camera]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup H.264 streaming with Ffmpeg monitor from an Axis M7001 video encoder]]&lt;br /&gt;
&lt;br /&gt;
[[How to setup H.264 streaming with Ffmpeg monitor from an MagicWave Systems License Plate Camera]]&lt;br /&gt;
&lt;br /&gt;
=Exporting Events=&lt;br /&gt;
[[How to export download and view events#Export_Methods| How to export and download events]]&lt;br /&gt;
&lt;br /&gt;
[[How to export download and view events#Extracting_Events|How to prepare exported events for playback]]&lt;br /&gt;
&lt;br /&gt;
[[How to export download and view events#Viewing_Extracted_Events|How to view extracted events]]&lt;br /&gt;
&lt;br /&gt;
[[How_to_export_an_event_as_video|How to export an event as video]]&lt;br /&gt;
&lt;br /&gt;
=Live streaming=&lt;br /&gt;
[[How to realtime view multiple cameras]]&lt;br /&gt;
&lt;br /&gt;
[[How_to_get_a_live_view_from_a_monitor##Watch_view|How to get a live view from a single monitor]]&lt;br /&gt;
&lt;br /&gt;
[[How_to_get_a_live_view_from_a_monitor##cycle_view|How to get a rotating view from a group of monitors]]&lt;br /&gt;
&lt;br /&gt;
[[How to realtime view multiple cameras#Change Montage View|How to change the montage views layout]]&lt;br /&gt;
&lt;br /&gt;
[[How to realtime view multiple cameras#Create new group|How to create a new camera group]]&lt;br /&gt;
&lt;br /&gt;
[[How to stream from another ZoneMinder installation]]&lt;br /&gt;
&lt;br /&gt;
=Other Stuff=&lt;br /&gt;
[[How to stream h264 with ffmpeg from an Axis P3343]]&lt;br /&gt;
&lt;br /&gt;
[[Capture Resolution Width x Height]]&lt;br /&gt;
&lt;br /&gt;
[[How to install and configure Postfix as a Gmail SMTP relay for ZoneMinder email filter events.]]&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
	<entry>
		<id>http://wiki.staging.zoneminder.com/index.php?title=User_talk:Jbmia&amp;diff=4609</id>
		<title>User talk:Jbmia</title>
		<link rel="alternate" type="text/html" href="http://wiki.staging.zoneminder.com/index.php?title=User_talk:Jbmia&amp;diff=4609"/>
		<updated>2011-08-06T15:22:31Z</updated>

		<summary type="html">&lt;p&gt;Jbmia: How to install and configure Postfix (as a Gmail smtp relay) + ZoneMinder for successful email delivery of alerts for Dummies...  ;-)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== How to install and configure Postfix (as a Gmail smtp relay) + ZoneMinder for successful email delivery of alerts for Dummies...  ;-) ==&lt;br /&gt;
&lt;br /&gt;
This is a pretty rough guide at this point, but felt compelled to put something down after spending many hours searching for a solution to obtain emails from ZM events.  In the end the solution is relatively simple:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Prerequisites:  Basically command line knowledge, ability to use text editors.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1.  Install, configure, and test Postfix.  &lt;br /&gt;
&lt;br /&gt;
Postfix is a full featured mail server.  That said, the scope of this guide is merely to configure it for use as an &amp;quot;smtp&amp;quot; relay for Gmail. In other words, we&amp;#039;ll be using our gmail account credentials and their system to relay our event alert mail.  I found the following guide on the internet and used it to configure and test Postfix successfully:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A. Install&lt;br /&gt;
  &lt;br /&gt;
(Note the following install commands are based on yum/Fedora.  Alter based on your distribution&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install Postfix and cyrus-sasl with your application manager of choice. If you&amp;#039;re compiling from source, be sure to make Postfix with the -DUSE_SASL_AUTH flag for SASL support and -DUSE_TLS for TLS support.&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;yum install postfix cyrus-sasl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Stop the sendmail service&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;/etc/init.d/sendmail stop&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove sendmail from the startup runlevels&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;chkconfig --del sendmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
B. Configure Postfix as Gmail SMTP relay&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re attempting to relay mail using Gmail, then it will be necessary to use TLS with Postfix. You&amp;#039;ll have to point Postfix at your server&amp;#039;s trusted CA root certificate bundle, but luckily &amp;quot;...client-side certificates are not required when relaying mail to GMail&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. First, double-check that Postfix was configured with SSL support (ie. ldd should return at least one line starting with libssl):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;whereis -b postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;ldd /usr/sbin/postfix&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
libssl.so.6 =&amp;gt; /lib/libssl.so.6 (0x00111000)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Now we need to find your server&amp;#039;s CA root certificate bundle, which is typically distributed with openssl. The bundle file is used by Postfix to verify Gmail&amp;#039;s SSL certificate (signed by Thawte). On my CentOS server, this file was located at /etc/pki/tls/certs/ca-bundle.crt, but may be in a different location on your box (ie. /etc/ssl/certs).  Mine was in /usr/share/doc/mutt.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;locate ca-bundle.crt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
/etc/pki/tls/certs/ca-bundle.crt&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Edit /etc/postfix/main.cf with the following values (edit-Postfix comes with a predefined template, I moved that to main.cf.bak and used Nano to create a blank file for the following content.  It was cleaner when it came to testing as the template comes with a bunch of text explanation for each setting.  If you&amp;#039;re blindly following a guide like this one, it just all gets in the way):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Copy/paste the following into a blank &amp;quot;/etc/postfix/main.cf&amp;quot; file using your favorite text editor (I like Nano):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;relayhost = smtp.gmail.com:587&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;mydomain = local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myhostname = host.local.domain&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;myorigin = $myhostname&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtpd_sasl_path = smtpd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_type = cyrus&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_auth_enable = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_use_tls  = yes&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_tls_CAfile = /path/to/your/ca-bundle.crt&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_tls_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Copy/paste the following into a blank &amp;quot;/etc/postfix/sasl_passwd&amp;quot; file.  Change username &amp;amp; password to your gmail username and password of course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# The server info must exactly match the value&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;# for &amp;quot;relayhost&amp;quot; in /etc/postfix/main.cf&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp.gmail.com:587 username:password&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Generate a postfix lookup table from the previous file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postmap hash:/etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5a.  Make sure that the hash &amp;quot;took&amp;quot; by checking it with the following command, the response should be the user:pass that you defined for the file.  Basically, we&amp;#039;re confirming that Postfix has the ability to pull up the user:pass when it needs it and you didn&amp;#039;t hose the command with the wrong path or file name or something:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;postmap -q&amp;#039;: postmap -q smtpout.secureserver.net /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
6. Get rid of the clear text password file  (I&amp;#039;d really do this at the end, once it&amp;#039;s confirmed functional, but don&amp;#039;t forget)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;rm /etc/postfix/sasl_passwd&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C1. Restart postfix and send a test email&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;postfix reload&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;sendmail email@example.com&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Test relay thru Gmail&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Go check your the email account you sent your test email to.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Troubleshooting&lt;br /&gt;
&lt;br /&gt;
Monitor postfix mail log in a separate session with the following command&lt;br /&gt;
&lt;br /&gt;
$ &amp;#039;&amp;#039;&amp;#039;tail -f /var/log/maillog&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If the log is displaying the following error&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(Authentication failed: cannot SASL authenticate to server ...: no mechanism available)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Then set this variable in /etc/postfix/main.cf&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;smtp_sasl_security_options = noanonymous&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the log is displaying this error: &amp;quot;553 Sorry, that domain isn&amp;#039;t in my list of allowed rcpthosts. (in reply to RCPT TO command)&amp;quot;, &lt;br /&gt;
Check your username and password in /etc/postfix/sasl_passwd. Your user name is usually your full email address. If you have to fix it, don&amp;#039;t forget to use postmap to generate a new lookup table.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Configure ZoneMinder.   There&amp;#039;s not really alot to this.  Many of the forum posts I checked had me altering zmfilter.pl with User &amp;amp; Pass Auth values and suggesting ssmtp instead of smtp and so on... I didn&amp;#039;t have success with those methods.  With Postfix installed and confirmed running, zmfilter.pl doesn&amp;#039;t need to be modified in any way, so if you&amp;#039;ve already altered it, back those changes out or restore the backup you should have made.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I won&amp;#039;t get into alot of detail on each field of the &amp;quot;email&amp;quot; tab in &amp;quot;options&amp;quot;, but thats where you need to be.. you need to put in your to email and your from email address and your smtp server.  That&amp;#039;s the only thing specific to this guide, the smptp, server, don&amp;#039;t put gmails there, since we&amp;#039;ve configured Postfix with all that.  Just put in &amp;quot;localhost&amp;quot;.  That&amp;#039;s really it.  That&amp;#039;s all there is that&amp;#039;s specific on the ZM side to getting ZM working with Postfix.  Pretty simple huh..  You can play around with email content settings later.  That&amp;#039;s out of scope for this guide, we&amp;#039;re just trying to get something/anything on the other end of the pipe...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
C.  Generate an alert event if you don&amp;#039;t have one already and create a filter that sends an email.  Refer to the docs for that step.. it&amp;#039;s basic stuff.. all you have to do is create a filter that will pick up at least one event and then tick the email box and click execute.  If you click save and then tick the &amp;quot;run filter in background&amp;quot; option it&amp;#039;ll sit there and wait for an event to occur (according to your filter properties) and automatically shoot an email out to you. Cool.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
This is a rough guide (no pretty formatting or anything), but it got the job done quickly and easily for me after I&amp;#039;d spent maybe 48 hours combined pursuing other blind allies..  Good luck.  Huge thanks to a guy named Tim White at Zulius for putting together the Postfix portion of this guide. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Good Luck!&lt;/div&gt;</summary>
		<author><name>Jbmia</name></author>
	</entry>
</feed>