Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Examples of how to use mbsync #2

Open
hartmark opened this issue Jun 22, 2022 · 5 comments
Open

Examples of how to use mbsync #2

hartmark opened this issue Jun 22, 2022 · 5 comments

Comments

@hartmark
Copy link

I got perfect timing for googling on how to archive mails so I can pay less for my email hosting :)

I'd love some example on how your mbsync script looks like.

@jon6fingrs
Copy link
Owner

I got perfect timing for googling on how to archive mails so I can pay less for my email hosting :)

I'd love some example on how your mbsync script looks like.

Do you mean to set mbsync to automatically fetch mails?

@hartmark
Copy link
Author

Yes

Once you make the mbsync container, you need a cron job or something so that it'll autorun every X minutes (I have mine run every 5 minutes)

This is the one I was wondering about

@jon6fingrs
Copy link
Owner

jon6fingrs commented Jun 23, 2022 via email

@hartmark
Copy link
Author

Cool, I don't know if I have any time this weekend, but I'll report back if I have any problems

@Leopere
Copy link

Leopere commented Jun 28, 2022

I've included my swarm stack example if anyone wants it with a restart set to once every hour.

version: "3.9" 
services:
  dovecot:
    image: thehelpfulidiot/dovecot:latest
#    container_name: dovecot
#    ports:
#      - "993:993"
    volumes:
      - /mnt/tank/persist/example.com/mbsync/production/ssl:/ssl
      - /mnt/tank/persist/example.com/mbsync/production/dovecot:/mail # same as mbsync
      - /mnt/tank/persist/example.com/mbsync/production/logs:/var/log/dovecot
    environment:
      - [email protected]
      - email_password=redacted
      - PUID=1000
      - disable_plaintext_auth=no
      - ssl_cert=cert1.pem
      - ssl_key=privkey1.pem
      - ssl=required
      - server_address=dovecot
    deploy:
      replicas: 1
    networks:
      - default
      - traefik

  mbsync:
    image: thehelpfulidiot/mbsync:latest
#    container_name: mbsync
    volumes:
      - /mnt/tank/persist/example.com/mbsync/production/dovecot:/mail # same as dovecot
    environment:
      - host_name=imap.gmail.com
      - port=993
      - [email protected]
      - remote_password=redacted
      - ssltype=IMAPS
      - sslversions=TLSv1.2
      - mailbox_name=gmail
      - PUID=1000
    deploy:
      replicas: 1
      restart_policy:
        delay: 1h
    networks:
      - default
networks:
  traefik:
    external: true
  default:
    external: false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants