<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.qnap.com/mediawiki/index.php?title=Setup_Fetchmail_For_GMail_To_XDove&amp;feed=atom&amp;action=history</id>
	<title>Setup Fetchmail For GMail To XDove - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.qnap.com/mediawiki/index.php?title=Setup_Fetchmail_For_GMail_To_XDove&amp;feed=atom&amp;action=history"/>
	<link rel="alternate" type="text/html" href="https://wiki.qnap.com/mediawiki/index.php?title=Setup_Fetchmail_For_GMail_To_XDove&amp;action=history"/>
	<updated>2022-09-01T02:40:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.qnap.com/mediawiki/index.php?title=Setup_Fetchmail_For_GMail_To_XDove&amp;diff=289&amp;oldid=prev</id>
		<title>Admin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.qnap.com/mediawiki/index.php?title=Setup_Fetchmail_For_GMail_To_XDove&amp;diff=289&amp;oldid=prev"/>
		<updated>2015-06-18T10:31:22Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;STEP BY STEP “FETCHMAIL FOR GMAIL/HOTMAIL” CONFIGURATION &lt;br /&gt;
&lt;br /&gt;
{{Writer&lt;br /&gt;
| Name = eagle00789&lt;br /&gt;
| Date = August 2009&lt;br /&gt;
| Version = 1.1}} &lt;br /&gt;
&lt;br /&gt;
= Requirements:  =&lt;br /&gt;
&lt;br /&gt;
XDove Installed and running&amp;lt;br&amp;gt; IPKG Installed and running&amp;lt;br&amp;gt; OpenSSL 0.9.8 Installed&amp;lt;br&amp;gt;Perl Installed &lt;br /&gt;
&lt;br /&gt;
= Install Fetchmail  =&lt;br /&gt;
&lt;br /&gt;
Before we can do anything, we must install fetchmail. Login to your QNAP via SSH and execute the following command: &lt;br /&gt;
&lt;br /&gt;
   $ ipkg install fetchmail&lt;br /&gt;
&lt;br /&gt;
After a few moments of patiently waiting, the prompt returns and tells you that it was finished successfully. &lt;br /&gt;
&lt;br /&gt;
= Install Certificates  =&lt;br /&gt;
&lt;br /&gt;
The next step is to download 2 certificates and putt them in a directory. The first thing we do is to create the directory which will hold the certificates. Execute the following command: &lt;br /&gt;
&lt;br /&gt;
   $ mkdir /opt/etc/cert&lt;br /&gt;
&lt;br /&gt;
Now we are going to fetch our first certificate. Enter the following command: &lt;br /&gt;
&lt;br /&gt;
   $ openssl s_client -connect pop.gmail.com:995 –showcerts&lt;br /&gt;
&lt;br /&gt;
If you want to do this for hotmail, then enter the following command: &lt;br /&gt;
&lt;br /&gt;
   $ openssl s_client -connect pop3.live.com:995 –showcerts&lt;br /&gt;
&lt;br /&gt;
This will throw out something like this: &lt;br /&gt;
&lt;br /&gt;
   CONNECTED(00000003)&lt;br /&gt;
   depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc./CN=pop.gmail.com&lt;br /&gt;
   verify error:num=20:unable to get local issuer certificate&lt;br /&gt;
   verify return:1&lt;br /&gt;
   depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc./CN=pop.gmail.com&lt;br /&gt;
   verify error:num=27:certificate not trusted&lt;br /&gt;
   verify return:1&lt;br /&gt;
   depth=0 /C=US/ST=California/L=Mountain View/O=Google Inc./CN=pop.gmail.com&lt;br /&gt;
   verify error:num=21:unable to verify the first certificate&lt;br /&gt;
   verify return:1&lt;br /&gt;
   ---&lt;br /&gt;
   Certificate chain&lt;br /&gt;
    0 s:/C=US/ST=California/L=Mountain View/O=Google Inc./CN=pop.gmail.com&lt;br /&gt;
      i:/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
   -----BEGIN CERTIFICATE-----&lt;br /&gt;
   MIIC3TCCAkagAwIBAgIDCDijMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT&lt;br /&gt;
   MR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jWOK1fGkZ/yFAuTxuxAc=&lt;br /&gt;
   -----END CERTIFICATE-----&lt;br /&gt;
   ---&lt;br /&gt;
   Server certificate&lt;br /&gt;
   subject=/C=US/ST=California/L=Mountain View/O=Google Inc./CN=pop.gmail.com&lt;br /&gt;
   issuer=/C=US/O=Equifax/OU=Equifax Secure Certificate Authority&lt;br /&gt;
   ---&lt;br /&gt;
   No client certificate CA names sent&lt;br /&gt;
   ---&lt;br /&gt;
   SSL handshake has read 883 bytes and written 306 bytes&lt;br /&gt;
   ---&lt;br /&gt;
   New, TLSv1/SSLv3, Cipher is RC4-MD5&lt;br /&gt;
   Server public key is 1024 bit&lt;br /&gt;
   Compression: NONE&lt;br /&gt;
   Expansion: NONE&lt;br /&gt;
   SSL-Session:&lt;br /&gt;
       Protocol &amp;amp;nbsp;: TLSv1&lt;br /&gt;
       Cipher   &amp;amp;nbsp;: RC4-MD5&lt;br /&gt;
       Session-ID: 010D2AA18BB7C97A75B2F2B7895EA0CD60FDA7F8BDA71F63C00602D93CD8C3AA&lt;br /&gt;
       Session-ID-ctx:&lt;br /&gt;
       Master-Key:D72722A6A76DC4F2579CC01C26EFCD98AA9D72D908350CEC588FF09EEBD8847C9DC6A26023A51DCD0CB92676F7E28016&lt;br /&gt;
       Key-Arg  &amp;amp;nbsp;: None&lt;br /&gt;
       Start Time: 1240684427&lt;br /&gt;
       Timeout  &amp;amp;nbsp;: 300 (sec)&lt;br /&gt;
       Verify return code: 21 (unable to verify the first certificate)&lt;br /&gt;
   ---&lt;br /&gt;
   +OK Gpop ready for requests from 85.146.48.6 7pf12009241eyg.18&lt;br /&gt;
&lt;br /&gt;
The output for Hotmail will look slightly different, but the working is the same. In the output you will find something like this &lt;br /&gt;
&lt;br /&gt;
   ----BEGIN CERTIFICATE----- &lt;br /&gt;
   MIIC3TCCAkagAwIBAgIDCDijMA0GCSqGSIb3DQEBBQUAME4xCzAJBgNVBAYTAlVT&lt;br /&gt;
   MRAwDgYDVQQKEwdFcXVpZmF4MS0wKwYDVQQLEyRFcXVpZmF4IFNlY3VyZSBDZXJ0 &lt;br /&gt;
   aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDcxMDI1MTc1MzE2WhcNMDkxMjI0MTg1MzE2 &lt;br /&gt;
   WjBoMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMN &lt;br /&gt;
   TW91bnRhaW4gVmlldzEUMBIGA1UEChMLR29vZ2xlIEluYy4xFjAUBgNVBAMTDXBv &lt;br /&gt;
   cC5nbWFpbC5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAO03QxerFKZV &lt;br /&gt;
   8yeomuL4zSl8Pr7hMWnKMMgp/CwhwadeBmL0LQHHbjL/6z/Z59ZQvrztqkwhchA2 &lt;br /&gt;
   APKzUwRVTyn7Shx6vBqk6oFmTqoOLmY6hbq6l8uVdUv0AfbHwio8CnLpK2+nbuFl &lt;br /&gt;
   flPwx1DH0E3grD8+CrH5SmScfTWbDkcXAgMBAAGjga4wgaswDgYDVR0PAQH/BAQD &lt;br /&gt;
   AgTwMB0GA1UdDgQWBBTJRG/OFpZt+BV43JM3NshHMjpwazA6BgNVHR8EMzAxMC+g &lt;br /&gt;
   LaArhilodHRwOi8vY3JsLmdlb3RydXN0LmNvbS9jcmxzL3NlY3VyZWNhLmNybDAf &lt;br /&gt;
   BgNVHSMEGDAWgBRI5mj5K9KylddH2CMgEE8zmJCf1DAdBgNVHSUEFjAUBggrBgEF &lt;br /&gt;
   BQcDAQYIKwYBBQUHAwIwDQYJKoZIhvcNAQEFBQADgYEAOKr3mhxtwFCS3J6lbeaf &lt;br /&gt;
   3KrHKi935BZkI75sRbON+hog0t2ovcM2i7fxs3xneH8USLsHgfxNBj9tkMogMK/K sO/NUVZ&lt;br /&gt;
   /IfyqcNNkp2619qTQXthKRH42JKpAKgNhT1bdno3pxn+eDEpqmU3CE7IP HDCjWOK1fGkZ/yFAuTxuxAc= &lt;br /&gt;
   ----END CERTIFICATE----- &lt;br /&gt;
&lt;br /&gt;
Copy that complete piece just like above and save it in a file called gmail.pem and save it in the /opt/etc/cert folder &lt;br /&gt;
&lt;br /&gt;
For hotmail you will encounter this 3 times. The first 2 times you should copy and save them both seperately to files called: mssa.pem for the first certificate and mia.pem for the second certificate &lt;br /&gt;
&lt;br /&gt;
The second certificate will be downloaded via our web browser. Go to the following URL &lt;br /&gt;
&lt;br /&gt;
[https://www.geotrust.com/resources/root_certificates/certificates/Equifax_Secure_Certificate_Authority.cer] &lt;br /&gt;
&lt;br /&gt;
You should see something like this in your browser: &lt;br /&gt;
&lt;br /&gt;
   ----BEGIN CERTIFICATE----- &lt;br /&gt;
   MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV &lt;br /&gt;
   UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy &lt;br /&gt;
   dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 &lt;br /&gt;
   MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx &lt;br /&gt;
   dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B &lt;br /&gt;
   AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f &lt;br /&gt;
   BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A &lt;br /&gt;
   cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC &lt;br /&gt;
   AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ &lt;br /&gt;
   MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm &lt;br /&gt;
   aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw &lt;br /&gt;
   ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj &lt;br /&gt;
   IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF &lt;br /&gt;
   MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA &lt;br /&gt;
   A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y &lt;br /&gt;
   7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh &lt;br /&gt;
   1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 &lt;br /&gt;
   ----END CERTIFICATE----- &lt;br /&gt;
&lt;br /&gt;
Go to [http://secure.globalsign.net/cacert/ct_root.pem] for the 3rd certificate you need for hotmail. Copy everything and save it in a file called equifax.pem for gmail and gctgr.pem for hotmail and save it in the /opt/etc/cert folder. The only thing left to do is rehash all of these certificates. Execute the following command: &lt;br /&gt;
&lt;br /&gt;
   $c_rehash /opt/etc/cert&lt;br /&gt;
&lt;br /&gt;
It should tell you something like the following: &lt;br /&gt;
&lt;br /&gt;
   doing /opt/etc/cert&lt;br /&gt;
   equifax.pem =&amp;amp;gt; 7f549ca4.0&lt;br /&gt;
   gmail.pem =&amp;amp;gt; 4d3e56a1.0 &lt;br /&gt;
&lt;br /&gt;
If you get an error message saying &amp;quot;/opt/etc/cert&amp;quot; is a directory, check the availability of &amp;quot;/etc/ssl/misc/c_rehash&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
If it tells you that it can’t find c_rehash, read below, else skip the part below &lt;br /&gt;
&lt;br /&gt;
To do this we first must add a special file to our QNap as this file is not present (not even after updating OpenSSL. Download the following file: &lt;br /&gt;
&lt;br /&gt;
[http://www.openssl.org/source/openssl-0.9.8k.tar.gz] &lt;br /&gt;
&lt;br /&gt;
Extract this file to a location on your normal pc. Also extract the file in this file. In the folder tools you will the following 2 files: &lt;br /&gt;
&lt;br /&gt;
   c_rehash&lt;br /&gt;
   c_rehash.in &lt;br /&gt;
&lt;br /&gt;
copy both files to the /etc/ssl/misc folder. Edit c_rehash's first line and change &amp;quot;#!/usr/bin/perl&amp;quot; to &amp;quot;#!/opt/bin/perl&amp;quot; and try again. &lt;br /&gt;
&lt;br /&gt;
= Setup fetchmailrc.  =&lt;br /&gt;
&lt;br /&gt;
To setup fetchmail itself, copy the part below and paste it into your /opt/etc/fetchmailrc file. &lt;br /&gt;
&lt;br /&gt;
   poll pop.gmail.com with protocol POP3 service 995 &lt;br /&gt;
      user 'gmailusername' there with password 'gmailpassword' is 'xdoveusername' here options ssl &lt;br /&gt;
      sslcertpath /opt/etc/cert smtphost localhost/50025&lt;br /&gt;
&lt;br /&gt;
Just make sure that you change gmailusername to your own gmail username and gmailpassword with your gmail password. Also don’t forget to change xdoveusername with the user in xdove that should get the e-mail (using the full loginname for that user) &lt;br /&gt;
&lt;br /&gt;
Or use the following piece as an example for hotmail: &lt;br /&gt;
&lt;br /&gt;
   poll pop3.live.com with protocol POP3 service 995 &lt;br /&gt;
      user 'hotmailadress' there with password 'hotmailpassword' is 'xdoveusername' here options ssl &lt;br /&gt;
      sslcertpath /opt/etc/cert smtphost localhost/50025&lt;br /&gt;
&lt;br /&gt;
Just make sure that you change hotmailadressto your own hotmailadress (including @hotmail.com or @live.com or what ever is needed) and hotmailpassword with your gmail password. Also don’t forget to change xdoveusername with the user in xdove that should get the e-mail (using the full loginname for that user) &lt;br /&gt;
&lt;br /&gt;
All that is left to do is to add the following line to autostart.sh and also run it manually once. &lt;br /&gt;
&lt;br /&gt;
   $ /opt/etc/init.d/S52fetchmail&lt;br /&gt;
&lt;br /&gt;
Just sit back and enjoy. &lt;br /&gt;
&lt;br /&gt;
[[Category:Communications]] [[Category:Email_Server]] [[Category:XDove|X]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>