NNTP to IMAP duplicator

Diff
anonymous

Diff

Differences From Artifact [acf4f11a52]:

To Artifact [85cad86f7d]:


1
2
3
4
5
6
7
8
9

10







11
12
13
14
15
16
17
1
2
3
4
5
6
7
8
9
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24









+
-
+
+
+
+
+
+
+







#!/usr/bin/env python3.4

import configparser, email.utils, getpass, imaplib, nntplib, re, sqlite3, sys
imaplib._MAXLINE = 1024 * 1024
nntplib._MAXLINE = 1024 * 1024

config = configparser.ConfigParser(allow_no_value = True)
config.read('nntpdup.conf')

try:
server = nntplib.NNTP_SSL(config['connection']['newsserver'])
	server = nntplib.NNTP_SSL(config['connection']['newsserver'])
except nntplib.NNTPTemporaryError as err:
	if err.response.startswith('400 load at '):
		print(err.response)
		exit(0)
	else:
		raise(err)
mserver = imaplib.IMAP4_SSL(config['connection']['mailserver'])
reMessageId = re.compile('(<[-\][a-zA-Z0-9@.%/=_\$+!&~#\?}]+>)"?\)\)(\d+ \(FLAGS\(\)\))?$')
mserver.login(config['connection']['mail_user'], config['connection']['mail_password'])
if 'mail_limit' in config['connection']:
	mailLimit = int(config['connection']['mail_limit'])
else:
	mailLimit = 100