Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

2 votes
2 answers
790 views
does mbsync know i deleted folders?
Newly working with `neomutt` and `mbsync`. I did an initial grab of all my mail and folders which was fine. Then I started organizing my folders and mail. Some of the folders (or "mailboxes") within the account were cleaned up and DELETED. When I run `mbsync -a` it seems to want to find those delete...
Newly working with neomutt and mbsync. I did an initial grab of all my mail and folders which was fine. Then I started organizing my folders and mail. Some of the folders (or "mailboxes") within the account were cleaned up and DELETED. When I run mbsync -a it seems to want to find those deleted folders. The error message is as follows:
Error: channel example@gmail.com: far side box INBOX/subscribed cannot be opened.
The INBOX/subscribed is a folder that no longer exists under INBOX Yet, the mbsync task is still trying to fetch it. **Is there a config file somewhere that needs updating? What can I do to fix this error?** Thank you for your help.
examplebear (21 rep)
Dec 31, 2022, 07:42 PM • Last activity: Jun 25, 2025, 04:54 PM
2 votes
0 answers
1705 views
Complete command line email retrieval for IMAP IDLE
I'm trying to retrieve my mail from command line, and they use mu4e to read them. However, it turns out to be a nightmare to find a program that can do the following stuff: - downloads the mail from an IMAP server into a maildir folder - uses SSL/TLS when the server provide it - can deal with IMAP I...
I'm trying to retrieve my mail from command line, and they use mu4e to read them. However, it turns out to be a nightmare to find a program that can do the following stuff: - downloads the mail from an IMAP server into a maildir folder - uses SSL/TLS when the server provide it - can deal with IMAP IDLE in order to avoid dirty loop to get the messages, if possible efficiently - provides a way to get the password from a GPG encrypted file for security reason (I don't want to need to trust the people that can get physical access to the computer) - can deal with several accounts in parallel, if possible with just one execution to save ressources Bonus: - efficient (I would like to avoid to install a full IMAP server) - reliable - still maintained - simple to configure - packaged into regular linux distributions, as well as nix I tried lots of solutions, but it seems that none of them can deal with these tasks... - offlineimap : officially has beta for IDLE, but I was not able to configure it to use it (bug or maybe I just missed something important...), offlineimap just stop after one scan even with the idle options. Moreover, it seems to be quite slow and buggy according to the community - mbsync : no IDLE - mbsync + mswatch : need to have access on the server, so not possible - mbsync + imapnotify : maybe the best solution so far... but imapnotify is not packaged in debian and nix - imapsync : does not deal with mailbox format - fetchmail : cannot deal with PGP encrypted password Any solution?
tobiasBora (4621 rep)
Mar 28, 2018, 06:32 PM • Last activity: Feb 25, 2025, 02:58 PM
5 votes
0 answers
2572 views
Sync gmail using mbsync (isync) on debian linux using XOAUTH2
I am trying to sync my mails from gmail to my local mail server using [mbsync][1]. But i keep getting an error `Error: SASL(-4): no mechanism available: No worthy mechs found` Here is my `.mbsyncrc` file: #IMAP server you wish to copy mails from. IMAPAccount original Host imap.gmail.com User usernam...
I am trying to sync my mails from gmail to my local mail server using mbsync . But i keep getting an error Error: SASL(-4): no mechanism available: No worthy mechs found Here is my .mbsyncrc file: #IMAP server you wish to copy mails from. IMAPAccount original Host imap.gmail.com User username@gmail.com AuthMechs XOAUTH2 Pass access_token_recieved_from_google UseIMAPS yes CertificateFile /etc/ssl/certs/ca-certificates.crt # The IMAP server you wish to copy mails to. IMAPAccount target Host local.mail.server.host User local_user Pass somepass AuthMechs LOGIN UseIMAPS yes CertificateFile /etc/ssl/certs/ca-certificates.crt # Link IMAP server to remote used below. Note Account is set to 'original' now -- we'll be set it to 'target' later! IMAPStore my-remote Account original # The local storage we'll be using. Note the trailing slash at the end of the Path! MaildirStore my-local Path ~/mail/ Inbox ~/mail/INBOX/ # This is where the magic happens. Note Sync is set to 'Pull' now -- we'll set it to 'Push' later! Channel my-channel Master :my-remote: Slave :my-local: Patterns * Create Both Sync Pull SyncState * system: Linux stretch 4.9.0-7-amd64 #1 SMP Debian 4.9.110-1 (2018-07-05) x86_64 GNU/Linux mbsync --version isync 1.2.1 looks like mbsync isn't recognizing XOAUTH2 for keyword AuthMechs. If i change the AuthMech type to LOGIN, i get an invalid credentials error. (makes sense, i put in an auth token in place of the password). Any ideas?
SomeGuyFortune (151 rep)
Sep 5, 2018, 03:45 AM • Last activity: Feb 25, 2025, 02:56 PM
7 votes
2 answers
5397 views
OfflineIMAPS and CA certificates
This question is about offlineimaps but with the given opportunity I'd like resources to learn more about ssl certificates and the whole deal with them. I downloaded the latest offlineimaps (7.0.6) and after I was done with the minimal config I run the command and I get the following error: Account...
This question is about offlineimaps but with the given opportunity I'd like resources to learn more about ssl certificates and the whole deal with them. I downloaded the latest offlineimaps (7.0.6) and after I was done with the minimal config I run the command and I get the following error: Account sync Gmail: *** Processing account Gmail Establishing connection to imaps://imap.gmail.com:993 (GmailRemote) ERROR: No CA certificates and no server fingerprints configured. You must configure at least something, otherwise having SSL helps nothing. *** Finished account 'Gmail' in 0:00 ERROR: Exceptions occurred during the run! ERROR: No CA certificates and no server fingerprints configured. You must configure at least something, otherwise having SSL helps nothing. Traceback: File "/usr/local/lib/python2.7/dist-packages/offlineimap/accounts.py", line 271, in syncrunner self.__sync() File "/usr/local/lib/python2.7/dist-packages/offlineimap/accounts.py", line 334, in __sync remoterepos.getfolders() File "/usr/local/lib/python2.7/dist-packages/offlineimap/repository/IMAP.py", line 448, in getfolders imapobj = self.imapserver.acquireconnection() File "/usr/local/lib/python2.7/dist-packages/offlineimap/imapserver.py", line 511, in acquireconnection af=self.af, File "/usr/local/lib/python2.7/dist-packages/offlineimap/imaplibutil.py", line 194, in __init__ super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs) File "/usr/local/lib/python2.7/dist-packages/offlineimap/bundled_imaplib2.py", line 2135, in __init__ IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl) File "/usr/local/lib/python2.7/dist-packages/offlineimap/bundled_imaplib2.py", line 357, in __init__ self.open(host, port) File "/usr/local/lib/python2.7/dist-packages/offlineimap/imaplibutil.py", line 201, in open "having SSL helps nothing.", OfflineImapError.ERROR.REPO) I want to download all mail from my gmail account, and later figure out how to read it with mutt. But first all I want to do is have a folder with all my mail in it. Here is my .offlineimaprc [general] accounts = Gmail [Account Gmail] localrepository = GmailLocal remoterepository = GmailRemote ssl = yes synclabels = yes [Repository GmailLocal] type = Maildir localfolders = ~/Mail/Gmail [Repository GmailRemote] type = IMAP remotehost = imaps://imap.gmail.com remoteuser = [MY_E-MAIL]@gmail.com
The Gramm (83 rep)
Sep 17, 2016, 11:30 AM • Last activity: Sep 22, 2024, 07:26 PM
0 votes
1 answers
274 views
Tagging mail with "notmuch" marks them as old
After syncing my local maildir inboxes with `offlineimap` and performing spam filtering and sorting using `fdm`+`bogofilter`, I tag the messages in the mail store using `notmuch`. Up until recently, I used the following shell code to tag and re-tag messages depending on certain criteria: ```sh notmu...
After syncing my local maildir inboxes with offlineimap and performing spam filtering and sorting using fdm+bogofilter, I tag the messages in the mail store using notmuch. Up until recently, I used the following shell code to tag and re-tag messages depending on certain criteria:
notmuch new

tr -s '\t' ' ' <<'END_BATCH' | notmuch tag --batch
-inbox +sent            -- folder:/Sent/
-inbox +archive         -- folder:/Archive/
-inbox +junk            -- folder:/Junk/
+unsorted               -- folder:/INBOX.Unsorted/
-unsorted               -- not folder:/INBOX.Unsorted/
-unread -- tag:archive
+unread -- tag:unsorted
END_BATCH
This removes the inbox tag from any message in a Sent, Archive or Junk folder, while retagging the messages with the appropriate tags for those three folders. It then tags or untags messages depending on whether they are in an INBOX.Unsorted folder (where I put messages that bogofilter couldn't classify). Lastly, I ensure that archived messages are not tagged as unread and that unsorted messages _are_ tagged as unread. This worked well. Since I receive mail on five different accounts, I then also wanted to add tags like account-somename, account-othername etc. to messages, depending on the folder name:
notmuch new

tr -s '\t' ' ' <<'END_BATCH' | notmuch tag --batch
-inbox +sent            -- folder:/Sent/
-inbox +archive         -- folder:/Archive/
-inbox +junk            -- folder:/Junk/
+unsorted               -- folder:/INBOX.Unsorted/
-unsorted               -- not folder:/INBOX.Unsorted/
-unread -- tag:archive
+unread -- tag:unsorted
+account-acc1           -- folder:/acc1/
+account-acc2           -- folder:/acc2/
+account-acc3           -- folder:/acc3/
+account-acc4           -- folder:/acc4/
+account-acc5           -- folder:/acc5/
END_BATCH
The tagging seems to be performed as expected, but a side-effect is that _new messages are marked as old_ (moved from the maildir's new directory to the cur directory). This in turn means mutt won't detect the new messages in the inboxes (unless I set maildir_check_cur in the mutt configuration, which I don't think is a nice solution). I don't know why or what I could do to stop this from happening. My notmuch configuration:
[database]
path=/home/myself/Mail/inboxes

[user]
name=myname
primary_email=me@example.com
other_email=otherme@example.com

[new]
tags=inbox;unread

[search]

[maildir]
syncronize_flags=true

[index]
header.List=List-Id
Kusalananda (354348 rep)
Aug 30, 2023, 02:15 PM • Last activity: Sep 1, 2023, 10:21 PM
0 votes
0 answers
202 views
Batch extract pdf from emails on Debian in bash
**What I'm trying to achieve:** I am trying to send pdf documents to my Remarkable 2 tablet via email. **How I'm trying to do it:** 1. I set up `rmfakecloud`: a software that runs on your server and emulates the official Remarkable cloud system, so you're in control of your data 2. I set up `rmapi`:...
**What I'm trying to achieve:** I am trying to send pdf documents to my Remarkable 2 tablet via email. **How I'm trying to do it:** 1. I set up rmfakecloud: a software that runs on your server and emulates the official Remarkable cloud system, so you're in control of your data 2. I set up rmapi: a software that allows to interact with rmfakecloud and official Remarkable 2 cloud through the command line 3. I set up an email account on gmail tablet@mydomain.com enabling login with less secure apps (i.e.: allow to login without second authentication factor) 4. I wrote (with the help of ChatGPT, I must admit) a short bash script that: * Downloads all emails from said account * Checks if the sender matches my email account (myself@mydomain.com) * Extracts the files from the email, if they are pdf ** Maildir Folder [Gmail]/Drafts [acc: Gmail]: Syncing [Gmail]/Drafts: Gmail -> Maildir Folder [Gmail]/Important [acc: Gmail]: Syncing [Gmail]/Important: Gmail -> Maildir Folder [Gmail]/Sent Mail [acc: Gmail]: Syncing [Gmail]/Sent Mail: Gmail -> Maildir Folder [Gmail]/Spam [acc: Gmail]: Syncing [Gmail]/Spam: Gmail -> Maildir Folder [Gmail]/Starred [acc: Gmail]: Syncing [Gmail]/Starred: Gmail -> Maildir Folder [Gmail]/Trash [acc: Gmail]: Syncing [Gmail]/Trash: Gmail -> Maildir Folder INBOX [acc: Gmail]: Syncing INBOX: Gmail -> Maildir Account sync Gmail: *** Finished account 'Gmail' in 0:01 **What I understood is going wrong:** From my understanding, the script manages to download mail from gmail imap server, and manages to upload files to the cloud server if files are provided. *What doesn't work*, is the extraction of pdf files from the emails. I really don't know what is going wrong, and I don't know what could be an easier approach. **How I plan to run the script:** I plan to demonize the script and run it as a systemd service
giovi321 (919 rep)
Apr 6, 2023, 09:21 PM • Last activity: Apr 7, 2023, 09:48 PM
2 votes
1 answers
455 views
How to send mail when using offlineimap?
I've only ever used GUI mail clients like Thunderbird, and want to try using offlineimap with alpine. However I'm confused about how it all ties together. As I understand it: > Once I configure offlineimap with my accounts, it will go to every respective server and use IMAP to mirror my mails to a l...
I've only ever used GUI mail clients like Thunderbird, and want to try using offlineimap with alpine. However I'm confused about how it all ties together. As I understand it: > Once I configure offlineimap with my accounts, it will go to every respective server and use IMAP to mirror my mails to a local folder like ~/mail/gmail. Presumably I can then use any mail client to read these emails, and if I make changes to them (such as marking as read or moving between folders) they will be pushed to the server the next time offlineimap syncs. But what about sending mail? I'm a bit fuzzy on how email works, however, it seems like: >IMAP is just for downloading/uploading mail to be stored on my mail provider's server. So IMAP can't actually send mail. Mail is sent using SMTP. In many clients, when you click "send mail", what actually happens is that the mail you compose gets sent through SMTP *and also* the mail client saves a copy of the mail to the "sent" folder of your account, which will be propagated through IMAP. So my questions here are: 1. Is my understanding above correct? 2. If I use offlineimap, who will actually send my outgoing mails through SMTP? Would I set up some separate "send emails" program that will periodically check my "outgoing" folder and send everything in there via SMTP (how will it know which SMTP server and account to use)? Or will I still have to set up SMTP server/credentials in alpine?
Jessica (399 rep)
Apr 3, 2022, 06:18 AM • Last activity: Apr 3, 2022, 09:30 AM
-1 votes
1 answers
217 views
Offlineimap: python code to read refresh token from unix pass (or gpg file)
I use offlineimap to organize my emails, and in order to use my work account I am now obliged to use OAuth2 authentication. I successfully got a refresh-token, and thus offlineimap works if I set the variable ```oauth2_refresh_token``` accordingly. However, I would like to store the refresh token en...
I use offlineimap to organize my emails, and in order to use my work account I am now obliged to use OAuth2 authentication. I successfully got a refresh-token, and thus offlineimap works if I set the variable
accordingly. However, I would like to store the refresh token encrypted (I use unix pass, that stores it as a gpg encrypted file). I cannot manage to use the
to set a python code that reads the refresh token from pass, or the corresponding gpg file, probably because of my complete lack of python knowledge. I tried to use the same code as for
(and that for the latter works perfectly):
def get_pass(account): 
        return check_output("pass email/" + account, shell=True).splitlines()
but I get the following error:
TypeError: a bytes-like object is required, not 'str'
and in fact the offlineimaprc template here specifies that the returned values by
"must be bytes" (whatever this means). What is the correct code to use in this case?
yuggib (101 rep)
Feb 11, 2022, 12:02 AM • Last activity: Mar 6, 2022, 08:40 PM
2 votes
0 answers
91 views
Easiest IMAP archiver for multiple accounts
I'm pretty new to linux, Im running Ubuntu at the moment. On windows I was using a service called "mailstore" to archive the entire contents of multiple email accounts. I've seen a few searching google, but a lot of the "verbage" goes way over my head at the moment. All the accounts being archived u...
I'm pretty new to linux, Im running Ubuntu at the moment. On windows I was using a service called "mailstore" to archive the entire contents of multiple email accounts. I've seen a few searching google, but a lot of the "verbage" goes way over my head at the moment. All the accounts being archived use yahoo, and I dont need to be able to send mail. Would be great to be able to add a full list of the accounts instead of manually adding them one by one. Also a plus if it has an integrated mail client for viewing emails as well, but thats not completely necessary. Would love any suggestions or links to any great guides for newbies to linux like me. Thanks!
Jim (21 rep)
Sep 7, 2021, 04:56 PM
21 votes
4 answers
18426 views
Encrypt OfflineIMAP Password
I'm trying to set up OfflineIMAP to authenticate via a gpg encrypted file (that way I can consolidate all my encryption to my gpg-agent process). From the documentation, it seems the only way to encrypt one's server passwords is to use gnome-keyring (which I'd prefer not to run on my headless server...
I'm trying to set up OfflineIMAP to authenticate via a gpg encrypted file (that way I can consolidate all my encryption to my gpg-agent process). From the documentation, it seems the only way to encrypt one's server passwords is to use gnome-keyring (which I'd prefer not to run on my headless server). Is there a way to pipe in my password from a gpg file the way you can with mutt? I know you can add extra features to offlineimap with the extension python file, but I'm afraid I wouldn't know where to start with that.
Tammer Ibrahim (813 rep)
Jul 29, 2012, 02:25 AM • Last activity: Oct 3, 2020, 05:53 PM
1 votes
1 answers
91 views
Can mutt handle exclamation points instead of colons in file names?
I'm wanting to move my maildir folder to a different disk that has a Window file system. However, the file system does not allow colons (:) in file names, which Maildir uses in some file names by default. There is an option for Maildir to use another character in place of a colon. [Exclamation point...
I'm wanting to move my maildir folder to a different disk that has a Window file system. However, the file system does not allow colons (:) in file names, which Maildir uses in some file names by default. There is an option for Maildir to use another character in place of a colon. Exclamation point is common . However, I've read a warning that "you will probably loose compatibility with other programs trying to read the same Maildir. " when using this option. I only use mutt for reading this mail. Can mutt handle exclamation marks in place of a colon in filenames?
Rob Mosher (113 rep)
Aug 18, 2020, 01:43 PM • Last activity: Aug 19, 2020, 07:49 AM
1 votes
2 answers
802 views
How do I force offlineimap to use python2.7?
I'm setting up a new computer and installed `offlineimap` with `pip install --user offlineimap` but when I try to run it I'm getting a series of errors because offlineimap doesn't support Python3: https://github.com/OfflineIMAP/offlineimap/issues/472 I do have 2.7 installed as well as 3: amanda@host...
I'm setting up a new computer and installed offlineimap with pip install --user offlineimap but when I try to run it I'm getting a series of errors because offlineimap doesn't support Python3: https://github.com/OfflineIMAP/offlineimap/issues/472 I do have 2.7 installed as well as 3: amanda@host:~$ python --version Python 2.7.15rc1 but even I'm not sure how to force offlineimap to use it. Per https://stackoverflow.com/questions/10919569/install-a-module-using-pip-for-specific-python-version I uninstalled and tried to reinstall, specifying the python version, but that's choking in its own special way: amanda@host:~$ python2.7 ~/.local/bin/pip install --user offlineimap Traceback (most recent call last): File "/home/amanda/.local/bin/pip", line 7, in from pip._internal import main ImportError: No module named pip._internal The full OfflineIMAP error: OfflineIMAP 7.2.1 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.57 (bundled), Python v3.6.5, OpenSSL 1.1.0g 2 Nov 2017 Account sync Example: *** Processing account Example Establishing connection to mail.example.info:993 (VelRemote) ERROR: While attempting to sync account 'Example' IMAP4 protocol error: program error: - cannot use a bytes pattern on a string-like object *** Finished account 'Example' in 0:00 ERROR: Exceptions occurred during the run! ERROR: While attempting to sync account 'Example' IMAP4 protocol error: program error: - cannot use a bytes pattern on a string-like object Traceback: File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/accounts.py", line 283, in syncrunner self.__sync() File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/accounts.py", line 359, in __sync remoterepos.getfolders() File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/repository/IMAP.py", line 452, in getfolders imapobj = self.imapserver.acquireconnection() File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/imapserver.py", line 547, in acquireconnection af=self.af, File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/imaplibutil.py", line 194, in __init__ super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs) File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/bundled_imaplib2.py", line 2183, in __init__ IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl) File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/bundled_imaplib2.py", line 400, in __init__ self.welcome = self._request_push(name='welcome', tag='continuation').get_response('IMAP4 protocol error: %s') File "/home/amanda/.local/lib/python3.6/site-packages/offlineimap/bundled_imaplib2.py", line 201, in get_response raise typ(exc_fmt % str(val))
Amanda (1818 rep)
Jul 9, 2018, 06:44 PM • Last activity: Mar 28, 2019, 01:20 AM
3 votes
1 answers
1328 views
CERTIFICATE_VERIFY_FAILED when connecting to GMail with offlineimap
Under an Arch Linux, I want to use `offlineimap` to synchronize to GMail like this. [general] accounts = Gmail maxsyncaccounts = 3 [Account Gmail] localrepository = LocalGmail remoterepository = RepositoryGmail autorefresh = 30 quick = 10 postsynchook = mu index --maildir ~/.offlineimap/Gmail [Repos...
Under an Arch Linux, I want to use offlineimap to synchronize to GMail like this. [general] accounts = Gmail maxsyncaccounts = 3 [Account Gmail] localrepository = LocalGmail remoterepository = RepositoryGmail autorefresh = 30 quick = 10 postsynchook = mu index --maildir ~/.offlineimap/Gmail [Repository LocalGmail] type = GmailMaildir localfolders = ~/.offlineimap/Gmail [Repository RepositoryGmail] type = Gmail maxconnections = 2 remoteuser = my.gmail.accountname remotepass = gmailapppassword folderfilter = lambda foldername: foldername not in ['[Gmail]/All Mail', '[Gmail]/Important'] sslcacertfile = /etc/ssl/certs/ca-certificates.crt which fails due to some issue with SSL. $ offlineimap -o -a Gmail OfflineIMAP 7.2.1 Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception) imaplib2 v2.57 (bundled), Python v2.7.15, OpenSSL 1.1.1a 20 Nov 2018 Account sync Gmail: *** Processing account Gmail Establishing connection to imap.gmail.com:993 (RepositoryGmail) ERROR: Unknown SSL protocol connecting to host 'imap.gmail.com' for repository 'RepositoryGmail'. OpenSSL responded: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:726) I read elsewhere that I can check the SSL connection by running $ openssl s_client -showcerts -connect imap.gmail.com:993 [...] * OK Gimap ready for requests from 217.63.244.188 s26mb317463625edc which to me suggests that the error is not actually in the SSL connection, but in how offlineimap handles it. The certificate file `` exists and contains a GlobalSign Root CA - R2 certificate. Just to be sure I have installed six and then offlineimap into both a clean python2.7 and a clean python3.7 virtualenv using their respective pips, and the CERTIFICATE_VERIFY_FAILED persists. How do I get offlineimap to talk to GMail?
Anaphory (762 rep)
Dec 12, 2018, 12:49 AM • Last activity: Feb 14, 2019, 10:40 AM
3 votes
1 answers
1478 views
How to sync email contacts between computers for use in mutt?
I'm using mutt as email client. Specifically, this is my setup: - Mail is stored at a remote hosting company. - Mail is retrieved locally using OfflineIMAP. - I have two mail accounts: one personal and one for work. Both use separate Maildirs/`muttrc`s/instances of mutt. I've been using abook as add...
I'm using mutt as email client. Specifically, this is my setup: - Mail is stored at a remote hosting company. - Mail is retrieved locally using OfflineIMAP. - I have two mail accounts: one personal and one for work. Both use separate Maildirs/muttrcs/instances of mutt. I've been using abook as address book and in general I like it. However, I'd like to have my contacts synced between computers. Apart from using Dropbox or similar software, is it possible to store the contacts somehow on the mail server? I've read that for example Alpine uses the IMAP protocol to synchronize contacts. Is something similar possible for mutt/abook?
Ruben (159 rep)
Apr 30, 2018, 07:06 PM • Last activity: May 1, 2018, 11:49 AM
3 votes
1 answers
1259 views
How do I restart offlineimap?
I have `offlineimap` running on a cron job with `*/10 * * * * offlineimap -q -u quiet`. Every once in a while it seems to get interrupted, and when that happens I can't restart it. If I try to run it from the terminal I get an error indicating that it is locked: OfflineIMAP 6.5.5 Licensed under the...
I have offlineimap running on a cron job with */10 * * * * offlineimap -q -u quiet. Every once in a while it seems to get interrupted, and when that happens I can't restart it. If I try to run it from the terminal I get an error indicating that it is locked: OfflineIMAP 6.5.5 Licensed under the GNU GPL v2+ (v2 or any later version) Account sync Example: *** Processing account Example ERROR: Could not lock account Example. Is another instance using this account? *** Finished account 'Example' in 0:00 ERROR: Exceptions occurred during the run! ERROR: Could not lock account Example. Is another instance using this account? Traceback: File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 240, in syncrunner self.lock() File "/usr/lib/python2.7/dist-packages/offlineimap/accounts.py", line 207, in lock OfflineImapError.ERROR.REPO) Is there any way to break the lock or force offlineimap to quit all the way?
Amanda (1818 rep)
Apr 19, 2016, 04:56 AM • Last activity: Apr 3, 2018, 11:03 PM
2 votes
1 answers
1253 views
Sync mail with offlineimap via systemd service/timer; getting password from gnome keyring
I am trying to autosync my mail in mutt using offlineimap via a systemd service. I am using [these][1] files and have moved them to the `/etc/systemd/user` folder. However, I am storing my password via the gnome-keyring and retrieving it via `secret-tool lookup user [user] domain gmail.com`. This wo...
I am trying to autosync my mail in mutt using offlineimap via a systemd service. I am using these files and have moved them to the /etc/systemd/user folder. However, I am storing my password via the gnome-keyring and retrieving it via secret-tool lookup user [user] domain gmail.com. This works from the command line, but the service returns the following: user@computer:~/.dotfiles$ systemctl --user -l status offlineimap.service ● offlineimap.service - Offlineimap Service Loaded: loaded (/etc/systemd/user/offlineimap.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2016-06-10 10:03:43 CEST; 11s ago Process: 5193 ExecStart=/usr/bin/offlineimap -o -u syslog (code=exited, status=1/FAILURE) Main PID: 5193 (code=exited, status=1/FAILURE) Jun 10 10:03:40 computer offlineimap: Establishing connection to imap.gmail.com:993 Jun 10 10:03:43 computer ERROR: While attempting to sync account 'MyAccount' Command 'secret-tool lookup user myaccount domain gmail.com' returned non-zero exit status 1 Jun 10 10:03:43 computer offlineimap: *** Finished account 'MyAccount' in 0:03 Jun 10 10:03:43 computer ERROR: Exceptions occurred during the run! Jun 10 10:03:43 computer ERROR: While attempting to sync account 'MyAccount' Command 'secret-tool lookup user myaccount domain gmail.com' returned non-zero exit status 1 Jun 10 10:03:43 computer Traceback: File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 263, in syncrunner self.__sync() File "/usr/lib/python2.7/site-packages/offlineimap/accounts.py", line 326, in __sync remoterepos.getfolders() File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 390, in getfolders imapobj = self.imapserver.acquireconnection() File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 511, in acquireconnection self.__authn_helper(imapobj) File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 411, in __authn_helper if func(imapobj): File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 350, in __authn_login self.__loginauth(imapobj) File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 203, in __loginauth imapobj.login(self.username, self.__getpassword()) File "/usr/lib/python2.7/site-packages/offlineimap/imapserver.py", line 159, in __getpassword self.password = self.repos.getpassword() or \ File "/usr/lib/python2.7/site-packages/offlineimap/repository/IMAP.py", line 332, in getpassword return self.localeval.eval(passwd) File "/usr/lib/python2.7/site-packages/offlineimap/localeval.py", line 48, in eval return eval(text, names) File "", line 1, in File "/home/user/.mutt/offlineimap.py", line 8, in get_keychain_pass stderr=subprocess.STDOUT) File "/usr/lib64/python2.7/subprocess.py", line 573, in check_output raise CalledProcessError(retcode, cmd, output=output) Jun 10 10:03:43 computer systemd: offlineimap.service: Main process exited, code=exited, status=1/FAILURE Jun 10 10:03:43 computer systemd: Failed to start Offlineimap Service. Jun 10 10:03:43 computer systemd: offlineimap.service: Unit entered failed state. Jun 10 10:03:43 computer systemd: offlineimap.service: Failed with result 'exit-code'. I already found out that the problem might lie in the dbus communication, but I'm not sure how to fix it. Can anyone provide an insight? **Edit:** I solved the (harmless) warning related to XOAUTH2 with the following addition to the [Repository YOUR_ACCOUNT-remote] section as suggested by this forum thread . auth_mechanisms = LOGIN However, the problem is unrelated but to prevent confusion, I have updated the error above accordingly.
Ruben (159 rep)
Jun 9, 2016, 12:13 PM • Last activity: Mar 8, 2018, 04:34 PM
1 votes
1 answers
315 views
can we encrypt any field in offlineimaprc?
If you are using offlineimap to sync for example with gmail one can encrypt the password and use a python script to decrypt it on runtime. This is done via setting remotepass = passwd('gmail.gpg') in the offlineimaprc file, where passwd is a python function. Is the use of such python function restri...
If you are using offlineimap to sync for example with gmail one can encrypt the password and use a python script to decrypt it on runtime. This is done via setting remotepass = passwd('gmail.gpg') in the offlineimaprc file, where passwd is a python function. Is the use of such python function restricted to certain keys, like remotepass in the above example or could I theoretically use python function on the right hand side for every key? The reason why I'm asking is the following: I'm trying to encrypt other values for other keys as well. However, I get an error like: ERROR: While attempting to sync account 'gmail' ('http error', 401, 'Unauthorized', ) (configuration is: {'client_secret': "passwd('gmail_client_secret.gpg')", 'grant_type': 'refresh_token', 'refresh_token': "passwd('gmail_rf_token.gpg')", 'client_id': "passwd('gmail_client_id.gpg')"}) and I'm not sure if the function passwd really is executed. Running the python function in a python interpreter gives the correct results.
math (31 rep)
Oct 2, 2017, 06:42 AM • Last activity: Oct 3, 2017, 05:17 PM
1 votes
1 answers
687 views
offlineimap : How to prevent moved messages to be marked as new after synchronization?
I am using offlineimap 6.3.4 on a Debian system to synchronize my emails with two different IMAP servers (running Zimbra) and a MS Exchange server (through davmail). Everything is OK except the following. When I move a read message from folder Foo (ie. message in folder directory Foo/cur with a :2,S...
I am using offlineimap 6.3.4 on a Debian system to synchronize my emails with two different IMAP servers (running Zimbra) and a MS Exchange server (through davmail). Everything is OK except the following. When I move a read message from folder Foo (ie. message in folder directory Foo/cur with a :2,S extension) to folder Bar with my mailer (I check that it is indeed in Bar/cur with the :2,S extension) and run a synchronization the message appears as new again (ie. moved to Bar/new with :2, extension). This is very annoying as the new message list is always cluttered by already read mails that have just been moved to other folders. Is there any way to prevent this?
Olivier Capp&#233; (11 rep)
Jul 22, 2016, 07:49 AM • Last activity: Apr 29, 2017, 06:48 PM
1 votes
1 answers
435 views
Why is my offlineimap folderfilter not working?
I have a series of folders that I deleted from my SMTP server but they still exist on my local machine. I'd like to keep them from syncing to the server. The folders all follow a pretty basic naming pattern: INBOX.01 Domingo INBOX.02 Segunda ... INBOX.07 S&AOE-bado (You'll notice I'm also having tro...
I have a series of folders that I deleted from my SMTP server but they still exist on my local machine. I'd like to keep them from syncing to the server. The folders all follow a pretty basic naming pattern: INBOX.01 Domingo INBOX.02 Segunda ... INBOX.07 S&AOE-bado (You'll notice I'm also having trouble syncing accents, but that's a frustration I can live with for now.) grep "0[1-7] " matches the folders I care about and none that I don't care about, but I can't seem to tweak my .offlineimaprc to skip them. Here are a few things that I've tried: folderfilter = lambda folder: not re.search('0[1-7] ', folder) folderfilter = lambda folder: folder not in ['INBOX.01 Domingo'] But offlineimap --info | grep "0[1-7] " still indicates that it is trying to sync the folders, including INBOX.01 Domingo. What am I doing wrong here? How do I tell offlineimap to skip these directories?
Amanda (1818 rep)
Oct 4, 2016, 11:13 PM • Last activity: Oct 5, 2016, 11:45 PM
2 votes
1 answers
762 views
Systemd Service for Offlineimap + gpg encrypted PW's inside tmux works manually after system start but not autmoatically
## Short description, what i'm searching for: I want to have a detached tmux session automatically started as a systemd user service. Inside that, offlineimap should start and decrypt my login credentials. The graphical variant of pinentry should ask me for the password for decrypting my login crede...
## Short description, what i'm searching for: I want to have a detached tmux session automatically started as a systemd user service. Inside that, offlineimap should start and decrypt my login credentials. The graphical variant of pinentry should ask me for the password for decrypting my login credentials, when I attach to the session. For managing my login credentials, I want to use the program pass . ## What I've got so far: The desired Behavior works perfectly and reproducibly (starting from reboot), when i start the user service after I've logged into my system. But unfortunately it doesn't work when I do "symstemctl --user enable mail.service" and reboot: $ systemctl --user status mail ● mail.service - load offlineimap for all mail accounts inside tmux Loaded: loaded (/home/toogley/.dotfiles/systemd/user/mail.service; enabled; vendor preset: enabled) Active: inactive (dead) $ tmux attach-session -t mail can't find session mail I have no idea, what i could analyze or what might be the reason. Does somebody has tips how to address this issue? Thanks a lot! **My mail.service** Description=load offlineimap for all mail accounts inside tmux After=network.target graphical.target Requires=gpg-agent.service [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/tmux new-session -d -s mail -n dev 'export GPG_TTY=$(tty) && \ offlineimap' ExecStop=/usr/bin/tmux kill-window -t mail ExecReload=/usr/bin/kill -s USR1 $(pgrep offlineimap) [Install] WantedBy=graphical.target **my gpg-agent.service:** [Unit] Description=GnuPG private key agent IgnoreOnIsolate=true [Service] Type=forking ExecStart=/usr/bin/gpg-agent --daemon --homedir=%h/.gnupg ExecStop=/usr/bin/pkill gpg-agent Restart=on-abort [Install] WantedBy=default.target **My ~/.offlineimaprc** [general] accounts = dev ui = ttyui metadata = ~/.dev_offimap pythonfile=~/.dotfiles/mutt/accounts/decrypt.py [Account dev] synclabels = yes localrepository = dev-local remoterepository = dev-remote status_backend = sqlite autorefresh = 1 quick = 10 [Repository dev-local] type = Maildir localfolders = ~/mail/dev/ [Repository dev-remote] remotepasseval = get_pass("toogley@mailbox.org") ssl = yes type = IMAP remotehost = imap.mailbox.org remoteuser = toogley@mailbox.org sslcacertfile = /etc/ssl/certs/ca-bundle.crt keepalive = 60 holdconnectionopen = yes
uuu (762 rep)
Jun 5, 2016, 03:29 PM • Last activity: Jul 22, 2016, 11:50 PM
Showing page 1 of 20 total questions