jon6fingrs / mbsync-dovecot

example docker compose file for dovecot and mbsync
GNU General Public License v3.0
21 stars 0 forks source link

Examples of how to use mbsync #2

Open hartmark opened 2 years ago

hartmark commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Sure sorry. I added the example from my mbsync repo to this readme. Let me know if there are any issues.

On Thu, Jun 23, 2022, at 6:37 AM, Markus Hartung wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/jon6fingrs/mbsync-dovecot/issues/2#issuecomment-1164250011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMXQZURZTLWPYOKC4CBSQDDVQQ5ABANCNFSM5ZSCT7VA. You are receiving this because you commented.Message ID: @.***>

hartmark commented 2 years ago

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

Leopere commented 2 years ago

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_username=example@gmail.com
      - 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
      - remote_username=example@gmail.com
      - 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