|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
Hi!
I have postfix running and working as it should. I can add, remove and administer mailboxes and aliases using postfixadmin. All well there too. Now, I want to be able to add mailboxes and aliases using my own php-code. Therefore I studied the postfixadmin code (which is working), and it looked like the only thing needed was entries in the postfix database. Nevertheless, I must be missing something. My code adds the appropriate entries for the mailbox and alias, yet I can't log in and get an imap error. I also thought postfix added the appropriate directories automatically for the new mailboxes. What am I missing? Thanks! - Peder - |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
pyda001@ec.auckland.ac.nz wrote:
> Hi! > > I have postfix running and working as it should. I can add, remove and > administer mailboxes and aliases using postfixadmin. All well there > too. > > Now, I want to be able to add mailboxes and aliases using my own > php-code. Therefore I studied the postfixadmin code (which is working), > and it looked like the only thing needed was entries in the postfix > database. Nevertheless, I must be missing something. My code adds the > appropriate entries for the mailbox and alias, yet I can't log in and > get an imap error. I also thought postfix added the appropriate > directories automatically for the new mailboxes. What am I missing? > > Thanks! > > > - Peder - > Hi Peder, Are you issuing postmap & then postfix reload commands after you'd added the mailbox/alias? David. |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
Hi David!
Thanks for answering. No, I'm only adding the database entries. Could you tell me the best way to do a postmap and postfix reload in php? Should I set it up as a cron job or every time a user is added? I reccon we'll get a few new accounts every day, not more. Peder |
|
|
|
#4 (permalink) |
|
Messages: n/a
Hébergeur: |
pyda001@ec.auckland.ac.nz wrote:
> Hi David! > > Thanks for answering. No, I'm only adding the database entries. Could > you tell me the best way to do a postmap and postfix reload in php? > Should I set it up as a cron job or every time a user is added? I > reccon we'll get a few new accounts every day, not more. > > Peder > Hi Peder, I haven't tried personally, but php's exec command is probably what you are after (http://www.php.net/manual/en/function.exec.php) but you'll obviously need to confirm permissions will allow it. As to your cron job idea, only you can answer this. The idea itself is sound, it all depends on whether you're users are happy to wait for their account to be available (ie. wait for the cron job to have run) or whether they want/need it immediately (in which case a exec command in php would be the way to go). Good luck. David. |
|
|
|
#5 (permalink) |
|
Messages: n/a
Hébergeur: |
Nope, postmap and postfix reload didn't work. Must be something else
going on here. For others who might read this thread, the only thing I actually do is to add entries in the postfix database. I add a mailbox and an alias. is really appreciated. - Peder - |
|
|
|
#6 (permalink) |
|
Messages: n/a
Hébergeur: |
Looks like I finally stumbeled upon the answer to my own question:
Seems like postfix for some reason doesn't add the appropriate folders until a first message is received. Without it only an SMTP error is generated upon login. The solution is therefore to send a dummy/welcome message to the new mailbox. All should work from then on. - Peder - |
|
![]() |
| Outils de la discussion | |
|
|