Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: Problems with PHP and imap-move

  1. #1
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Problems with PHP and imap-move


    I'm trying to copy email from one local dovecot imap server to another
    one, and trying to use a php script, imap-move, following the advice in
    this thread:

    App to move
    mail between imap servers?


    The script was obtained here

    Code:
    'IMAP Move - An email migration script'
    (http://edoceo.com/creo/imap-move)
    But I'm getting this error output:

    Code:
    
    > cer@minas-tirith:~> imap-move.php --help
    > arg: --help
    > Connecting Source...
    > PHP Notice:  Undefined index: host in /home/cer/bin/imap-move.php on line 129
    > imap_open({})
    > PHP Notice:  Undefined index: user in /home/cer/bin/imap-move.php on line 153
    > PHP Notice:  Undefined index: pass in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_open(): Couldn't open stream {} in /home/cer/bin/imap-move.php on line 153
    > Connecting Target...
    > PHP Notice:  Undefined index: host in /home/cer/bin/imap-move.php on line 129
    > imap_open({})
    > PHP Notice:  Undefined index: user in /home/cer/bin/imap-move.php on line 153
    > PHP Notice:  Undefined index: pass in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_open(): Couldn't open stream {} in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_getmailboxes() expects parameter 1 to be resource, boolean given in /home/cer/bin/imap-move.php on line 163
    > PHP Warning:  Invalid argument supplied for foreach() in /home/cer/bin/imap-move.php on line 164
    > PHP Notice:  Unknown: Can't open mailbox {}: invalid remote specification (errflg=2) in Unknown on line 0
    > PHP Notice:  Unknown: Can't open mailbox {}: invalid remote specification (errflg=2) in Unknown on line 0
    > cer@minas-tirith:~>

    I don't know if I have to install something else of php, or if there is
    some error in the script.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  2. #2

    Default Re: Problems with PHP and imap-move

    Carlos E. R. wrote:
    > I'm trying to copy email from one local dovecot imap server to another
    > one, and trying to use a php script, imap-move, following the advice in
    > this thread:
    >
    > App to move
    > mail between imap servers?

    >
    > The script was obtained here
    >
    >
    Code:
    > 'IMAP Move - An email migration script'
    > (http://edoceo.com/creo/imap-move)
    >
    >
    > But I'm getting this error output:
    >
    > [CODE]
    >> cer@minas-tirith:~> imap-move.php --help
    >> arg: --help
    >> Connecting Source...
    >> PHP Notice: Undefined index: host in /home/cer/bin/imap-move.php on line 129


    What makes you think it accepts a --help option? The documentation on
    the page you link to doesn't say it does. Neither does the code linked
    on github from that page. But the code doesn't match your error printout
    either. Where did you get the code? Have you tried using one of the
    example command lines?

  3. #3
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with PHP and imap-move

    On 2013-01-24 14:42, Dave Howorth wrote:
    > Carlos E. R. wrote:


    > What makes you think it accepts a --help option? The documentation on
    > the page you link to doesn't say it does. Neither does the code linked
    > on github from that page. But the code doesn't match your error printout
    > either. Where did you get the code? Have you tried using one of the
    > example command lines?


    It errors on any option or no option given.

    I got the code from that exact page.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 12.1 x86_64 "Asparagus" at Telcontar)

  4. #4

    Default Re: Problems with PHP and imap-move

    Carlos E. R. wrote:
    > On 2013-01-24 14:42, Dave Howorth wrote:
    >> Carlos E. R. wrote:

    >
    >> What makes you think it accepts a --help option? The documentation on
    >> the page you link to doesn't say it does. Neither does the code linked
    >> on github from that page. But the code doesn't match your error printout
    >> either. Where did you get the code? Have you tried using one of the
    >> example command lines?

    >
    > It errors on any option or no option given.


    Well, you're more likely to get correct results, or useful help, if you
    post the exact command and output that you used for a command that you
    expect to work, rather than the output when you give an unimplemented
    option. So let me follow up with a more explicit request.

    Please post the command and full output from one of the illustrated
    example commands.Use sensible option values.

    > I got the code from that exact page.


    You mean from http://cdn.edoceo.com/bin/imap-move.php I presume.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with PHP and imap-move

    On 2013-01-24 15:30, Dave Howorth wrote:
    > Carlos E. R. wrote:
    >> On 2013-01-24 14:42, Dave Howorth wrote:



    > Please post the command and full output from one of the illustrated
    > example commands.Use sensible option values.


    A normal program gives help on the syntax when you type it wrong. It
    doesn't error out saying things about wrong indexes or wrong arguments
    to php functions.

    Ok, this:

    Code:
    
    > cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@:PASS@localhost
    > Connecting Source...
    > imap_open({localhost/ssl})
    > PHP Warning:  imap_open(): Couldn't open stream {localhost/ssl} in /home/cer/bin/imap-move.php on line 153
    > Connecting Target...
    > PHP Notice:  Undefined index: host in /home/cer/bin/imap-move.php on line 129
    > imap_open({})
    > PHP Notice:  Undefined index: user in /home/cer/bin/imap-move.php on line 153
    > PHP Notice:  Undefined index: pass in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_open(): Couldn't open stream {} in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_getmailboxes() expects parameter 1 to be resource, boolean given in /home/cer/bin/imap-move.php on line 163
    > PHP Warning:  Invalid argument supplied for foreach() in /home/cer/bin/imap-move.php on line 164
    > PHP Notice:  Unknown: Can't connect to localhost,993: Connection refused (errflg=1) in Unknown on line 0
    > PHP Notice:  Unknown: Certificate failure for localhost: Server name does not match certificate: /C=ES/ST=Mobile/L=in_mobile/O=mine/OU=IMAP server/CN=minas-tirith.valinor/emailAddress=root@minas-tirith.valinor (errflg=2) in Unknown on line 0
    > PHP Notice:  Unknown: Can't open mailbox {}: invalid remote specification (errflg=2) in Unknown on line 0
    > cer@minas-tirith:~>


    >> I got the code from that exact page.

    >
    > You mean from http://cdn.edoceo.com/bin/imap-move.php I presume.


    Yes. It is in the firefox download history.

    Code:
    http://cdn.edoceo.com/bin/imap-move.php
    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  6. #6

    Default Re: Problems with PHP and imap-move

    Carlos E. R. wrote:
    > On 2013-01-24 15:30, Dave Howorth wrote:
    >> Carlos E. R. wrote:
    >>> On 2013-01-24 14:42, Dave Howorth wrote:

    >
    >> Please post the command and full output from one of the illustrated
    >> example commands.Use sensible option values.

    >
    > A normal program gives help on the syntax when you type it wrong. It
    > doesn't error out saying things about wrong indexes or wrong arguments
    > to php functions.


    I don't understand your attitude. You've downloaded some free software
    and you're trying to get it to work. But you don't seem to be trying
    very hard; you seem to be more interested in complaining to people who
    can't fix your complaint.

    > Ok, this:
    >
    > [CODE]
    >> cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@ASS@localhost
    >> Connecting Source...
    >> imap_open({localhost/ssl})
    >> PHP Warning: imap_open(): Couldn't open stream {localhost/ssl} in /home/cer/bin/imap-move.php on line 153


    So that seems a pretty clear message telling you it's not happy with
    your source argument. I don't know much about IMAP and nothing about
    this program, so I can't help you diagnose it, except to say that all
    their examples include a domain, whilst yours doesn't.

    It seems to me that you either try it with lots of random examples, or
    you read the program and see what it's looking for - UTSL!

  7. #7
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with PHP and imap-move

    On 2013-01-24 16:11, Dave Howorth wrote:
    > Carlos E. R. wrote:
    >> On 2013-01-24 15:30, Dave Howorth wrote:



    >> A normal program gives help on the syntax when you type it wrong. It
    >> doesn't error out saying things about wrong indexes or wrong arguments
    >> to php functions.

    >
    > I don't understand your attitude. You've downloaded some free software
    > and you're trying to get it to work. But you don't seem to be trying
    > very hard; you seem to be more interested in complaining to people who
    > can't fix your complaint.


    Because you are blaming me instead of the programmers for bad programming.

    >> Ok, this:
    >>
    >> [CODE]
    >>> cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@ASS@localhost
    >>> Connecting Source...
    >>> imap_open({localhost/ssl})
    >>> PHP Warning: imap_open(): Couldn't open stream {localhost/ssl} in /home/cer/bin/imap-move.php on line 153

    >
    > So that seems a pretty clear message telling you it's not happy with
    > your source argument. I don't know much about IMAP and nothing about
    > this program, so I can't help you diagnose it, except to say that all
    > their examples include a domain, whilst yours doesn't.


    Ok, but localhost is a domain. I'll try the full name ... same result.


    Code:
    
    > cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@:PASS@minas-tirith.valinor
    > Connecting Source...
    > imap_open({minas-tirith.valinor/ssl})
    > PHP Warning:  imap_open(): Couldn't open stream {minas-tirith.valinor/ssl} in /home/cer/bin/imap-move.php on line 153
    > Connecting Target...
    > PHP Notice:  Undefined index: host in /home/cer/bin/imap-move.php on line 129
    > imap_open({})
    > PHP Notice:  Undefined index: user in /home/cer/bin/imap-move.php on line 153
    > PHP Notice:  Undefined index: pass in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_open(): Couldn't open stream {} in /home/cer/bin/imap-move.php on line 153
    > PHP Warning:  imap_getmailboxes() expects parameter 1 to be resource, boolean given in /home/cer/bin/imap-move.php on line 163
    > PHP Warning:  Invalid argument supplied for foreach() in /home/cer/bin/imap-move.php on line 164
    > PHP Notice:  Unknown: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
    > PHP Notice:  Unknown: Retrying PLAIN authentication after [AUTHENTICATIONFAILED] Authentication failed. (errflg=1) in Unknown on line 0
    > PHP Notice:  Unknown: Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Authentication failed. (errflg=2) in Unknown on line 0
    > PHP Notice:  Unknown: Can't open mailbox {}: invalid remote specification (errflg=2) in Unknown on line 0
    > cer@minas-tirith:

    > It seems to me that you either try it with lots of random examples, or
    > you read the program and see what it's looking for - UTSL!



    Well, I expect that somebody that knows php can have a look at it and
    tell me if it is broken code, if I need to add more php modules, or what.

    IMO, the code is broken, it is calling PHP functions with wrong
    arguments, so there is no hope of having it run.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  8. #8

    Default Re: Problems with PHP and imap-move

    Carlos E. R. wrote:
    > On 2013-01-24 16:11, Dave Howorth wrote:
    >> Carlos E. R. wrote:
    >>> On 2013-01-24 15:30, Dave Howorth wrote:

    >
    >
    >>> A normal program gives help on the syntax when you type it wrong. It
    >>> doesn't error out saying things about wrong indexes or wrong arguments
    >>> to php functions.

    >> I don't understand your attitude. You've downloaded some free software
    >> and you're trying to get it to work. But you don't seem to be trying
    >> very hard; you seem to be more interested in complaining to people who
    >> can't fix your complaint.

    >
    > Because you are blaming me instead of the programmers for bad programming.


    No, I'm blaming you for complaining about error messages when you use a
    'function' that isn't implemented. There's nothing that compels a
    programmer to implement help; feel free to implement it yourself instead
    of complaining. You're misusing the program; you're lucky it doesn't
    segfault :-P

    >>> Ok, this:
    >>>
    >>> [CODE]
    >>>> cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@ASS@localhost
    >>>> Connecting Source...
    >>>> imap_open({localhost/ssl})
    >>>> PHP Warning: imap_open(): Couldn't open stream {localhost/ssl} in /home/cer/bin/imap-move.php on line 153

    >> So that seems a pretty clear message telling you it's not happy with
    >> your source argument. I don't know much about IMAP and nothing about
    >> this program, so I can't help you diagnose it, except to say that all
    >> their examples include a domain, whilst yours doesn't.

    >
    > Ok, but localhost is a domain. I'll try the full name ... same result.
    >
    >
    > [CODE]
    >> cer@minas-tirith:~> imap-move.php --fake -s imap-ssl://cer@ASS@minas-tirith.valinor
    >> Connecting Source...
    >> imap_open({minas-tirith.valinor/ssl})
    >> PHP Warning: imap_open(): Couldn't open stream {minas-tirith.valinor/ssl} in /home/cer/bin/imap-move.php on line 153


    No, I wasn't clear enough. AFAICT, all their examples look like

    imap-ssl://user@DOMAINassword@hostort/

    Yours looks like

    imap-ssl://user@assword@host

    You're missing DOMAIN, and also a port and a trailing slash. I have no
    idea which may be significant.

    >> It seems to me that you either try it with lots of random examples, or
    >> you read the program and see what it's looking for - UTSL!

    >
    > Well, I expect that somebody that knows php can have a look at it and
    > tell me if it is broken code, if I need to add more php modules, or what.
    >
    > IMO, the code is broken, it is calling PHP functions with wrong
    > arguments, so there is no hope of having it run.


    Well, IMO, there's no evidence to suggest it's broken. Cascading error
    messages are a fact of life when programs are taken outside their
    comfort zone. Reset your expectations.

    I think you'll do better if you assume that it does work and try to
    figure out how to give it correct arguments. Reading the code may help,
    even if you don't know PHP.

  9. #9
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Problems with PHP and imap-move

    On 2013-01-24 16:41, Dave Howorth wrote:
    > Carlos E. R. wrote:
    >> On 2013-01-24 16:11, Dave Howorth wrote:


    >
    > No, I wasn't clear enough. AFAICT, all their examples look like
    >
    > imap-ssl://user@DOMAINassword@hostort/
    >
    > Yours looks like
    >
    > imap-ssl://user@assword@host
    >
    > You're missing DOMAIN, and also a port and a trailing slash. I have no
    > idea which may be significant.


    I have also tried that, it gives the same error.


    >> IMO, the code is broken, it is calling PHP functions with wrong
    >> arguments, so there is no hope of having it run.

    >
    > Well, IMO, there's no evidence to suggest it's broken. Cascading error
    > messages are a fact of life when programs are taken outside their
    > comfort zone. Reset your expectations.


    No, I wont. I expect published code to at least sanitize the imput,
    verify what needs to be verified, and give useful user errors, not
    internal programming errors.

    I'm a coder that no longer codes, I expect no less.

    > I think you'll do better if you assume that it does work and try to
    > figure out how to give it correct arguments. Reading the code may help,
    > even if you don't know PHP.


    It doesn't, I tried.

    Either somebody that knows php tries to help me, or I give up.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 11.4, with Evergreen, x86_64 "Celadon" (Minas Tirith))

  10. #10
    Join Date
    Jul 2008
    Location
    Seattle, WA
    Posts
    17,063

    Default Re: Problems with PHP and imap-move

    On Thu, 24 Jan 2013 16:04:08 +0000, Carlos E. R. wrote:

    > It doesn't, I tried.
    >
    > Either somebody that knows php tries to help me, or I give up.


    Try contacting the author, but recognize as well that not everyone
    follows the same coding conventions (like implementing --help).

    Jim



    --
    Jim Henderson
    openSUSE Forums Administrator
    Forum Use Terms & Conditions at http://tinyurl.com/openSUSE-T-C

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •