<div dir="ltr"><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Dear all,</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><div>I am trying to autosync my mail in mutt using offlineimap via a systemd service. I am using these (<a href="https://github.com/OfflineIMAP/offlineimap/tree/master/contrib/systemd" target="_blank">https://github.com/OfflineIMAP/offlineimap/tree/master/contrib/systemd</a>) files and have moved them to the `/etc/systemd/user` folder.</div><div><br></div><div>However, I am storing my password via the gnome-keyring and retrieving it via `secret-tool lookup user [user] domain<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://gmail.com/" target="_blank">gmail.com</a>`. This works from the command line, but the service returns the following:</div><div><br></div><div>    user@computer:~/.dotfiles$ systemctl --user -l status offlineimap.service</div><div>    ● offlineimap.service - Offlineimap Service</div><div>       Loaded: loaded (/etc/systemd/user/offlineimap.service; enabled; vendor preset: enabled)</div><div>       Active: failed (Result: exit-code) since Fri 2016-06-10 10:03:43 CEST; 11s ago</div><div>      Process: 5193 ExecStart=/usr/bin/offlineimap -o -u syslog (code=exited, status=1/FAILURE)</div><div>     Main PID: 5193 (code=exited, status=1/FAILURE)</div><div>    </div><div>    Jun 10 10:03:40 computer offlineimap[5193]: Establishing connection to<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://imap.gmail.com:993/" target="_blank">imap.gmail.com:993</a></div><div>    Jun 10 10:03:43 computer ERROR[5193]: While attempting to sync account 'MyAccount'</div><div>                                           Command 'secret-tool lookup user myaccount domain<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://gmail.com/" target="_blank">gmail.com</a>' returned non-zero exit status 1</div><div>    Jun 10 10:03:43 computer offlineimap[5193]: *** Finished account 'MyAccount' in 0:03</div><div>    Jun 10 10:03:43 computer ERROR[5193]: Exceptions occurred during the run!</div><div>    Jun 10 10:03:43 computer ERROR[5193]: While attempting to sync account 'MyAccount'</div><div>                                           Command 'secret-tool lookup user myaccount domain<span class="inbox-inbox-Apple-converted-space"> </span><a href="http://gmail.com/" target="_blank">gmail.com</a>' returned non-zero exit status 1</div><div>    Jun 10 10:03:43 computer Traceback[5193]:   File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 263, in syncrunner</div><div>                                                 self.__sync()</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 326, in __sync</div><div>                                                 remoterepos.getfolders()</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 390, in getfolders</div><div>                                                 imapobj = self.imapserver.acquireconnection()</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 511, in acquireconnection</div><div>                                                 self.__authn_helper(imapobj)</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 411, in __authn_helper</div><div>                                                 if func(imapobj):</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 350, in __authn_login</div><div>                                                 self.__loginauth(imapobj)</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 203, in __loginauth</div><div>                                                 imapobj.login(self.username, self.__getpassword())</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 159, in __getpassword</div><div>                                                 self.password = self.repos.getpassword() or \</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 332, in getpassword</div><div>                                                 return self.localeval.eval(passwd)</div><div>                                               File "/usr/lib/python2.7/site-packages/offlineimap/localeval.py", line 48, in eval</div><div>                                                 return eval(text, names)</div><div>                                               File "<string>", line 1, in <module></div><div>                                               File "/home/user/.mutt/offlineimap.py", line 8, in get_keychain_pass</div><div>                                                 stderr=subprocess.STDOUT)</div><div>                                               File "/usr/lib64/python2.7/subprocess.py", line 573, in check_output</div><div>                                                 raise CalledProcessError(retcode, cmd, output=output)</div><div>    Jun 10 10:03:43 computer systemd[1075]: offlineimap.service: Main process exited, code=exited, status=1/FAILURE</div><div>    Jun 10 10:03:43 computer systemd[1075]: Failed to start Offlineimap Service.</div><div>    Jun 10 10:03:43 computer systemd[1075]: offlineimap.service: Unit entered failed state.</div><div>    Jun 10 10:03:43 computer systemd[1075]: offlineimap.service: Failed with result 'exit-code'.</div><div><br></div><div>I already found out that the problem might lie in the dbus communication, but I'm not sure how to fix it. Can anyone provide an insight?</div><div><br></div></div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">I posted the question on the Unix stackexchange here<span class="inbox-inbox-Apple-converted-space"> </span></span><a href="http://unix.stackexchange.com/questions/288685/sync-mail-with-offlineimap-via-systemd-service-timer-getting-password-from-gnom" target="_blank" style="font-size:13px;font-family:"helvetica neue",helvetica,arial,sans-serif">http://unix.stackexchange.com/questions/288685/sync-mail-with-offlineimap-via-systemd-service-timer-getting-password-from-gnom</a><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">, but unfortunately nobody has provided an answer yet.</span><br style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">If anyone can provide a solution, I will also update the stackexchange for the benefit of future users struggling with this problem. If more info is required, please let me know.</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Thank you very much in advance!</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px"><br></div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Best,</div><div style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif;font-size:13px">Ruben</div></div>