Getting Mailbox doesn't exist for existent mailbox - imap

I am facing a weird issue where a mailbox is being shown in the LIST command but when I select it, it says "Mailbox doesn't exist". I am also allowed to select the child folder.
x login <email> <pwd>
x OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE SNIPPET=FUZZY NOTIFY METADATA QUOTA] Logged in
x list "" "*"
* LIST (\HasChildren) "/" ABC
* LIST (\HasNoChildren \UnMarked) "/" ABC/aaa
* LIST (\HasChildren \UnMarked) "/" Spam
* LIST (\HasChildren) "/" INBOX
* ... other mailboxes
x OK List completed (0.026 + 0.000 + 0.025 secs).
Selecting ABC mailbox gives mailbox doesn't exist, but not for it's child folder:
x SELECT "ABC"
x NO Mailbox doesn't exist: ABC (0.006 + 0.000 + 0.005 secs).
x SELECT "ABC/aaa"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANEN....
Selecting Spam or INBOX or any other folder works:
x SELECT "Spam"
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
* OK [PERMANENTFLAGS (\Answered \Flagged \Delete
x SELECT "INBOX"
* OK [CLOSED] Previous mailbox closed.
* FLAGS (\Answered \Flagged \Deleted \Seen \Draft $Forwarded $cl_1 $cl_2)
* OK [PERMANENTFLAG...
Can someone help me to understand what is happening?

As shown on imapwiki.org, you should avoid using the * wildcard, so you should use 1 LIST "" % instead of 1 LIST "" *
As well as this, LIST is a loosely defined command, and will often produce duplicates when using 1 LIST "" *. Using 1 LIST "" % fixes this issue.

Related

Can Flux of Project Reactor process messages one by one

I'm trying to process a list of numbers, for example, 1 to 10, one by one using Reactor Flux, and there is an API /double which simply double the incoming Integer (1 -> 2, 4 -> 8...) ,however this API has performance issue, it always takes 2 seconds to response the result.
When using limitRate(1) what I expected is Reactor processes requests one after another as following:
2020-01-01 00:00:02 - 2
2020-01-01 00:00:04 - 4
2020-01-01 00:00:06 - 6
2020-01-01 00:00:08 - 8
2020-01-01 00:00:10 - 10
...
But actually Reactor fires all requests at once:
2020-01-01 00:00:02 - 6
2020-01-01 00:00:02 - 10
2020-01-01 00:00:02 - 2
2020-01-01 00:00:02 - 4
2020-01-01 00:00:02 - 8
...
Here is the code
Flux.range(1, 10).limitRate(1)
.flatMap(i -> webClient.get().uri("http://localhost:10001/double?integer={int}", i).exchange()
.flatMap(resp -> resp.bodyToMono(Integer.class)))
.subscribe(System.out::println);
Thread.sleep(10000);
Seems limitRate is not working as I expected, what went wrong? Is there any way to process requests one after another using Reactor? Thanks in advance.
.flatMap doesn't work here as it subscribes to the inner streams eagerly - that is, it won't wait for an inner stream to emit an onComplete before subscribing to the next stream. This is why all of your calls are made concurrently. It works in the receive->dispatch->receive->dispatch mode.
Reactor provides an overloaded version of flatMap where you can specify the concurrency factor as .flatMap(innerstream, concurrency). This factor caps the number of streams flatMap will subscribe to. If it is say 5, flatMap can subscribe to at most 5 inner streams. As soon as this limit is hit, it has to wait for an inner stream to emit onComplete before it subscribes to the next one.
In your case, you can either set it to 1 or use .concatMap(). concatMap() is exactly flatMap with concurrency = 1. It'll basically works in the receive->dispatch->wait->receive->dispatch->wait mode.
I wrote a post some time back explaining exactly how flatMap works, because I think a lot of people use it without understanding its internals. You can refer to the article here
Consider to use a concatMap instead:
/**
* Transform the elements emitted by this {#link Flux} asynchronously into Publishers,
* then flatten these inner publishers into a single {#link Flux}, sequentially and
* preserving order using concatenation.
* <p>
* There are three dimensions to this operator that can be compared with
* {#link #flatMap(Function) flatMap} and {#link #flatMapSequential(Function) flatMapSequential}:
* <ul>
* <li><b>Generation of inners and subscription</b>: this operator waits for one
* inner to complete before generating the next one and subscribing to it.</li>
* <li><b>Ordering of the flattened values</b>: this operator naturally preserves
* the same order as the source elements, concatenating the inners from each source
* element sequentially.</li>
* <li><b>Interleaving</b>: this operator does not let values from different inners
* interleave (concatenation).</li>
* </ul>
*
* <p>
* Errors will immediately short circuit current concat backlog.
*
* <p>
* <img class="marble" src="doc-files/marbles/concatMap.svg" alt="">
*
* #reactor.discard This operator discards elements it internally queued for backpressure upon cancellation.
*
* #param mapper the function to transform this sequence of T into concatenated sequences of V
* #param <V> the produced concatenated type
*
* #return a concatenated {#link Flux}
*/
public final <V> Flux<V> concatMap(Function<? super T, ? extends Publisher<? extends V>>
mapper) {
Pay attention to the sequentially and preserving order using concatenation. phrase. Seems for me what you are looking for.
Inspired by Artem Bilan's answer, I found flatMapSequential is a better for my case, since the flatMapSequential accepts second parameter as maxConcurrency, so that it is possible not to process messages one by one but twice a time and etc.
Thanks Artem Bilan and Prashant Pandey for your answers, really helped.

How do I load a csv file into actian table?

The "copy" command is successful, but junk data is loaded into the table.
"vwload" command errors out with a message "No table name specified".
How do I load a csv file into actian table?
* COPY TABLE airport2 () FROM '/tmp/head.csv' \g
* select * from airport2\g
qqqqqqqqqqqqqqqqqqqqqqqqqqqj
(1 row)
continue
$ /opt/Actian/VectorVW/ingres/bin/vwload –f "," –q "\"" –s 1 –l t1.log –t airport1 test /tmp/head.csv
No table name specified
Usage: vwload [options] database file ...
Try vwload --help
Update
This copy command does not complete. It shows "Excuting..." but there is no response after that, I have to kill the session.
$ /opt/Actian/VectorVW/ingres/bin/sql test
continue
* copy table airport2 (
* m1 = char(0) comma,
* d1 = char(0) comma,
* s1 = char(0) comma,
* m2 = char(0) comma,
* m3 = char(0) comma,
* sent_date = char(0) comma,
* stat = char(0) comma,
* done_date = char(0) comma,
* params_err = char(0) nl)
* from /tmp/head.csv \g
Executing . . .
There is no such thing as an 'actian table'. Action is a company which has bought several databases. (https://www.actian.com/product-overview/)
Unfortunately they do no make things easy, but you seem to be using 'ACtian X' (https://www.actian.com/data-management/actian-x-hybrid-rdbms/), or an older version of that.
The documentation is one thing they have!, It's available online, search their website ...

Active Choice Reactive Parameters with Parameterized Scheduler

I have some parameterized build in Jenkins with several Active Choice Reactive Parameters: par1, par2.
par1 is defined by combo, and par2 value depends on par1:
switch (par1) {
case 'value1': return 'test1'
case 'value2': return 'test2'
default: return 'test'
}
It works fine for manual trigger, but fails if I try to use parameterized shedule trigger:
H * * * * %par1=value1
Is it possible to solve this issue somehow?
Your input for periodic is supposed to run per hour (1).
Change this H * * * * %par1=value1 to either * * * * * every minute OR H/1 * * * * (1 hour) or H/2 * * * * (every 2 minutes). yea, it's kind of confusing when you use 1 it makes it one hour vs 1 minute (with H/1)
Also, make sure your par2 (Groovy code section within Active choice reactive parameter) is handling cases where par1 is not just a single value (test1) i.e. it can be test1,test2,test3,... when a user would have selected multiple values for par2 parameter (if it is a Multiple Select type).

Can we create the targets at run time using informatica Powercenter

When we do not know the number of targets, Can we create the targets at run time using informatica Powercenter.
Suppose we have below source:
Employee:
Dept_ID EmpName Sal
10 A 200
11 B 100
10 C 200
10 D 400
12 E 500
12 F 400
...
It can have any number of distinct Dept_ID.
I want to load all EmpName and Sal of a particular Dept_ID into a separate target table (i.e target name should be as Tar_10 or Tar_11 where 10 & 11 are Dept_ID).
You can achieve this by the following method:
While creating the target check the include file name port checkbox.
Use an expression to create the file name port name, something like " 'Tar' || Dept_ID" should do.
Use a sorter to sort your input with respect to Dept_ID.
Use a transaction control transformation on the condition that when Dept_ID is different from previous Dept_ID use "TC_COMMIT_AFTER", this will keep changing the file name depending on your input.
Your Output will look like this :
TAR_10
10 A 200
10 C 200
10 D 400
TAR_11
11 B 100
TAR_12
12 E 500
12 F 400
Yes Sumit is right. You can achieve this by creating the File name port and Transaction control. Also if your target is file then you can write the whole record in 1 port so there is no need to worry about the target structure either.

Schedule nightly 22-03 build using Jenkins and H, the "hash symbol"

A build that takes about three hours to complete needs to be scheduled for nightly building outside office hours: not sooner than 22:00 and not later than 3:59 next day.
I'd also like to use the "H symbol" to avoid collision with future nightly builds. From in-line help in Jenkins:
To allow periodically scheduled tasks to produce even load on the system, the symbol H (for “hash”) should be used wherever possible. For example, using 0 0 * * * for a dozen daily jobs will cause a large spike at midnight. In contrast, using H H * * * would still execute each job once a day, but not all at the same time, better using limited resources.
(How) can I schedule this using Jenkins? What I've tried was all considered invalid by Jenkins:
H H(22,23,0,1,2,3) * * *
Invalid input: "H H(22,23,0,1,2,3) * * *": line 1:7: expecting "-", found ','
H H22,23,0,1,2,3 * * *
Invalid input: "H H22,23,0,1,2,3 * * *": line 1:4: unexpected token: 22
H H(22-3) * * *
Invalid input: "H H(22-3) * * *": line 1:9: 1 is an invalid value. Must be within 1
and -18
Is it possible to achieve this without using plug-ins?
I think the closest you will get is to use:
H H(0-3) * * * This will run at some point between 0:00 and 3:59
#midnight This will run at some point between 0:00 and 2:59
The H(4-8) construct only works if the second items is larger then the first.
But you might as well fill in the hour yourself. Jenkins actually never changes the hour the jobs runs once it is set. It will basically create some random hour once you save the job and always run the job at that particular time.
Of course, you can also file a bug report or feature request that you should be able to specify this as H(22-3) or better, fix the code and submit a patch ;)
There is no direct support to write the expression like this, but since there is timezone support (now), you can work around this.
# DONT COPY PASTE - THIS DOESNT WORK!
# This is what we would like to write, but is not supported
H H(22-3) * * *
Above expression means we want to build somewhen between 22 PM and 3 AM, this is a 5 hour period, so we could write:
# Assuming we're in GMT+2 we can just shift the timezone
# so 22-03 becomes 10-15 wich is 12 hours earlier so the
# timezone is GMT-10
TZ=Etc/GMT-10
H H(10-15) * * *
I found this workaround in the comments of JENKINS-18313
UPDATE:
There is currently a bug JENKINS-57702 and the timezone GMT-XX is not evaluated correctly. A workaround is to use a equivalent timezone, in this example the one for Hawaii:
TZ=US/Hawaii
H H(10-15) * * *

Resources