CFMAIL error: This operation is not allowed on a closed folder - gmail

We have a script that checks a Gmail inbox for new messages, processes any it finds based on the subject and sender, marks said messages read, and then after processing moves the messages to a folder called "ProcessedMessages". This script has been running for several years without incident.
We recently migrated to Azure, and this script began failing on the last command:
<cfimap action="movemail"
connection="myConnection"
MessageNumber="#x#"
newfolder="ProcessedMessages">
This line started generating this error every night:
The cause of this exception was: java.lang.IllegalStateException: This operation is not allowed on a closed folder.
I'm not sure what a closed folder is, but we have tried:
Closing any Gmail browser window on any computer logged in as this account.
Running the process manually by hitting the url to make sure the task scheduler wasn't the problem.
Running the process from a browser window on the server itself pointing to it's own IP to make sure the new CF cluster wasn't causing the problem.
Looking around Gmail for some sort of 'closed' flag associated with a folder
Moving the messages from the inbox to that folder via the Gmail web interface to make sure there wasn't an account problem (it worked fine)
No changes were made to this Gmail account since the switchover to Azure; in fact no one had even logged into it for at least a month before. The username and password are set correctly on the new Azure server, as evidenced by the fact the script can log in and read message and mark them read.
What does this error message mean and what could cause it?

This is what I found (same issue):
"A common cause of this kind of issues is that the folder is being modified concurrently using the same account and credentials thus leaving the operations in an inconsistent state." from here:
https://help.mulesoft.com/s/article/Intermittent-IMAP-S-error-This-operation-is-not-allowed-on-a-closed-folder
In my case, it's running every 15 seconds, on 3 different email folders, so it would make sense.
I hope this clarifies the reasons for the issue.

Related

Is it possible to configure an IMAP account in Thunderbird with a different domain on the address and the server?

I have an email address provided and managed by OVH (French ISP)
I'm trying to configure the account in Thunderbird (which I've been using with multiple accounts, including Gmail over IMAP, for years with great satisfaction). It's version 91.8.0 in Debian 11.3. No fancy tweaking or whatever.
I followed the instruction from my ISP (https://docs.ovh.com/fr/emails/configuration-email-configuration-pour-thunderbird/) - ok, it's a guide for the windows version, but that shouldn't be an issue.
The thing is, my address is like contact#somedomain.fr, but the mail server is ssl0.ovh.net.
I'm sure the password is correct, but when I go and validate the settings, Thunderbird tries to check the password, and it gets stuck there.
I noticed in the status bar that Thunderbird is actually trying to reach contact#somedomain.fr#ssl0.ovh.net... That must be (part of) the issue.
I tried to go to Advanced settings (so it creates the accounts and sends me to the account settings page), and there Thunderbird changes the actual server (which should be ssl0.ovh.net) to the email account's domain (somedomain.fr in my example)... Ain't that weird ? (also, it seems not to be able to determine the server type which remains empty, and most dropdown options, like authentication methods, are empty, or rather there are no labels).
Has anyone ever run into such an issue, and better yet, solved it ;-) ?
(not sure if the cross-domain tag is relevant)
Edit 2022-05-03 :
After many tests, still not working, but I have dug a little deeper.
I've set up the account manually with "Advanced configuration" so it doesn't try to check the password.
In the Folders panel, the account has no name and only a sub-folder named INBOX.
When I try to browse this INBOX folder, I get an error :
Unable to open the summary file for INBOX on contact#somedomain.fr. Perhaps there was an error on disk, or the full path is too long.
Running Thunderbird in full debug mode from CLI :
thunderbird --safe-mode --jsconsole --verbose
In the shell, from the verbose mode, I get this error repeatedly :
IPDL protocol error: Handler returned error code!
###!!! [Parent][DispatchAsyncMessage] Error: PClientManager::Msg_ForgetFutureClientSource Processing error: message was deserialized, but the handler returned false (indicating failure)
But I don't think this is related to my problem.
However in the JS console, I get an interesting message :
gloda.index_msg: Problem entering folder: INBOX, skipping. Error was: undefined:659: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIMsgFolder.msgDatabase]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: resource:///modules/gloda/IndexMsg.jsm :: _indexerEnterFolder :: line 659" data: no]
Now, where do I go from here ?

Git Lab: How to get issues by user id without authentication

Following the GitLab Api Documentation i can't found a solution to my problem.
Need to get every open issue and closed issues from up to 2 days ago using GitLab api, preferably grouping them by the user whom has the issue assigned.
The solution right now its doing a request to bring all the groups from the gitlab, and do a request for each group to bring its issues closed and open, select only the closed ones from 2 days ago, then get all the users from gitlab and start comparing who has assigned which issue (most urgent change its that "getting every single one closed issue" since request can take a lot).
GitLab api appears to be able to bring issues created or asignated to the authenticated user, but still doesnt bring issues created by other users (even when i'm using an admin key to authenticate the api requests)
You are correct that it is not possible to request all issues at once, but it is possible to request issues on behalf of other users.
For this there is the sudo parameter. This parameter you can use to impersonate any user as long you are a admin.
https://docs.gitlab.com/ee/api/README.html#sudo

Outlook REST API - getFolders not returning all folders

I'm just getting started with the Outlook REST API. My baseline is the tutorial that uses node-outlook.
First order of business is to retrieve all of the folders in my mail account.
So I issue this REST request:
GET https://outlook.office.com/api/v2.0/Me/MailFolders
Instead of returning all of my folders, it only returns the "well known" folders:
Clutter
Deleted Items
Drafts
Inbox
Junk Email
Outbox
Sent Items
Trash
Am I missing a query parameter or something that says, "no, really, all of them please"?
UPDATE
I tried a different email account, and I also don't get all of my actual folders, but I get a different subset (some of which are well-known, others aren't).
I am implementing the paging protocol (using the #nextLink parameter) so it's not a matter of page sizes. I am getting these 8 folders on one account, and 18 folders on another.
So there must be something that decides what folders will be returned.
UPDATE 2
I changed to doing a folder sync instead using the "beta" API. In this case, I also get an unnamed folder in the list, which is the parent of the other folders. It comes along with a ChildFolderCount which is accurate. However, when I do a child folder request on that folder id I get the same list.
UPDATE 3
Here's the request url I'm using when I attempt to read the child folders of the one folder that comes back with a non-zero ChildFolderCount.
GET https://outlook.office.com/api/beta/Me/MailFolders/AAMkADRmMzFmNjZmLWU3MjctNGZiNi1iZTg4LTRmNGQwYTVhMDgxYgAuAAAAAAB8IxaZ5KGbQom4EPywGCSdAQDVy0eYwAzLS63k5pohzykCAAAAAAEJAAA=/childfolders
Here's what appears to define what folders are returned by this API and what are not:
If I create a folder in office365 directly on outlook webmail, it shows up in this query.
If I create a folder in Mac Mail, it does not.
Mac Mail accesses the service using EWS, so I would expect a folder created by it would be like any other folder.
So there is something about folders created on Mac Mail that prevents them from being returned by this API.
Folders created in Mac Mail DO show up in web mail and vice versa.
Folders created on an iPhone DO show up, so in my limited testing it looks like Mac Mail may be the only app suffering from this problem. The problem I have is most of my folders were created in Mac Mail and I have no easy way of rebuilding them.
I'm thinking this is just a BUG in the API. At any rate, this answers my original question and should help anyone out there trying to use the new API.
If I find a workaround I'll post it here.

Twilio SMS with links - links being clicked automatically?

I have an app that sends SMS's out to a bunch of people. Those messages contain links. They are not using any link shorteners or any other service. They link back to my site. The links themselves are randomized strings, which are stored in my db, which are associated with an action. (Click "yes" or "no" link and the db tracks what you chose.) For ALL users, this works perfectly. With one user - and it's always the same user, as soon as the cron job runs, which triggers this event, his "vote" comes in. This is without him clicking or even seeing the message sometimes.
So, the question: has anyone ever seen or heard of a cell provider or a messaging app or similar that "clicks" links as part of some process before sharing the content with the user? I can't see ANYTHING in the code that would single him out so I'm thinking it has to be something in between when the message goes out and he does what he does. Especially because the timestamp is also always within seconds of the cron job running.
Sending an SMS can sometimes go through multiple carriers before reaching an end destination. As such, providers may be "handling" the content in this case.
The best thing to do would for any cases of this in the future would be to write support for further investigation.

Intuitive Website owner verification

Hello I'm developing a web app where the user needs to verify that they are the "Owner" of the website. I know there is code verification but how would I check if that verification is on their site without over complicating the verification method?
Also, I'm thinking about giving the site owner an hour to verify, how would I automatically detect if the hour is over and be able to delete them from the database?
The way Google or Yahoo do this is to require the webmaster to create a file with a special cryptic name (the file length can be 0), which is generated by Google/Yahoo. Could be something like "dsaa6fd4sgfdsf324gd.html". So you generate such a unique (name) string for each websit eto be verified, store it in the DB, and then you go and try to GET it from that site. If the GET succeeds you can set "verified=true" in the DB for that site and file name.
To answer the 1hr question we'd have to know what technology you are using. There are many options to run timed background jobs from a web application. Usually you write the job details into the database, and have a background daemon check the DB periodically and execute any pending jobs. You could tell it (that daemon) to execute a job one hour later to see if the file (see above) exists. Well, you have to do it that way in any case, it's no use simultaneously telling the webmaster to create that file and check for it right away :)

Resources