Aleksander Machniak
2013-01-17 8e8f3b96b51fde1df953de7398b15e0f01e10777
bin/msgimport.sh
@@ -17,7 +17,8 @@
// get arguments
$args = get_opt(array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file')) + array('host' => 'localhost', 'mbox' => 'INBOX');
$opts = array('h' => 'host', 'u' => 'user', 'p' => 'pass', 'm' => 'mbox', 'f' => 'file');
$args = rcube_utils::get_opt($opts) + array('host' => 'localhost', 'mbox' => 'INBOX');
if ($_SERVER['argv'][1] == 'help')
{
@@ -47,7 +48,7 @@
// prompt for password
if (empty($args['pass']))
{
   $args['pass'] = prompt_silent("Password: ");
   $args['pass'] = rcube_utils::prompt_silent("Password: ");
}
// parse $host URL
@@ -79,7 +80,7 @@
   $fp = fopen($args['file'], 'r');
   while (($line = fgets($fp)) !== false)
   {
      if (preg_match('/^From\s+/', $line) && $lastline == '')
      if (preg_match('/^From\s+-/', $line) && $lastline == '')
      {
         if (!empty($message))
         {