Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I have a website on a vps server and normally the server is maintained by a good friend of mine who knows what he is doing. Due to personal ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2013
    Posts
    3

    Sendmail wont send email to my own domain


    Hi,

    I have a website on a vps server and normally the server is maintained by a good friend of mine who knows what he is doing.
    Due to personal problems this friend is unable to help me.

    Seeing i have serious problems with sendmail that need resolving i have been forced to dive into the world of linux wit absolutly 0 prior expirience. So please bear with me..

    The situation..

    The VPS server is running a firewall, mailserver, and webserver.

    On the webserver im running sendmail which serves as a client to send email trough my website to my customers and to me. The sendmail client uses the mailserver to relay all emails to. Whenever sendmail recieves an email it will relay that email to the mailserver who handles the rest.

    Since 2 days ago i no longer recieve emails for my domain.
    The sendmail server has no problem sending emails to the rest of the world but decided to no longer send email to my own domain.

    The mailserver is behind a firewall and i cannot connect to the mailserver with internet ip. I need to use LocalIP.

    i Acomplish this my having the following in sendmail.cf :
    MAILER_DEFINITIONS
    define(`MAIL_HUB', `xenomail1.xenocide.')dnl
    define(`LOCAL_RELAY', `xenomail1.xenocide.')dnl

    My hosts file reads as follows:

    127.0.0.1 localhost
    127.0.1.1 xenoweb1.xenocide.local xenoweb1
    192.168.200.30 xenomail1.xenocide xenomail1

    192.168.200.30 is the ip of the mailserver.


    When i use the commandline mail command to send email to say a gmail account the mail goes trough fine.

    When i send email to my own domain the adres changes on the mailserver to info-xenomail1.xenocide and i get an errors saying host or domain name is not found..


    Sadly i cant post logs because i get errors from the site that i cant post at signs etc until i have 15 posts

    I have been struggling with this for the past 19 hours and have yet to sleep. I sincerely hope somebody can shed some light on the situation and explain in noob terms what i should investigate/change.

    Thasnks in advance for any help!

  2. #2
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    910
    echo "test email" | mail -s "my test" user@mydomain.com

    That will send an email with body "test email" and subject "my test" to user@mydomain.com

    Also, you should check your mail logs.
    grep mydomain /var/log/mail*

    Also, sendmail is a transfer agent, not a client.
    Also, does your mail server accept incoming mail from the internet? It's possible the mail server might be out of space. Sometimes user inboxes can be limited in size.

  3. #3
    Just Joined!
    Join Date
    Feb 2013
    Posts
    3
    Quote Originally Posted by mizzle View Post
    echo "test email" | mail -s "my test" user@mydomain.com

    That will send an email with body "test email" and subject "my test" to user@mydomain.com

    Also, you should check your mail logs.
    grep mydomain /var/log/mail*

    Also, sendmail is a transfer agent, not a client.
    Also, does your mail server accept incoming mail from the internet? It's possible the mail server might be out of space. Sometimes user inboxes can be limited in size.
    Ive ran command: echo "test email" | mail -s "my test" info at mydomain.com
    tail -f mail.log on sendmail shows it has been transfered succesfully to the mailserver. (qued for delivery)

    Mailserver in turn bounces it as it changes the email adres to :
    info at xenomail1.xenocide

    "Feb 22 21:33:30 mx1 postfix/smtp[30423]: 06E442E8134: to=<info at xenomail1.xenocide>,
    relay=none, delay=0.03, delays=0.02/0.01/0/0, dsn=5.4.4,

    status=bounced (Host or domain name not found.
    Name service error for name=xenomail1.xenocide
    type=A: Host not found)"


    Running the same mail command for a gmail acount or whatever works fine.

    The mail server accepts incoming mail.
    Using outlook or any other email client to send email to my domain will be handled perfectly by the mailserver.

    Perhaps this helps in determing what my problem is?

    Command : sendmail -d0.1 -bv root
    Outputs:

    Version 8.14.3
    Compiled with: DNSMAP LDAPMAP LDAP_REFERRALS LOG MAP_REGEX MATCHGECOS
    MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX
    NEWDB NIS NISPLUS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
    TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG

    ============ SYSTEM IDENTITY (after readcf) ============
    (short domain name) $w = xenoweb1
    (canonical domain name) $j = xenoweb1.xenocide.local
    (subdomain name) $m = xenocide.local
    (node name) $k = xenoweb1
    ================================================== ======

    root... deliverable: mailer relay, host xenomail1.xenocide., user root at xenomail1.xenocide

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Feb 2013
    Posts
    3
    Problem solved.

    (not sure if it will make much sense since i started learning about linux 22 hours ago, so plz correct any errors on my part)

    Heres what i did.

    Because the mailserver was firewalled and could only be connected to locally and since sendmail seems to ignore the host file (up to a point) i had to set
    define(`SMART_HOST',`bla.bla)
    in my sendmail.cf

    and then in my host file pointed
    bla.bla
    to my mailservers local ip.

    This made it possible to connect to the mailserver using a local ip.

    After that i had to set
    define(`MAIL_HUB', `bla.bla.')dnl
    define(`LOCAL_RELAY', `bla.bla.')dnl
    in sendmail.cf because for some reason without it, local domain names would not be relayed to the mailserver properly.

    Now no matter what domain i was sending email to (local or not) it would always connect to the mailserver using bla.bla

    But for some reasons with local domain names the result on the mailserver would be a unqualified domain name and bounce the mail.

    Thats where FEATURE(`stickyhost') cam into play.
    Now it remembers the TO: adres and "sticks"

    haha, that all probably makes 0 sense but after almost 24 hours i cba.
    Im just happy i fixed it. And im sure my customers will be to!
    Whoohoo. Off to bed!

Posting Permissions

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