-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imap2gg uses port 993 instead of 143 #5
Comments
I found MailBoxUnencrypetd in imap_tools imported modified the script and got a different error: Error while interacting with the IMAP SERVER: ''MailBoxUnencrypted' object has no attribute '_criteria_encoder'' |
I found a workaround: put count = 1 and it worked. So: from imap_tools import MailBox Now to find a way to make it create labels for each folder. Thanks for the script. |
Great, ty for posting this workaround 👍 |
@rzmunch Hey, did you find a way to create labels for each folder? :) EDIT: Actually I have the exact same issue @XaviTorello - do you have an idea how I could tell it to use a different port? EDIT2: Actually no, I have the issue about |
I altered count = 1 as well, so it would actually start again. Then I changed the ImapImporter process like this: def process(self):
"""
Try to connect to the IMAP server, and try process all matched emails
"""
try:
with MailBox(self.server).login(
self.email, self.password
) as remote_mailbox:
for folder in remote_mailbox.folder.list():
print(folder["name"])
remote_mailbox.folder.set(folder["name"])
count = 1 #self.count_elements(remote_mailbox)
if (count == 0):
print(
"There are'nt emails to be processed",
f"with query '{self.query}'"
)
return
for an_email in tqdm(
remote_mailbox.fetch(self.query),
total=count,
desc='Processing emails'
):
try:
prep_str = an_email.obj.as_string()
esubindex = prep_str.find("Subject:")
esub = prep_str[esubindex-1:esubindex+20]
new_str = prep_str[:esubindex+8] + " [" + folder["name"] + "] " + prep_str[esubindex+8:]
an_email_str = new_str.encode('utf-8')
self.push_to_group(an_email_str)
except Exception as e:
self.handle_error(e, an_email.uid, an_email_str)
self.show_errors()
except Exception as e:
print(f"Error while interacting with the IMAP SERVER: '{e}'") This way all IMAP folders are iterated on and the IMAP folder name is prefixed to the Subject of the mail before uploading it. Sadly there seems to be no way to set a label with the google groups migration API. |
Another one with the same |
When I try to use it with my mailserver, I get this error:
Error while interacting with the IMAP SERVER: '[WinError 10061] No connection could be made because the target machine actively refused it'
Sniffing my packets, it uses IMAPS in the port 993, but I only have the port 143 (not encrypted).
I did try to use ip:port but it doesn't work ( '[Errno 11001] getaddrinfo failed' )
Thanks for your help.
The text was updated successfully, but these errors were encountered: