LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 12-16-2012, 04:32 PM   #16
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 168
Blog Entries: 8

Rep: Reputation: 81

Quote:
Originally Posted by g4ry View Post
Another thing I was thinking about was retrieving gmail, does anyone do this?
Yes! Your gmail is available via IMAP, and mbsync works quite nicely to retrieve it all.

This is my ~/.mbsyncrc, with some sekrit parts swapped out with "foo", "YOURGMAILPASSWORD", "YOURGMAILLOGIN", or "YOURNAME":

Code:
Expunge None
Create Both
MaildirStore local
Path /home/YOURNAME/Maildir/
Trash Trash

IMAPStore foo
Host imap.gmail.com
UseIMAPS yes
User YOURGMAILLOGIN
Pass YOURGMAILPASSWORD
CertificateFile /etc/pki/tls/certs/ca-bundle.crt
RequireSSL yes

Channel foo
Master :foo:
Slave  :local:
Sync PullNew
With this in place, the command "mbsync foo" pulls all of my gmail messages into ~/Maildir/

Come to think of it, putting this in /etc/cron.weekly seems like a pretty good idea. I will do that.
 
1 members found this post helpful.
Old 12-17-2012, 05:42 AM   #17
g4ry
LQ Newbie
 
Registered: Dec 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
@ttk thanks for your example config file, I added my info onto mine but when I run mbsync foo it complains about /etc/pki/tls/certs/ca-bundle.crt no such file or directory. Is there a package I'm missing, or is there something I need to do to create it?

Ok, sorted the cert issue out but I'm having trouble with Maildir

Reading configuration file /home/me/.mbsyncrc
Resolving imap.gmail.com... ok
Connecting to 173.194.66.108:993... ok
Connection is now encrypted
Logging in...
Channel foo
Selecting slave INBOX... Maildir error: '/home/me/Maildir/' is no valid mailbox

Thanks.

Last edited by g4ry; 12-17-2012 at 09:39 AM.
 
Old 12-17-2012, 09:40 AM   #18
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 168
Blog Entries: 8

Rep: Reputation: 81
Quote:
Originally Posted by g4ry View Post
@ttk thanks for your example config file, I added my info onto mine but when I run mbsync foo it complains about /etc/pki/tls/certs/ca-bundle.crt no such file or directory. Is there a package I'm missing, or is there something I need to do to create it?

Thanks.
I don't remember where I got mine, but looking at the comments in the file itself it appears to be derived from the mozilla sources:

Code:
## ca-bundle.crt -- Bundle of CA Root Certificates
##
## Converted at: Tue Sep 22 09:25:27 2009 UTC
##
## This is a bundle of X.509 certificates of public Certificate Authorities
## (CA). These were automatically extracted from Mozilla's root certificates
## file (certdata.txt).  This file can be found in the mozilla source tree:
## '/mozilla/security/nss/lib/ckfw/builtins/certdata.txt'
##
## It contains the certificates in PEM format and therefore
## can be directly used with curl / libcurl / php_curl, or with
## an Apache+mod_ssl webserver for SSL client authentication.
## Just configure this file as the SSLCACertificateFile.
##
I see a mozilla-1.9.2/security/nss/lib/ckfw/builtins/certdata.txt in a firefox source tarball, but it's not obvious to me how to extract ca-bundle.crt from certdata.txt.

Aha -- here's a script which claims to do it all for you. I haven't tested it, but see if it works for you:
http://www.floodgap.com/software/tty...-ca-bundle.txt

Alternatively, if you're feeling trusting, you could just download the file I've been using here:
http://ciar.org/ttk/public/ca-bundle.crt.txt
 
1 members found this post helpful.
Old 12-17-2012, 09:43 AM   #19
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 168
Blog Entries: 8

Rep: Reputation: 81
Quote:
Originally Posted by g4ry View Post
Selecting slave INBOX... Maildir error: '/home/me/Maildir/' is no valid mailbox
Thanks.
It's a bit picky about its Maildir format. This should work:
# mkdir -p /home/me/Maildir/cur /home/me/Maildir/new /home/me/Maildir/tmp
# chmod -R 700 /home/me/Maildir
 
1 members found this post helpful.
Old 12-17-2012, 09:57 AM   #20
g4ry
LQ Newbie
 
Registered: Dec 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks ttk, that worked ... I got my ca-certificates.crt in /etc/ssl/certs/ and it seems to work fine, whether that's the correct thing to do. I'll have a look at your links though. What do you use to read your mail from your inbox?

Last edited by g4ry; 12-17-2012 at 09:59 AM.
 
Old 12-17-2012, 10:20 AM   #21
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 168
Blog Entries: 8

Rep: Reputation: 81
Quote:
Originally Posted by g4ry View Post
Thanks ttk, that worked ... I got my ca-certificates.crt in /etc/ssl/certs/ and it seems to work fine, whether that's the correct thing to do. I'll have a look at your links though. What do you use to read your mail from your inbox?
"grep" and "less", mostly :-) I primarily use it for searching. But mutt reads from a Maildir quite nicely too.

You'll want to read this: http://www.elho.net/mutt/maildir/
 
1 members found this post helpful.
Old 12-17-2012, 10:53 AM   #22
g4ry
LQ Newbie
 
Registered: Dec 2012
Posts: 20

Original Poster
Rep: Reputation: Disabled
Thanks once again ttk, everything seems to be working fine and mutt works great after that link you posted.

Cheers
 
Old 12-17-2012, 12:06 PM   #23
ttk
Member
 
Registered: May 2012
Location: Sebastopol, CA
Distribution: Slackware
Posts: 168
Blog Entries: 8

Rep: Reputation: 81
Yay! :-) I'm glad it works for you.

I just added this as /etc/cron.weekly/archive-gmail.sh:

Code:
#!/bin/sh
su -l -c '/usr/bin/mbsync foo' ttk
Triggering it manually (as root) appears to do the expected thing.
 
1 members found this post helpful.
Old 12-17-2012, 03:01 PM   #24
Beelzebud
Member
 
Registered: Oct 2010
Distribution: Arch & Slackware
Posts: 95

Rep: Reputation: 22
I use a cronjob to update a bash script every 5 mins that will echo to /etc/issue, so that when I open a terminal I see correct and updated values for HDD space, uptime, etc.
 
Old 12-17-2012, 03:50 PM   #25
Diantre
Member
 
Registered: Jun 2011
Distribution: Slackware
Posts: 372

Rep: Reputation: 143Reputation: 143
Among other things (backups, clean up tasks, etc.), I have a crontab entry to backup the crontab itself, just in case I screw it up, which has happened before.

Code:
5 17 * * sun crontab -l | gzip - > $HOME/Backup/crontab-$(date +%Y%m%d_%H%M%S).gz
 
Old 12-18-2012, 07:26 PM   #26
Poprocks
Member
 
Registered: Sep 2003
Location: Toronto, Canada
Distribution: Slackware
Posts: 194

Rep: Reputation: 26
Personally I don't know why anyone would use mbsync when Slackware comes with perfectly good copies of fetchmail and getmail, but I digress.

Personally I use cron to run getmail every minute for my user account. My root's crontab is mainly used to do my nightly backups using rsync. I use /etc/cron.daily for this. Since I don't really use my root's mailspool for anything but receiving system messages, I turn off root crontab's default configuration of directing all system output to /dev/null and make it only output STDOUT to /dev/null.

That way, if an error occurs with my backup, the root user will get an email notifying me of same.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
script run fine from ./ but when put in cron does not run j-me Linux - Server 6 06-16-2012 10:02 AM
Put each daily cron task in a separate script or put them all in one script? veeruk101 Linux - Newbie 4 10-19-2011 07:10 AM
Quotas: Put quotacheck in a cron-job? kenneho Linux - Server 4 08-26-2009 02:07 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Slackware's Cron Scheduler: I'm thinking maybe I need to put in a different cron? Old_Fogie Slackware 5 11-03-2006 06:25 AM


All times are GMT -5. The time now is 06:41 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration