Skip to content

Commit 9dc8d74

Browse files
derekschrockopsec
authored andcommitted
mail/offlineimap3: Two-way synchronization of local Maildir and IMAP folders (new port)
OfflineIMAP is software that downloads your email mailbox(es) as local Maildirs. OfflineIMAP will synchronize both sides via IMAP. PR: 262233 Author: Derek Schrock <dereks@lifeofadishwasher.com> Reviewed by: koobs Differential Revision: https://reviews.freebsd.org/D34388
1 parent 8341f68 commit 9dc8d74

File tree

6 files changed

+166
-0
lines changed

6 files changed

+166
-0
lines changed

‎mail/Makefile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@
514514
SUBDIR += py-milter
515515
SUBDIR += py-notmuch
516516
SUBDIR += py-notmuch2
517+
SUBDIR += py-offlineimap3
517518
SUBDIR += py-postfix-mta-sts-resolver
518519
SUBDIR += py-premailer
519520
SUBDIR += py-pymailq

‎mail/py-offlineimap3/Makefile‎

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
PORTNAME= offlineimap3
2+
DISTVERSIONPREFIX= v
3+
DISTVERSION= 8.0.0-18
4+
DISTVERSIONSUFFIX= -g${GH_TAGNAME}
5+
CATEGORIES= mail python
6+
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
7+
8+
MAINTAINER= dereks@lifeofadishwasher.com
9+
COMMENT= Two-way synchronization of local Maildir and IMAP folders
10+
WWW= https://github.com/OfflineIMAP/offlineimap3
11+
12+
LICENSE= GPLv2
13+
LICENSE_FILE= ${WRKSRC}/COPYING
14+
15+
# setup.py requires these during build time. Possible move to setup/install_requires:
16+
# https://github.com/OfflineIMAP/offlineimap3/issues/110
17+
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}distro>=0:sysutils/py-distro@${PY_FLAVOR} \
18+
${PYTHON_PKGNAMEPREFIX}imaplib2>=3.5:mail/py-imaplib2@${PY_FLAVOR} \
19+
${PYTHON_PKGNAMEPREFIX}rfc6555>=0:mail/py-rfc6555@${PY_FLAVOR} \
20+
${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR}
21+
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}certifi>=2020.6.20:security/py-certifi@${PY_FLAVOR} \
22+
${PYTHON_PKGNAMEPREFIX}distro>=0:sysutils/py-distro@${PY_FLAVOR} \
23+
${PYTHON_PKGNAMEPREFIX}imaplib2>=3.5:mail/py-imaplib2@${PY_FLAVOR} \
24+
${PYTHON_PKGNAMEPREFIX}rfc6555>=0:mail/py-rfc6555@${PY_FLAVOR} \
25+
${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR} \
26+
${PYTHON_PKGNAMEPREFIX}urllib3>=1.25.9:net/py-urllib3@${PY_FLAVOR}
27+
28+
# Upstream doesn't have exact version currently only able to test up to 3.9 since
29+
# imaplib2 is 3.6-3.9.
30+
USES= pytest python:3.7-3.9
31+
32+
# Project is currently not publishing to pypi sdist. pypi/naming status:
33+
# https://github.com/OfflineIMAP/offlineimap3/issues/111
34+
USE_GITHUB= yes
35+
GH_ACCOUNT= OfflineIMAP
36+
GH_TAGNAME= 253f97a3e947
37+
38+
USE_PYTHON= autoplist concurrent distutils
39+
40+
CONFLICTS_INSTALL= mail/py-offlineimap
41+
42+
NO_ARCH= yes
43+
44+
PORTDOCS= *
45+
PORTEXAMPLES= offlineimap.conf
46+
47+
OPTIONS_DEFINE= DOCS EXAMPLES GSSAPI MANPAGES
48+
OPTIONS_DEFAULT= MANPAGES
49+
50+
COMMON_BUILD_DEPENDS= a2x:textproc/asciidoc \
51+
gmake:devel/gmake
52+
53+
DOCS_BUILD_DEPENDS= ${COMMON_BUILD_DEPENDS} \
54+
${PYTHON_PKGNAMEPREFIX}sphinx>=0:textproc/py-sphinx@${PY_FLAVOR}
55+
56+
GSSAPI_RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}gssapi>=1.6.9:security/py-gssapi@${PY_FLAVOR}
57+
58+
MANPAGES_BUILD_DEPENDS= ${COMMON_BUILD_DEPENDS}
59+
MANPAGES_PLIST_FILES+= man/man1/offlineimap.1.gz \
60+
man/man7/offlineimapui.7.gz
61+
62+
# In concurrent env. sphinx-build is only exist for py38 add "-${PYTHON_VER}" to command
63+
post-patch:
64+
cd ${WRKSRC} && \
65+
${REINPLACE_CMD} '/^SPHINXBUILD = sphinx-build$$/s/$$/-${PYTHON_VER}/' \
66+
docs/Makefile
67+
68+
post-build-DOCS-on:
69+
${MKDIR} ${STAGEDIR}${DOCSDIR}
70+
cd ${WRKSRC}/docs && ${GMAKE} docs && \
71+
cd html && \
72+
${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} \
73+
'! ( -name .lock -or -name .buildinfo )'
74+
75+
post-build-MANPAGES-on:
76+
${MKDIR} ${STAGEDIR}${MAN7PREFIX}/man/man7/
77+
${MKDIR} ${STAGEDIR}${MAN7PREFIX}/man/man1/
78+
cd ${WRKSRC}/docs && ${GMAKE} man && \
79+
${INSTALL_MAN} offlineimapui.7 ${STAGEDIR}${MAN7PREFIX}/man/man7/ && \
80+
${INSTALL_MAN} offlineimap.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/
81+
82+
post-install-EXAMPLES-on:
83+
${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
84+
${INSTALL_DATA} ${WRKSRC}/offlineimap.conf ${STAGEDIR}${EXAMPLESDIR}
85+
86+
pre-test:
87+
cd ${WRKSRC} && \
88+
${CP} test/credentials.conf.sample test/credentials.conf
89+
90+
.include <bsd.port.mk>

‎mail/py-offlineimap3/distinfo‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
TIMESTAMP = 1671226862
2+
SHA256 (OfflineIMAP-offlineimap3-v8.0.0-18-g253f97a3e947-253f97a3e947_GH0.tar.gz) = c1bcc5e18df029bf377dafbef38aeb651455238b60279e45aad2c81d2b95da0f
3+
SIZE (OfflineIMAP-offlineimap3-v8.0.0-18-g253f97a3e947-253f97a3e947_GH0.tar.gz) = 703329
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- offlineimap/imapserver.py.orig 2022-02-27 05:55:01 UTC
2+
+++ offlineimap/imapserver.py
3+
@@ -879,7 +879,7 @@ class IdleThread:
4+
while not success:
5+
imapobj = self.parent.acquireconnection()
6+
try:
7+
- imapobj.select(self.folder)
8+
+ imapobj.select(imaputil.foldername_to_imapname(self.folder))
9+
except OfflineImapError as e:
10+
if e.severity == OfflineImapError.ERROR.FOLDER_RETRY:
11+
# Connection closed, release connection and retry.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
--- test/tests/test_01_basic.py.orig 2022-03-04 03:43:46 UTC
2+
+++ test/tests/test_01_basic.py
3+
@@ -17,6 +17,8 @@ import unittest
4+
import logging
5+
from test.OLItest import OLITestLib
6+
7+
+import pytest
8+
+
9+
# Things need to be setup first, usually setup.py initializes everything.
10+
# but if e.g. called from command line, we take care of default values here:
11+
if not OLITestLib.cred_file:
12+
@@ -47,6 +49,7 @@ class TestBasicFunctions(unittest.TestCase):
13+
def tearDown(self):
14+
OLITestLib.delete_remote_testfolders()
15+
16+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
17+
def test_01_olistartup(self):
18+
"""Tests if OLI can be invoked without exceptions
19+
20+
@@ -60,6 +63,7 @@ class TestBasicFunctions(unittest.TestCase):
21+
"mails, but sync led to {0} folders and {1} mails"
22+
.format(boxes, mails))
23+
24+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
25+
def test_02_createdir(self):
26+
"""Create local 'OLItest 1', sync"""
27+
OLITestLib.delete_maildir('') # Delete all local maildir folders
28+
@@ -71,6 +75,7 @@ class TestBasicFunctions(unittest.TestCase):
29+
"mails, but sync led to {0} folders and {1} mails"
30+
.format(boxes, mails))
31+
32+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
33+
def test_03_createdir_quote(self):
34+
"""Create local 'OLItest "1"' maildir, sync
35+
36+
@@ -87,6 +92,7 @@ class TestBasicFunctions(unittest.TestCase):
37+
"mails, but sync led to {0} folders and {1} mails"
38+
.format(boxes, mails))
39+
40+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
41+
def test_04_nametransmismatch(self):
42+
"""Create mismatching remote and local nametrans rules
43+
44+
@@ -108,6 +114,7 @@ class TestBasicFunctions(unittest.TestCase):
45+
# Write out default config file again
46+
OLITestLib.write_config_file()
47+
48+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
49+
def test_05_createmail(self):
50+
"""Create mail in OLItest 1, sync, wipe folder sync
51+
52+
@@ -133,6 +140,7 @@ class TestBasicFunctions(unittest.TestCase):
53+
"assigned the IMAP's UID number, but {0} messages had no valid ID "
54+
.format(len([None for x in uids if x is None])))
55+
56+
+ @pytest.mark.skip(reason="skpping test needs remote auth")
57+
def test_06_createfolders(self):
58+
"""Test if createfolders works as expected
59+

‎mail/py-offlineimap3/pkg-descr‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
OfflineIMAP is software that downloads your email mailbox(es) as
2+
local Maildirs. OfflineIMAP will synchronize both sides via IMAP.

0 commit comments

Comments
 (0)