This is an autogenerated patch header for a single-debian-patch file. The
delta against upstream is either kept as a single patch, or maintained
in some VCS, and exported as a single patch instead of more manageable
atomic patches.

--- gmailieer-1.2.orig/docs/index.md
+++ gmailieer-1.2/docs/index.md
@@ -237,7 +237,7 @@ the time being, `trash` will be prefered
 
 * `Trash` (capital `T`) is reserved and not allowed, use `trash` (lowercase, see above) to bin messages remotely.
 
-* `archive` is reserved and [not allowed](https://github.com/gauteh/lieer/issues/109). To archive e-mails remove the `inbox` tag.
+* `archive` or `arxiv` are reserved and not allowed; see [issue/109](https://github.com/gauteh/lieer/issues/109) and [issue/171](https://github.com/gauteh/lieer/issues/171). To archive e-mails remove the `inbox` tag.
 
 * Sometimes GMail provides a label identifier on a message for a label that does not exist. If you encounter this [issue](https://github.com/gauteh/lieer/issues/48) you can get around it by using `gmi set --drop-non-existing-labels` and re-try to pull. The labels will now be ignored, and if this message is ever synced back up the unmapped label ID will be removed. You can list labels with `gmi pull -t`.
 
--- gmailieer-1.2.orig/lieer/gmailieer.py
+++ gmailieer-1.2/lieer/gmailieer.py
@@ -605,7 +605,7 @@ class Gmailieer:
 
     if self.local.config.remove_local_messages:
       if self.limit and not self.dry_run:
-        raise argparse.ArgumentError ('--limit with "remove_local_messages" will cause lots of messages to be deleted')
+        raise ValueError('--limit with "remove_local_messages" will cause lots of messages to be deleted')
 
       # removing files that have been deleted remotely
       all_remote = set (message_gids)
@@ -717,9 +717,12 @@ class Gmailieer:
     # construct existing recipient address list from To, Cc, Bcc headers
     header_recipients = set()
     for field_name in ("To", "Cc", "Bcc"):
+      # get all field values for the given field
       field_values = eml.get_all(field_name, [])
-      field_addrs = map(lambda x: email.utils.parseaddr(x)[1], field_values)
-      header_recipients = header_recipients.union(field_addrs)
+
+      # parse these into a list of realnames and addresses
+      for (_, address) in email.utils.getaddresses(field_values):
+        header_recipients.add(address)
 
     if args.read_recipients:
       if not header_recipients.issuperset(cli_recipients):
--- gmailieer-1.2.orig/lieer/local.py
+++ gmailieer-1.2/lieer/local.py
@@ -53,6 +53,7 @@ class Local:
 
   ignore_labels = set ([
                         'archive',
+                        'arxiv',
                         'attachment',
                         'encrypted',
                         'signed',
@@ -404,9 +405,7 @@ class Local:
 
     for m in msgs:
       for fname in m.get_filenames ():
-        if not self.contains (fname):
-          print ("'%s' is not in this repository, ignoring." % fname)
-        else:
+        if self.contains (fname):
           # get gmail id
           gid = self.__filename_to_gid__ (os.path.basename (fname))
           if gid:
@@ -563,18 +562,17 @@ class Local:
       fname = os.path.join (self.md, 'cur', fname)
 
     if not os.path.exists (fname):
-      print ("missing file: reloading cache to check for changes..", end = '', flush = True)
-
-      self.__load_cache__ ()
-      fname = os.path.join (self.md, self.gids[gid])
-
-      print ("done.")
+      if not self.dry_run:
+        print ("missing file: reloading cache to check for changes..", end = '', flush = True)
+        self.__load_cache__ ()
+        fname = os.path.join (self.md, self.gids[gid])
+        print ("done.")
 
-      if not os.path.exists (fname):
-        if not self.dry_run:
+        if not os.path.exists (fname):
           raise Local.RepositoryException ("tried to update tags on non-existant file: %s" % fname)
-        else:
-          print ("(dry-run) tried to update tags on non-existant file: %s" % fname)
+
+      else:
+        print ("(dry-run) tried to update tags on non-existant file: %s" % fname)
 
     nmsg  = db.find_message_by_filename (fname)
 
--- gmailieer-1.2.orig/requirements.txt
+++ gmailieer-1.2/requirements.txt
@@ -1,4 +1,4 @@
 google-api-python-client
 oauth2client
 tqdm
-
+notmuch
--- gmailieer-1.2.orig/setup.py
+++ gmailieer-1.2/setup.py
@@ -69,7 +69,7 @@ setup(
     # your project is installed. For an analysis of "install_requires" vs pip's
     # requirements files see:
     # https://packaging.python.org/en/latest/requirements.html
-    install_requires=['oauth2client', 'google-api-python-client', 'tqdm'],
+    install_requires=['oauth2client', 'google-api-python-client', 'tqdm', 'notmuch'],
 
     # List additional groups of dependencies here (e.g. development
     # dependencies). You can install these using the following syntax,
