Talk:Isync

From ArchWiki
Jump to navigation Jump to search

Not working

This doesn't work:

Patterns * ![Gmail]* “[Gmail]/Sent Mail” “[Gmail]/Starred” “[Gmail]/All Mail”

FelipeC (talk) 09:22, 7 April 2013 (UTC)

Step #1: Get the certificates

I did not need to do Isync#Step #1: Get the certificates for gmail - "CertificateFile /etc/ssl/certs/ca-certificates.crt" in the config file was suffcient - --Choubi (talk) 12:25, 9 April 2013 (UTC)

It is for when the certificate verification does not work, in which case the certificate is probably not included in the default certificates (i.e. if it is self-signed) Totony (talk) 03:04, 7 July 2015 (UTC)

Gmail sync

In my case the current git-Version did the job. It seems as there have been quite a few changes compared to 1.0.6. For sync with gmail accounts and using mutt as mail client, the option: Flatten "_" in .mbsyncrc helped a lot! It replaces the subfolders [Gmail]/.Trash etc. by [Gmail]_Trash. You can still use patterns as explained. Works perfectly, and in my case about 10x faster than offlineimap. As soon as I find the time I will go through all the documents about arch wiki and try add these remarks.

—This unsigned comment is by Whilealive (talk) 09:39, 13 April 2013‎ (UTC). Please sign your posts with ~~~~!

Synchronization problems with systemd timer when using "OnActiveSec"

I haven't ever used systemd timers before setting up mbsync and I am not experienced with setting up systemd services. I followed the guidelines on this wiki page to automatically run mbsync with a systemd timer, but with OnActiveSec=15min instead of 1d. The first run of the mbservice triggered by "OnBootSec" always worked, the the first run triggered by "OnActiveSec" as well, however after that the timer stopped working. When I ran systemctl list-timers, I always got n/a for "Next" and "Left". However, I managed to fix this by using OnUnitActiveSec instead of OnActiveSec, however I am not sure why this fixed it. I also run mbsync sometimes manually from emacs, not sure if there may be conflicts... So maybe someone who has experience with systemd has an explanation? Which option is "better", OnActiveSec or OnUnitActiveSec? Wiki might need to be changed accordingly. Elimik31 (talk) 15:41, 14 December 2015 (UTC)

The timer unit I currently run is slightly different from the one I originally put in the wiki a while ago, and is hopefully easier to read, so I edited the page. Thanks for pointing it out!
The two things you need in there are Persistent=true (so that the unit is restarted even if your computer was shut down) and OnCalendar=*-*-* 00/2:00:00, which reads "start the unit every year, every month, every day, every two hours at 0 minutes and 0 seconds", just like a traditional crontab. As usual, there's systemd.time(7) for more info on the syntax. Does that work for you?
Frx (talk) 21:07, 27 December 2015 (UTC)

Adding post-start hook to run notmuch

I've slightly tweaked my systemd mbsync@.service to run notmuch after mbsync has successfully executed. I'm kind of new to wikis, but I'd like to share what I've done. Is this worth adding to the wiki?

[Unit]
Description=Mailbox synchronization service for user %I

[Service]
Type=oneshot
ExecStart=/usr/bin/mbsync -Va
ExecStartPost=/usr/bin/notmuch new
User=%i
StandardOutput=syslog
StandardError=syslog

Grawlinson (talk) 06:40, 7 November 2016 (UTC)

SNI

I've push isync-git based on branch 1.3.0 who fix the following pb: SSL error connecting imap.gmail.com (108.177.125.109:993): self signed certificate

Since google enforce SNI when you use TLS 1.3.

—This unsigned comment is by Grosjean (talk) 16:44, 18 September 2018‎ (UTC). Please sign your posts with ~~~~!

IMAP IDLE

I propose we put the following information about imapnotify under a new heading like "Calling mbsync automatically", e.g.

  • Header: Calling Mbsync automatically
    • subsection: With a timer (this would be the existing "Automatic Synchronization" section)
    • subsection: With imapnotify (the following content:

IMAP IDLE is a way to get push notifications to download new email, rather than polling the server intermittently. This has the advantage of saving bandwidth and delivering your mail as soon as it's available. Isync doesn't have native IDLE suport, but we can use a program like imapnotify to call mbsync when you receive new email. For this example we'll use the goimapnotify package which is reported to work better with frequent network interruptions.

Install goimapnotify and create a config file for each mail server you want to poll. Note that the file name format, including the ".conf", is necessary if you want to use the provided systemd service:

~/.config/imapnotify/gmail.conf

{
  "host": "imap.gmail.com",
  "port": 993,
  "tls": true,
  "tlsOptions": {
    "rejectUnauthorized": false
  },
  "username": "username@gmail.com",
  "password": "",
    "passwordCmd": "pass gmail | head -n1",
  "onNewMail": "mbsync gmail",
  "onNewMailPost": "",
  "boxes": [ "INBOX" ]
}

Start and enable the service with $ systemctl --user enable --now goimapnotify@gmail.service.

Note that IMAP IDLE only triggers when new mail arrives, not when there is undownloaded mail on the server. For example, if you receive 100 emails with your computer powered off, then turn on your computer, imapnotify will still not download new mail until you receive another email. For this reason you may want to run mbsync once when you log in. wrycode (talk) 21:15, 22 August 2020 (UTC)

Thanks, this looks good -- Jasonwryan (talk) 21:18, 22 August 2020 (UTC)
You might look at formatting with Template:AUR, see Help:Style#Package management instructions. Also if there is an upstream documentation for goimapnotify, it would be good to provide a link for further configuration. -- Lahwaacz (talk) 21:29, 22 August 2020 (UTC)