Closed crissNb closed 1 year ago
You should also pipe the error of the /usr/local/bin/mailsync into the mailsync_dump file, otherwise it will be trapped by the global "mail" system (see here for better explanation). For example, try changing the mailsync cron to
*/10 * * * * /usr/local/bin/mailsync > ~/mailsync_dump 2>&1
I am going to assume tho that the issue you are having is that the mailsync script is unable to find the mbsync
executable due to it being installed in homebrew and is not in the PATH when the cronjob is started. If that is the case, you can edit the cron job to something like
*/10 * * * * source /Users/user/.zshenv && source /Users/user/.config/zsh/.zprofile && /usr/local/bin/mailsync
or to something similar (I am not sure how you have set up your zsh environment).
I am going to assume tho that the issue you are having is that the mailsync script is unable to find the mbsync executable due to it being installed in homebrew and is not in the PATH when the cronjob is started.
Thanks! This was the problem in my case. It works now!
You can also add directly homebrew to the crontab PATH as follows: https://github.com/LukeSmithxyz/mutt-wizard/issues/973#issuecomment-1892894839
Thanks to @matthew-hennefarth for the solution!
Hello,
whenever I have
mailsync
in crontab, the program seems to be running via cron job, but it doesn't seem to be actually syncing the mail using mbsync (I'm using IMAP).mailsync
works correctly when it's run in Terminal, also updating my mails.my
crontab -l
outputs:Which is added via
mw -t 10
.I also tried dumping the output of mailsync to a file like so:
And the
mailsync_dump
outputs:No new mail for me@my.email
Even though I should be getting a new email (when I runmailsync
manually in Terminal, the output is then1 new mail for me@my.email
). I am positive cron is working properly, because I kept deleting mailsync_dump to verify it's working and I've also waited long enough so that the email is actually gone through.I'm using macOS 13.3, the shell I've used to run
mailsync
(and worked correctly) is zsh. What am I missing?Similar issue #821 was there, but it seems like their problem was not starting the cronie service.