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.

E-mails aren't being delivered locally

Discussion in 'E-mail Discussions' started by chrille112, Feb 11, 2007.

  1. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    This is my problem:

    I have PHP script to send e-mails:

    Code:
    <?
    mail("chrille@DOMAIN-A.com","testar","hejhej");
    mail("chrille@DOMAIN-B.com","testar","hejhej");
    mail("scroller@DOMAIN-C.com","testar","hejhej");
    ?>
    
    Domain A and C are hosted on the server I'm running the script from, and B is on an external server. The delivery works perfectly to the external domain, but internally the e-mails never gets delivered!

    In /var/log/exim_mainlog it looks correctly:
    Code:
    2007-02-11 21:57:06 1HGLlJ-0001WD-TB => halvapri <chrille@DOMAIN-A.com> R=localuser T=local_delivery
    2007-02-11 21:57:06 1HGLlJ-0001WD-TB Completed
    2007-02-11 21:57:07 1HGLlJ-0001WH-U7 => scroller <scroller@DOMAIN-C.com> R=virtual_user T=virtual_userdelivery
    2007-02-11 21:57:07 1HGLlJ-0001WH-U7 Completed
    2007-02-11 21:57:07 1HGLlJ-0001WF-Tc => chrille@DOMAIN-B.com R=lookuphost T=remote_smtp H=ensim2.XX.com [217.198.100.100] X=TLSv1:AES256-SHA:256
    2007-02-11 21:57:07 1HGLlJ-0001WF-Tc Completed
    
    How do I solve this? What log file should I look in to see more?
     
  2. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    Using your favorite Linux editor such as pico or vi /etc/hosts
    and add this directive:
    localhost.localdomain localhost
    see if that helps.
     
  3. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply!

    Added it:

    Code:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               localhost
    217.198.123.123         homer.blah.com homer cpanel.dependit.net cpanel
    localhost.localdomain   localhost
    
    But it did not help :( Did I add it correctly?
     
  4. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    ummm, no. It should be:
    Code:
    127.0.0.1 localhost.localdomain localhost
    
     
  5. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    OK! Changed:
    Code:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1               localhost.localdomain localhost
    217.198.123.123         homer.blah.com homer cpanel.dependit.net cpanel
    
    (tried to add an own line too)
    But it didn't help :( The external mail works fine, but not internal
     
  6. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    You need to check /var/log/exim_* files for errors to help you troubleshoot this problem. Did you enable "Track the origin of messages sent though the mail server by adding the X-Sender headers (exim 4.34+ required)" in the WHM >> Tweak Settings? If yes, disable it and see if that works.
     
    #6 AndyReed, Feb 12, 2007
    Last edited: Feb 12, 2007
  7. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    "Track the origin" was already disabled.

    In exim_mainlog, it looks just fine:
    Code:
    mainlog:
    2007-02-12 18:37:52 1HGf83-0006b9-Uo <= root@homer.adnic.com U=root P=local S=357
    2007-02-12 18:37:53 1HGf83-0006b9-Uo => halvapri <chrille@halvapriset.com> R=localuser T=local_delivery
    2007-02-12 18:37:53 1HGf83-0006b9-Uo Completed
    2007-02-12 18:37:53 1HGf84-0006bC-0b <= root@homer.adnic.com U=root P=local S=361
    2007-02-12 18:37:53 1HGf84-0006bH-1E <= root@homer.adnic.com U=root P=local S=347
    2007-02-12 18:37:53 1HGf84-0006bH-1E => scroller <scroller@adnic.com> R=virtual_user T=virtual_userdelivery
    2007-02-12 18:37:53 1HGf84-0006bH-1E Completed
    2007-02-12 18:37:53 1HGf84-0006bC-0b => chrille@reklambutiken.com R=lookuphost T=remote_smtp H=mail.reklambutiken.com [217.198.149.90] X=TLSv1:AES256-SHA:256
    2007-02-12 18:37:53 1HGf84-0006bC-0b Completed
    
    Paniclog and rejectlog says nothing about these mails :confused:




    EDIT: My misstake, I messed up... This is how it is:
    adnic.com is the server I'm running the script at. The mail is not delivered to scroller@adnic.com
    halvapriset.com and reklambutiken.com is another server. The mail is being delivered to chrille@reklambutiken.com, but not to chrille@halvapriset.com

    That is really strange?
     
    #7 chrille112, Feb 12, 2007
    Last edited: Feb 12, 2007
  8. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    I'd try /var/log/exim_* -- in particular /var/log/exim_mainlog.
     
  9. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    But this is /var/log/exim_mainlog? :confused:

    Code:
    mainlog:
    2007-02-12 18:37:52 1HGf83-0006b9-Uo <= root@homer.adnic.com U=root P=local S=357
    2007-02-12 18:37:53 1HGf83-0006b9-Uo => halvapri <chrille@halvapriset.com> R=localuser T=local_delivery
    2007-02-12 18:37:53 1HGf83-0006b9-Uo Completed
    2007-02-12 18:37:53 1HGf84-0006bC-0b <= root@homer.adnic.com U=root P=local S=361
    2007-02-12 18:37:53 1HGf84-0006bH-1E <= root@homer.adnic.com U=root P=local S=347
    2007-02-12 18:37:53 1HGf84-0006bH-1E => scroller <scroller@adnic.com> R=virtual_user T=virtual_userdelivery
    2007-02-12 18:37:53 1HGf84-0006bH-1E Completed
    2007-02-12 18:37:53 1HGf84-0006bC-0b => chrille@reklambutiken.com R=lookuphost T=remote_smtp H=mail.reklambutiken.com [217.198.149.90] X=TLSv1:AES256-SHA:256
    2007-02-12 18:37:53 1HGf84-0006bC-0b Completed
    
     
  10. blkjck

    blkjck Well-Known Member

    Joined:
    Sep 17, 2003
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    #10 blkjck, Feb 13, 2007
    Last edited: Feb 13, 2007
  11. chrille112

    chrille112 Member

    Joined:
    Apr 6, 2006
    Messages:
    13
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your reply. The boxtrap was enabled, so I disabled it. There was no /etc/eximmailtrap tough, so I tried to run my script, but it's still the same problem :(


    ------------------------
    Edit: Now I know what's wrong!
    I'm planning to move halvapriset.com to the adnic.com server (from where I ran the script). Therefore, I've set up an account for it. When I send mails from the server, it delivers to the local account, alltough the DNS servers point to another server. That's whats wrong :) I checked the mail on the new account, and all was there :) Thanks for you help and support guys!
     
    #11 chrille112, Feb 14, 2007
    Last edited: Feb 17, 2007
Loading...

Share This Page