File: mk_root_mailbox.php

package info (click to toggle)
dtc 0.35.5-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 18,824 kB
  • sloc: php: 50,739; sh: 8,596; makefile: 572; perl: 148; xml: 25
file content (24 lines) | stat: -rw-r--r-- 510 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env php

<?php

        $base_path = dirname(__FILE__);

	if ($_SERVER["argc"] < 1) {
		print "Syntax Error: ".$_SERVER["argv"][0]." <root domain>\n";
		exit;
	} 

	$root_domain = $_SERVER["argv"][1];

	require($base_path.'/../../shared/cyradm.php');
	require($base_path.'/../../shared/cyrus.php');

	# login to cyradm
	$cyr_conn = new cyradm;
	$error=$cyr_conn -> imap_login();
	if ($error!=0){
		die ("imap_login Error $error");
	}
	$result=$cyr_conn->createmb("user/root" . "@".$root_domain);
?>