dk / Net-Eboks

perl API for eboks.dk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pincode not accepted for shares

tkrunning opened this issue · comments

I'm trying to access the mailboxes of two associated companies. I've upgraded the Net-Eboks version to the dev version from Github and have found the Share IDs by running eboks-dump -l.

However, when I try to run either eboks-dump --output company1.mbox --cpr XXXXXX-XXXX:* or eboks-dump --output company1.mbox --cpr XXXXXX-XXXX:123456 (XXXXXX-XXXX being my CPR and 123456 the share ID from the previous step) I get the error error: Pincode not accepted.

I'm using the same code as for my main inbox, eboks-dump --output personal.mbox --cpr XXXXXX-XXXX works perfectly.

Initially, when running the command with the * operator, I was getting zsh: no matches found errors, but I ran setopt +o nomatch to solve that.

My OS is MacOS 12.3.1 (21E258).

Any idea what's going on? Simple user error or something else?

Luckily I found a workaround (by using --share "COMPANY NAME ApS", but figured I'd file this issue in case other people run into the same problem. Is the command listed in the readme no longer valid?

EDIT: The above workaround only worked for one of my companies. The other fails with the error Cannot find share 'Company2 Name ApS'. Note: this company has a digit in its name, other than that I can't think of any meaningful difference between this and the other company.

That's correct, cpr XXXXX-XXXX:* format is not accepted by eboks-dump, only by eboks2pop; you correctly guessed that --share SHARENAME is needed instead

Ok, gotcha. However, any idea why it's not working for my company with a digit in its name?

No idea, the finding of a share is rather straightforward, the script loops the share list in a rather primitive fashion, and the list is the same as shown with -l. You can try to print debugs in the eboks-dump, I'm fairly sure this is either some shell expansion or a typo

Like f ex * from command line will always get expanded, you'll need either \* or '*' for this

I got it working by commenting out these lines:

		if ( $opt{share} ne '0' && !$found) {
			die "Cannot find share '$opt{share}'\n";
		}

I sent you some more details via email as it contains personal information, in case that's helpful.

My (unqualified) guess—I have no experience with Perl—is that it's checking each share name with the passed share parameter. Since this was the second share in the list, it seems it exits out of the loop when it doesn't match the first one.

hmm yes you're right - try to see if this one helps?

Yep, that fixed it!