Skip to content

Instantly share code, notes, and snippets.

@drewr

drewr/.mbsyncrc Secret

Last active December 10, 2015 07:38
Show Gist options
  • Save drewr/c6e213f0b7ccd712e136 to your computer and use it in GitHub Desktop.
Save drewr/c6e213f0b7ccd712e136 to your computer and use it in GitHub Desktop.
My mbsync setup
IMAPAccount gmail-aaraines
Host imap.gmail.com
User aaraines@gmail.com
## Since mbsync doesn't have a way to pull in passwords from other
## locations, I pass this file through Text::Template via the below
## ttexpand program before invoking mbsync with something like
## `mbsync -c <(ttexpand <~/.mbsyncrc)`.
Pass {readrc '.auth.aaraines@gmail.com'}
UseIMAPS yes
## aptitude install ca-certificate ---v
CertificateFile /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt
IMAPStore gmail-aaraines
Account gmail-aaraines
IMAPAccount local-aaraines
Host localhost
User aaraines
Pass imap
UseIMAPS no
RequireSSL no
UseTLSv1 no
IMAPStore local-aaraines
Account local-aaraines
Channel aaraines
Master :gmail-aaraines:
Slave :local-aaraines:
Patterns !* list.*
Create Slave
Expunge Slave
Sync Pull
#!/usr/bin/env perl
# Filter stdin while executing embedded perl.
use Modern::Perl;
use Text::Template;
use File::Spec::Functions;
sub readrc {
my $file = shift;
my $s = Text::Template::_load_text(catfile($ENV{"HOME"}, $file));
chomp $s;
return $s;
}
my $tmpl =
Text::Template->new(
TYPE => 'FILEHANDLE', SOURCE => \*STDIN);
say $tmpl->fill_in();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment