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.

VPS WHM/cPanel setup - Emails - Default address, etc.

Discussion in 'E-mail Discussions' started by cvsouth, Nov 18, 2013.

  1. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi,

    I am trying to get everything set up with WHM and cPanel on a CentOS 6 VPS. Pretty much everything is in place but one thing I haven't been able to get working is the email options through cPanel. I set up a default address for a domain on the account but when I send a test email to it I get an undelivered report.

    I have a DNS control panel from the same company as the VPS which I set up records for each domain with, which includes MX records. I then add them as add-on domains by enabling remote domains. I am planning to set up private name servers any day now so I don't know if any of this would have any impact on the emails or what I am doing wrong.

    Does anyone have any experience with getting emails working? Is there some SMTP config I need to do in WHM or something?

    Thanks in advance
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    It sounds like the domain name's MX records may not yet point to your VPS. I recommend setting up name servers at your registrar and using those instead of entering custom DNS records.

    Thank you.
     
  3. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Michael thanks for your response

    I set up private name server (I think). I removed the add-on domains, removed DNS records from the VPS host, allowed shared nameserver IPs in tweak settings, set up and my one IP to the new nameservers ns1.mydomain.com and ns2.mydomain.com rather than ns0, ns1 and ns2.vpsdomain.com. I updated the nameservers for the domain from the domain registrar and re-added them as add-on domains in cPanel which worked.

    I was hoping that emails would just start working after this but no luck. What I have noticed though is that once I remove the DNS records from the VPS provider for the domain, when I try to send emails to something@mydomain.com I don't get an undelivered report anymore, but I also don't receive the email (it is set up with a default address forwarding to my gmail). So now it is like the email is lost completely.

    Another things I've found out is that if I create an email account in cPanel, a) every account has all the emails on the server from the beginning of time and b) if I try to send an email through it, it says From address is invalid which is 'accountname@', so clearly something wrong there. Could this be a clue?

    Are there any troubleshooting things I can do? Or are there any common things that I have missed completely?

    Sorry for the long winded question
     
  4. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I've been fiddling around with things,

    When in cPanel I set the 'Default address' for a domain to 'Discard with error to sender (at SMTP time)', that works.

    ...But when I set it to forward to another email address, no luck.

    So it seems like the email reaches the server because it is able to reject it with a custom message; but not able to forward it/send emails?

    Anyone have any ideas?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Do you notice any output to /var/log/exim_mainlog or /var/log/exim_reject log when you configure it to forward to another email address. Is the other email address a local or remote address?

    Thank you.
     
  6. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I set it to reject in cPanel and then sent an email, in /var/log/exim_rejectlog I have this:

    Code:
    2013-11-22 21:12:06 H=mail-lb0-f175.google.com [209.85.217.175]:47247 F=<myemail@gmail.com> rejected RCPT <aaa@mydomain.com>: My custom reject message
    I then changed it to forward to myemail@gmail.com instead of rejecting, and in /var/log/exim_mainlog I have this:

    Code:
    2013-11-22 21:16:42 SMTP connection from [209.85.215.53]:44949 (TCP/IP connection count = 1)
    2013-11-22 21:16:43 SMTP connection identification D=mydomain.com O=bbb@mydomain.com E=myemail@gmail.com M= U=myaccount ID=500 B=redirect_resolver
    2013-11-22 21:16:43 1Vjy5j-0000p9-Ls <= myemail@gmail.com H=mail-la0-f53.google.com [209.85.215.53]:44949 P=esmtps X=TLSv1:RC4-SHA:128 S=1722 id=CAJF2zdDTLZVe+5_+43THwsTYZOtr_2Zk3pn3Kmv5e0ENPzq1zg@mail.gmail.com T="" for bbb@mydomain.com
    2013-11-22 21:16:43 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1Vjy5j-0000p9-Ls
    2013-11-22 21:16:43 1Vjy5j-0000p9-Ls SMTP connection identification D=mydomain.com O=bbb@mydomain.com E=myemail@gmail.com M=1Vjy5j-0000p9-Ls U=myaccount ID=500 B=redirect_resolver
    2013-11-22 21:16:43 1Vjy5j-0000p9-Ls SMTP connection outbound 1385155003 1Vjy5j-0000p9-Ls mydomain.com myemail@gmail.com
    2013-11-22 21:16:43 SMTP connection from mail-la0-f53.google.com [209.85.215.53]:44949 closed by QUIT
    2013-11-22 21:16:44 1Vjy5j-0000p9-Ls => myemail@gmail.com <bbb@mydomain.com> R=lookuphost T=remote_smtp H=gmail-smtp-in.l.google.com [173.194.67.26] X=TLSv1:RC4-SHA:128 C="250 2.0.0 OK 1385155005 g2si901903wiw.8 - gsmtp"
    2013-11-22 21:16:44 1Vjy5j-0000p9-Ls Completed
    The email I'm trying to forward it to is my regular gmail
     
  7. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Still struggling with this, any ideas?
     
  8. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Here is some more info:

    When setting a default address, when set up to reject the email with a message in cPanel, that works fine. But when set to forward to an email address (gmail) the email just goes missing (see above).

    I did an 'SMTP test' online and this was the results:


    This part would seem to be the important part:


    I don't know how to fix it though, any suggestions?
     
  9. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  10. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    The domain is listed, yeah
     
  11. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Done some more digging

    If I set up an email account in cPanel then I can send and receive emails through it as expected, so it would appear that the DNS and MX records are all ok and that exim is working properly?

    mydomain.com is listed in /etc/localdomains

    I checked in /etc/valiases/mydomain.com and it has the following:

    Which also shows up when I run the Mail Troubleshooter in WHM for something@mydomain.com

    So it all appears to be set up properly

    When I send an email to something@mydomain.com, expecting it to be forwarded to myemail@gmail.com via the default address, it just never arrives..

    In /var/log/exim_mainlog I get:

    Any ideas? This is so frustrating

    Thanks
     
    #11 cvsouth, Dec 8, 2013
    Last edited: Dec 8, 2013
  12. cvsouth

    cvsouth Member

    Joined:
    Nov 4, 2013
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I just found out that it's only when I use the same email that it should be forwarded to, as the original sender, that it doesn't work. Is there any reason why it wouldn't do a round journey like that?
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    653
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Could you provide an example of this?

    Thank you.
     
Loading...

Share This Page