On 2018-04-25 14:19, 799 wrote: > Hello, > > I am using neomutt with offlineimap to get my corporate mail into an > Email-AppVM. > The current workflow is: > > 1) get email running offlineimap -o > 2) start neomutt > > I'd like to have offlineimap check the mails in the background using cron. > Thereof I have written a small script: > > /user/check-mail.sh > #!/usr/bin/bash > # Script will be run by cron > #su user -c "/usr/bin/offlineimap -u quiet -f INBOX,INBOX.Inbox_CC" > /usr/bin/offlineimap -u quiet -f INBOX,INBOX.Inbox_CC > echo Cronjob run at: `date`>> /tmp/cron.log > > The last line is only for troubleshooting in order to see, if the > cronjob has been run. > > The scripts is working when launched manually. It will open up the > SplitGPG window to grant access to my GPG-key in my vault-VM. > I need to enter the password once and if the next request is within a > 300sec window access will be granted to th eGPG without further user > interaction. > > I have installed cron and setup a cronjob which should run every 3 min > in order to be below the 300sec time window when Spli-GPG is asking > for a password. I have encrypted the password in my offlineimap-config > and it can only be decrypted using my > > [user@my-mail]$ crontab -l > # min hr day-of-month month day-of-week > # 0-59 0-23 0-31 1-12 0-7 > # Check important mail folders every 3min > */3 * * * * /home/user/bin/check-mail.sh > > unfortunately it seems that this script doesn't work via cron, do you > have any idea what is wrong? > If I look into the logfile the script is writing (/tmp/cron.log) I see > that th ecronjob runs the script but no mails are downloaded. > As mentioned running the script manually will work. > Is cron running the job as "user" or as "root"? > > To all offlineimap / mutt users how are you auto-fetching new emails? > > [799] > > -- > You received this message because you are subscribed to the Google > Groups "qubes-users" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to qubes-users+unsubscr...@googlegroups.com > <mailto:qubes-users+unsubscr...@googlegroups.com>. > To post to this group, send email to qubes-users@googlegroups.com > <mailto:qubes-users@googlegroups.com>. > To view this discussion on the web visit > https://groups.google.com/d/msgid/qubes-users/CAJ3yz2tXWNz6Mst3PeUHtcPUj2EzAhH6vs7OUTg0tf8m_8LrAA%40mail.gmail.com > <https://groups.google.com/d/msgid/qubes-users/CAJ3yz2tXWNz6Mst3PeUHtcPUj2EzAhH6vs7OUTg0tf8m_8LrAA%40mail.gmail.com?utm_medium=email&utm_source=footer>. > For more options, visit https://groups.google.com/d/optout. Cron runs under a very different environment from your desktop session -- the variables needed for GPG agent are not set in that environment. I wrote a program run-in-gui / run-in-env-of a while ago, that, while needing root, starts your program in the same environment as your desktop session. Check my Github for them.
-- Rudd-O http://rudd-o.com/ -- You received this message because you are subscribed to the Google Groups "qubes-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to qubes-users+unsubscr...@googlegroups.com. To post to this group, send email to qubes-users@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/qubes-users/ab00ceeb-a7af-a567-b42b-1b13799d93ce%40rudd-o.com. For more options, visit https://groups.google.com/d/optout.