Problem with IMAP/POP3 after creating virtual user using the DA API (bug?)

Status
Not open for further replies.

totalsolve

New member
Joined
Jun 21, 2010
Messages
5
It seems making a POP account from the API slightly differs from making a POP account directly to the DA panel.

A little piece of the (PHP) API I used:

$sock = new HTTPSocket;
$sock->connect($IP, 2222);
$sock->set_login($gebruiker_id,$daNewpass);
$sock->query('/CMD_API_POP',
array(
'action' => 'create',
'domain' => $domain,
'user' => $pop3box,
'passwd' => $daNewpass,
'quota' => $quota,
)
);

$result = $sock->fetch_parsed_body();

I bet it has something to do with rights in /home/{username}/imap/{domain}/{pop3box}/Maildir folder, I got a warning from Mail Queue Administration (MQA) it say's:

2010-06-21 10:03:32 Received from [email protected] H=relay0.transip.nl [80.69.67.21] P=esmtp S=863 T="Testmessage from Microsoft Outlook"
2010-06-21 10:03:32 [email protected] R=virtual_user T=virtual_localdelivery defer (13): Permission denied: cannot chdir to /home/25037/imap/ikwileenglaasjewater.nl/test12112/Maildir
2010-06-21 10:09:26 [email protected] R=virtual_user T=virtual_localdelivery defer (13): Permission denied: cannot chdir to /home/25037/imap/ikwileenglaasjewater.nl/test12112/Maildir

Here I did manually

webserver# chmod 770 /home/25037/imap/ikwileenglaasjewater.nl/test12112/Maildir

which has 700 rights before I did (chown is 25037:mail, which is OK I guess).

After that I got this message after sending a new email.

2010-06-21 10:12:49 [email protected] R=virtual_user T=virtual_localdelivery defer (13): Permission denied: failed to open tmp/1277107969.H142067P49298.webserver.download2day.nl (10 tries)

Does it make a difference if I setup a pop account using the API or directly from the DA panel? Directly from the panel, there are no problems at all and I can receive all emails correctly.

I have used DA version 1.35.1 (latest version) and tried before with a earlyier version.

I hope someone can help me fix this small issue.

Edit: The server uses Dovecot
 
Last edited:
So it had 700 chmod owned by user:mail... When you create it via directadmin is the folder chmod 770 instead?
 
Yes, if I make the popbox directly from directadmin that folder is 770. Via the API it's set to 700. Folder owner is in both cases the same.

Jordy
 
I would guess its a bug in the api then. I would email directadmin support to see if they know about it so it can be fixed and point them to this thread.
 
Thank you, I've wrote a email to DirectAdmin support. Hopefully they'll have a solution for this :)
 
Hello,

The API code uses the same code that the normal interface does. It looks to me like a minor permission error.

Type:
Code:
cd /usr/local/directadmin/scripts
./set_permissions.sh email
John
 
Thank you John, do I have to do that every hour using cron? Or is it ok if I do this just once? Will there be a fix in a later version of DirectAdmin?

Since I use the API with a reason, which is to automate a process of making email accounts.

Jordy
 
Hello,

It's likely a one-time permission fix. The creation of email accounts is a very common task, and this is not a common error... so it's likely just a permission issue on one of the folders above the account. The one-time fix should resolve it for you assuming my assumption is correct.

John
 
OK, I think it's one time, just to be sure I will run the script once a week. I tried to make a popbox via the API and it worked correct this time, thanks!

You can close the topic :)
 
Status
Not open for further replies.
Back
Top