I had installed Postfix Admin 2.3.5 on CentOS 6.2 and also the postfixadmin-cli from SVN so that I can add user accounts in bulk using a script. Running postfixadmin-cli at the command prompt gave the following error messages:
[PHP Warning: require_once(/var/www/html/postfixadmin-2.3.5/languages/.lang): failed to open stream: No such file or directory in /var/www/html/postfixadmin-2.3.5/common.php on line 48
Warning: require_once(/var/www/html/postfixadmin-2.3.5/languages/.lang): failed to open stream: No such file or directory in /var/www/html/postfixadmin-2.3.5/common.php on line 48
PHP Fatal error: require_once(): Failed opening required '/var/www/html/postfixadmin-2.3.5/languages/.lang' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/postfixadmin-2.3.5/common.php on line 48
Fatal error: require_once(): Failed opening required '/var/www/html/postfixadmin-2.3.5/languages/.lang' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/postfixadmin-2.3.5/common.php on line 48
I solved this problem by creating a symlink in the languages directory:
# ln -s en.lang .lang
So the above error messages were gone. But now when I run postfixadmin-cli, I get these new error messages:
PHP Fatal error: Class 'Config' not found in /var/www/html/postfixadmin-2.3.5/scripts/postfixadmin-cli.php on line 557
Fatal error: Class 'Config' not found in /var/www/html/postfixadmin-2.3.5/scripts/postfixadmin-cli.php on line 557
What is the work around for this error ?
Has someone been able to run postfixadmin-cli successfully ? Or is there any other option / script to add users in bulk through the command line ?
Thanks,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This sounds like you have 2.3.5 + only the scripts/ directory from trunk. Long story short: this won't work because the CLI depends on several files outside the scripts/ directory.
You need a complete checkout of SVN trunk to run the CLI.
If you want, you can keep the 2.3.5 web interface, but you'll have to run setup.php from SVN trunk once to do some database updates (which are backwards-compatible with 2.3.5).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes you are right. I only have the 2.3.5 and only the scripts from the trunk directory. Can I do a complete checkout on the SVN trunk and upgrade my existing setup to it ? I hope it is as stable and would not cause any issues.
Thanks,
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You found a bug - the mailbox CLI still used an outdated syntax of MailboxHandler, which (not surprisingly) failed.
Please update to latest SVN - it should be fixed there ;-)
Sidenote: Be warned that the CLI commandline syntax (especially for add) will probably change to something that is more flexible, but also more verbose/lengthly. (I don't know when this will happen - I need some free time to implement it, and free time is very rare ;-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
One more thing, I think while adding a mailbox if the domain does not exist, a new domain is created by the CLI. Is it possible to avoid that so that the mailboxes are created only for the domains which have already been created in postfixadmin ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Huh? The CLI does NOT auto-create domains - at least AFAIK.
If this really happens for you, can you please post the output of
./postfixadmin-cli domain view the_non_existing_domain
./postfixadmin-cli mailbox add # create a mailbox at the_non_existing_domain
./postfixadmin-cli domain view the_non_existing_domain
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I had installed Postfix Admin 2.3.5 on CentOS 6.2 and also the postfixadmin-cli from SVN so that I can add user accounts in bulk using a script. Running postfixadmin-cli at the command prompt gave the following error messages:
[PHP Warning: require_once(/var/www/html/postfixadmin-2.3.5/languages/.lang): failed to open stream: No such file or directory in /var/www/html/postfixadmin-2.3.5/common.php on line 48
Warning: require_once(/var/www/html/postfixadmin-2.3.5/languages/.lang): failed to open stream: No such file or directory in /var/www/html/postfixadmin-2.3.5/common.php on line 48
PHP Fatal error: require_once(): Failed opening required '/var/www/html/postfixadmin-2.3.5/languages/.lang' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/postfixadmin-2.3.5/common.php on line 48
Fatal error: require_once(): Failed opening required '/var/www/html/postfixadmin-2.3.5/languages/.lang' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/html/postfixadmin-2.3.5/common.php on line 48
I solved this problem by creating a symlink in the languages directory:
# ln -s en.lang .lang
So the above error messages were gone. But now when I run postfixadmin-cli, I get these new error messages:
PHP Fatal error: Class 'Config' not found in /var/www/html/postfixadmin-2.3.5/scripts/postfixadmin-cli.php on line 557
Fatal error: Class 'Config' not found in /var/www/html/postfixadmin-2.3.5/scripts/postfixadmin-cli.php on line 557
What is the work around for this error ?
Has someone been able to run postfixadmin-cli successfully ? Or is there any other option / script to add users in bulk through the command line ?
Thanks,
This sounds like you have 2.3.5 + only the scripts/ directory from trunk. Long story short: this won't work because the CLI depends on several files outside the scripts/ directory.
You need a complete checkout of SVN trunk to run the CLI.
If you want, you can keep the 2.3.5 web interface, but you'll have to run setup.php from SVN trunk once to do some database updates (which are backwards-compatible with 2.3.5).
Yes you are right. I only have the 2.3.5 and only the scripts from the trunk directory. Can I do a complete checkout on the SVN trunk and upgrade my existing setup to it ? I hope it is as stable and would not cause any issues.
Thanks,
As suggested, I did a complete checkout of SVN trunk and also ran the setup.php once. To test the program, I issued the command
# postfixadmin-cli mailbox add
and tried to add an email address for an existing domain. However, now I get the following error:
Notice: Undefined offset: 1 in /var/www/html/postfixadmin-svn/model/MailboxHandler.php on line 228
Error: This domain does not exist!
I checked it for a number of domains but I get the same error everytime.
You found a bug - the mailbox CLI still used an outdated syntax of MailboxHandler, which (not surprisingly) failed.
Please update to latest SVN - it should be fixed there ;-)
Sidenote: Be warned that the CLI commandline syntax (especially for add) will probably change to something that is more flexible, but also more verbose/lengthly. (I don't know when this will happen - I need some free time to implement it, and free time is very rare ;-)
Thanks for your help. Its working now.
One more thing, I think while adding a mailbox if the domain does not exist, a new domain is created by the CLI. Is it possible to avoid that so that the mailboxes are created only for the domains which have already been created in postfixadmin ?
Huh? The CLI does NOT auto-create domains - at least AFAIK.
If this really happens for you, can you please post the output of
./postfixadmin-cli domain view the_non_existing_domain
./postfixadmin-cli mailbox add # create a mailbox at the_non_existing_domain
./postfixadmin-cli domain view the_non_existing_domain