LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 06-01-2012, 11:45 PM   #1
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Rep: Reputation: 88
Using Mutt wiht GMAIL OFFLINE (no LAN / Internet)


Hi,

I would like to read and compose my emails when I am in the train with my mini Linux installed pc (debian).

I would like to be capable to have my gmail emails (no lan/no internet thus).

I use muttrc with cache but I cannot make it.
Would it be possible?

thanks

Code:
set from="username@gmail.com"
set realname="realname"
set query_command="abook --mutt-query '%s'"
macro index a     "|abook --add-email\n" 'add sender to abook'
macro pager a     "|abook --add-email\n" 'add sender to abook'
macro index \cb   "|urlview\n"
macro pager \cb   "|urlview\n"
set imap_login = 'username'
set imap_pass = 'xxxx'
set imap_user = 'user'
set spoolfile = imaps://imap.gmail.com:993/INBOX
set sendmail="/usr/bin/msmtp"
set folder = "imaps://imap.gmail.com:993"
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates
 
Old 06-03-2012, 11:25 PM   #2
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233
Hi,

mutt won't locally cache/sync messages from imap accounts. For this you can use offlineimap.
I use an offlineimap + mutt setup with a couple of different imap servers, and am very happy with it. I've heard that it works fine with gmail imap.

Code:
apt-get install offlineimap
Then make a ~/.offlineimaprc based on /usr/share/doc/offlineimap/examples/offlineimap.conf.gz
That file even contains a gmail specific example.

HTH,

Evo2.
 
Old 06-06-2012, 12:56 PM   #3
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Original Poster
Rep: Reputation: 88
Quote:
Originally Posted by evo2 View Post
Hi,

mutt won't locally cache/sync messages from imap accounts. For this you can use offlineimap.
I use an offlineimap + mutt setup with a couple of different imap servers, and am very happy with it. I've heard that it works fine with gmail imap.

Code:
apt-get install offlineimap
Then make a ~/.offlineimaprc based on /usr/share/doc/offlineimap/examples/offlineimap.conf.gz
That file even contains a gmail specific example.

HTH,

Evo2.
wow. Thank you Eva.

I would like to ask you if it would be possible for you to post your configuration (mutt imapoffline) (plz remove username/pwd)
 
Old 06-07-2012, 12:34 AM   #4
evo2
Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,590

Rep: Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233Reputation: 1233
Hi,

the example config that comes with offlineimap will be of more use to you than my config.

To configure mutt itself, get rid of all the imap specific stuff since offlineimap will take care of syncing your local maildirs with the imap server.

Please post back if you have any questions about it.

Evo2.
 
Old 08-19-2012, 03:30 PM   #5
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Original Poster
Rep: Reputation: 88
Quote:
Originally Posted by evo2 View Post
Hi,

the example config that comes with offlineimap will be of more use to you than my config.

To configure mutt itself, get rid of all the imap specific stuff since offlineimap will take care of syncing your local maildirs with the imap server.

Please post back if you have any questions about it.

Evo2.
thanks

https://wiki.archlinux.org/index.php/OfflineIMAP

with it is it possible to see the content of last email in plain text
 
Old 08-21-2012, 11:41 PM   #6
cseanburns
Member
 
Registered: Nov 2003
Distribution: Debian
Posts: 117

Rep: Reputation: 17
I use mutt / offlineimap for a similar purpose. I believe my .offlineimaprc file is fairly standard. For my gmail account, I use the password generated for authorizing applications (google.com -> accounts -> security)

Code:
[general]
accounts = Gmail
maxsyncaccounts = 1
socktimeout = 60

ui = Curses.Blinkenlights

[Account Gmail]
localrepository = Local
remoterepository = Remote
autorefresh = 5
quick = 1

[Repository Local]
type = Maildir
localfolders = ~/Mail

[Repository Remote]
type = Gmail
remotehost = imap.gmail.com
ssl = yes
remoteport = 993
remoteuser = <myEmail>
remotepass = <myPass>
maxconnections = 1
holdconnectionopen = no
keepalive = 120
realdelete = no
 
1 members found this post helpful.
Old 08-25-2012, 10:03 AM   #7
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Original Poster
Rep: Reputation: 88
Thumbs up

Quote:
Originally Posted by cseanburns View Post
I use mutt / offlineimap for a similar purpose. I believe my .offlineimaprc file is fairly standard. For my gmail account, I use the password generated for authorizing applications (google.com -> accounts -> security)

Code:
[general]
accounts = Gmail
maxsyncaccounts = 1
socktimeout = 60

ui = Curses.Blinkenlights

[Account Gmail]
localrepository = Local
remoterepository = Remote
autorefresh = 5
quick = 1

[Repository Local]
type = Maildir
localfolders = ~/Mail

[Repository Remote]
type = Gmail
remotehost = imap.gmail.com
ssl = yes
remoteport = 993
remoteuser = <myEmail>
remotepass = <myPass>
maxconnections = 1
holdconnectionopen = no
keepalive = 120
realdelete = no

I would like to thank you very much for sharing your configuration !! thanks a lot for your help !
 
Old 08-25-2012, 10:15 AM   #8
Xeratul
Senior Member
 
Registered: Jun 2006
Location: Debian Land
Posts: 1,389

Original Poster
Rep: Reputation: 88
1. step:
Code:
mkdir  ~/Maildir

2. step:
gedit ~/.offlineimaprc

Code:
[general]
accounts = Gmail
maxsyncaccounts = 1
socktimeout = 60

ui = Curses.Blinkenlights

[Account Gmail]
localrepository = Local
remoterepository = Remote
autorefresh = 5
quick = 1

[Repository Local]
type = Maildir
localfolders = ~/Maildir

[Repository Remote]
type = Gmail
remotehost = imap.gmail.com
ssl = yes
remoteport = 993
remoteuser = *****@gmail.com
remotepass = ***** 
maxconnections = 1
holdconnectionopen = no
keepalive = 120
realdelete = no
3. step:


Code:
$ offlineimap

then you get:

Code:
OfflineIMAP 6.2.0
Copyright (C) 2002 - 2009 John Goerzen <jgoerzen@complete.org>
This software comes with ABSOLUTELY NO WARRANTY; see the file
COPYING for details.  This is free software, and you are welcome
to distribute it under the conditions laid out in COPYING.
***** Processing account Gmail
Copying folder structure from Gmail to Maildir
Establishing connection to imap.gmail.com:993.
Syncing INBOX: Gmail -> Maildir
Scanning folder [Maildir/INBOX]
Scanning folder [Gmail/INBOX]
2: [active]      *Control:

...

All your emails, or most of them, are then located into :
~/Maildir/INBOX/cur

*** Question:

would you know how to fetch only the last received message of the INBOX, that would be into : ~/Maildir/INBOX/cur ?

I would like to fetch only the last email ... if possible.

Last edited by Xeratul; 08-25-2012 at 10:19 AM.
 
Old 12-13-2012, 01:47 AM   #9
cseanburns
Member
 
Registered: Nov 2003
Distribution: Debian
Posts: 117

Rep: Reputation: 17
Quote:
Originally Posted by Xeratul View Post
*** Question:

would you know how to fetch only the last received message of the INBOX, that would be into : ~/Maildir/INBOX/cur ?

I would like to fetch only the last email ... if possible.
Geez, I completely missed this response. Sorry! You've probably figured it out by now, too.

Once offlineimap has made its initial run, it'll only pull recent email. But if you mean you only want to receive the last emails for that initial run, I believe you have to do this from Gmail. In Gmail, go to Settings -> Labels and select which labels you want to pull from. If you only select Inbox, that should do the trick.

Again, apologies for not seeing this sooner!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mutt and Gmail Panci Linux - Software 3 02-12-2009 07:35 PM
LXer: Gmail goes offline LXer Syndicated Linux News 0 01-29-2009 02:11 AM
archived gmail not downloading with mutt + imap fakie_flip Linux - Software 1 07-13-2008 10:26 PM
Can I intall softwares WIHT OUT internet connection (offline)? bbx Linux - Newbie 5 02-22-2007 02:15 AM
Configuring Mutt , and gmail account? D3javu Linux - Software 2 02-09-2005 10:07 AM


All times are GMT -5. The time now is 05:35 PM.

Main Menu
Advertisement
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