The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php mail() error: Undefined subroutine &main::maskdir

Discussion in 'E-mail Discussions' started by Jim Huang, May 29, 2016.

  1. Jim Huang

    Jim Huang Registered

    Joined:
    May 29, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    cPanel Access Level:
    Website Owner
    php mail() function suddently give this error last few days.
    I have tried these:
    cp /etc/exim.pl /etc/exim.pl.bak
    cp -rpf /etc/exim.pl.local /etc/exim.pl
    /scripts/buildeximconf
    service exim restart

    exim -bt -d-resolver *****@gmail.com

    tail -f /var/log/exim_mainlog

    2016-05-30 03:05:33 cwd=/home/*****/public_html/m3 3 args: /usr/sbin/sendmail -t -i
    2016-05-30 03:05:34 1b7Be9-0004bF-TY <= *****@*****.com U=***** P=local S=939 T="***** new password" for ******@hotmail.com
    2016-05-30 03:05:34 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1b7Be9-0004bF-TY
    2016-05-30 03:05:34 1b7Be9-0004bF-TY SMTP connection outbound 1464570334 1b7Be9-0004bF-TY *****.com *****@*****.com
    2016-05-30 03:05:34 1b7Be9-0004bF-TY == *****@*****.com R=lookuphost defer (-1): lookuphost router failed to expand add_headers item "NULL": Undefined subroutine &main::maskdir called at /etc/exim.pl line 1132.\n
     
  2. g-force

    g-force Member

    Joined:
    Jun 24, 2006
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    A client of mine notified me that all emails sent from PHP were failing. After investigation, I found I had the same error as above. I tried the following :

    /scripts/upcp --force
    /scripts/buildeximconf
    service exim restart

    It didn't work, so I changed the line 1132 in the file /etc/exim.pl from :
    my $xsourcedir = maskdir($ENV{'X-SOURCE-DIR'});
    To :
    my $xsourcedir = $ENV{'X-SOURCE-DIR'};

    After restarting exim, PHP was able to start sending emails again.

    Can someone from cPanele explain what caused this problem and how to prevent it in the future?
     
  3. Jim Huang

    Jim Huang Registered

    Joined:
    May 29, 2016
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Netherlands
    cPanel Access Level:
    Website Owner
    what is that maskdir even nothing comes up in google so strange?
     
  4. hamadino

    hamadino Registered
    PartnerNOC

    Joined:
    May 21, 2006
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I got the same problem.

    I changed the line 1132 in the file /etc/exim.pl from :
    my $xsourcedir = maskdir($ENV{'X-SOURCE-DIR'});
    To :
    my $xsourcedir = $ENV{'X-SOURCE-DIR'};


    Thank you g-force

    Waiting for cPanel explanation or work around
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

    It's possible this is related to the issue reported on the following thread:

    Email stopped working after update

    Could anyone experiencing this issue review that thread and let us know if the solution addresses the issue with sending out emails via PHP?

    Thank you.
     
  6. santrix

    santrix Well-Known Member

    Joined:
    Nov 30, 2008
    Messages:
    223
    Likes Received:
    2
    Trophy Points:
    18
    This doesn't appear to relate to the exim.pl permissions bug to which cPanelMichael refers.

    We have now found that the Tweak Settings > Mail > "Track email origin via X-Source email headers", when enabled, immediately causes messages like this in exim_mainlog:

    Code:
    2016-06-09 09:15:39 1bAv7q-000bDV-CM == redacted@redacted.com R=dkim_lookuphost defer (-1): dkim_lookuphost router failed to expand add_headers item "NULL": Undefined subroutine &main::maskdir called at /etc/exim.pl line 1132.\n
    
    2016-06-09 09:15:44 H=([x.x.x.x]) [x.x.x.x]:24865 I=[x.x.x.x]:25 sender verify defer for <redacted@redacted.com>: dkim_lookuphost router failed to expand add_headers item "NULL": Undefined subroutine &main::maskdir called at /etc/exim.pl line 1132.
    Disabling this option makes the problem go away. We are seeing this beahaviour on dozens of servers, running CloudLinux 6 and 7 and cPanel v56.22. We have not yet opened a support request with cPanel.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Were you able to verify the permissions for the /etc/exim.pl file on the affected systems? You can do so with a command such as:

    Code:
    stat  /etc/exim.pl
    Thank you.
     
Loading...

Share This Page