Results 1 to 10 of 10

Thread: separate mail server, web server ignores MX record

  1. #1
    Join Date
    Nov 2008
    Posts
    17

    Default separate mail server, web server ignores MX record

    My registrar provides a free mail server, and I much prefer using it over hosting my own. So, I have an MX record that points to their mail server. It works great - mail from gmail to john@newballot.org ends up in my inbox on the mail server.

    My problem: mail originating at the web server ends up in the local user's mailbox on the web server. It's as if sendmail is ignoring my MX record. This happens with the command-line mail application and within PHP with the mail() command.

    Anyone know why this would be happening?

  2. #2
    Join Date
    Jul 2009
    Location
    New York
    Posts
    465

    Default

    why would sendmail configuration obey your dns records? you have to set sendmail as a null client? as it's normal for it to want to keep it in it's own mailbox unless you tell it otherwise.
    Happily on a Link3. Feel free to request a refferal code that takes a 10% lifetime discount off your hosting.
    Please open a SUPPORT TICKET AND CALL vpslink to resolve your vpslink problems FIRST
    I am a CUSTOMER Only. Any vpslink issues should be directed to Matt@VPSLink and/or Michael@VPSLink

  3. #3
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Quote Originally Posted by Cwewmpz View Post
    as it's normal for it to want to keep it in it's own mailbox unless you tell it otherwise.
    He's right. Recently went through a similar issue when setting up sendmail on debian.

  4. #4
    Join Date
    Jun 2008
    Posts
    232

    Default

    Since you're all using sendmail, could you share the reasons why you choose to use it over postfix?
    Not trolling here, I'm genuinely curious. (I own a copy of ISBN: 1565922220 and I bought it when it was new )

    Is it just because you already have a vested experience with it, or is there something else to it?

  5. #5
    Join Date
    Jul 2007
    Location
    127.0.0.1
    Posts
    392

    Default

    Quote Originally Posted by chriss View Post
    Since you're all using sendmail, could you share the reasons why you choose to use it over postfix?
    Not trolling here, I'm genuinely curious. (I own a copy of ISBN: 1565922220 and I bought it when it was new )

    Is it just because you already have a vested experience with it, or is there something else to it?
    The organization I work for uses sendmail, so it was easy to hijack and mod the configs for my own use. GoogleApps handles my inbound mail, but I still needed a way to send mail from the vps (cron jobs, php scripts, whatever) and don't really have an interest in becoming a postfix/sendmail expert. Just went with what I know would work with the least amount of effort. Hope that makes sense :]

  6. #6
    Join Date
    Nov 2008
    Posts
    17

    Default

    Quote Originally Posted by Cwewmpz View Post
    why would sendmail configuration obey your dns records? you have to set sendmail as a null client? as it's normal for it to want to keep it in it's own mailbox unless you tell it otherwise.
    I have no idea -- I'm a complete sendmail/mail-in-general newb, just trying to get the PHP script that calls mail() to work. I'm going to go do some googling on it, but could you give more info on how to set sendmail as a "null client?"

    Quote Originally Posted by chriss
    Since you're all using sendmail, could you share the reasons why you choose to use it over postfix?
    As mentioned above, I'm so unfamiliar with what's going on behind the scenes when I send mail from my webserver, I'm just going with the flow -- whatever my server is pre-configured to do, I'm letting it do that. I'm not even sure it's using sendmail vs. postfix, don't know what the differences are, how to set one up and disable the other, nor care to since all I really want is for my web-application to work.

    Thank you all for the help!

  7. #7
    Join Date
    Nov 2008
    Posts
    17

    Default

    OK folks, here's what I've done with my limited, newly-googled sendmail knowledge:

    - edited /etc/sysconfig/sendmail on my Fedora system, setting DAEMON=no to prevent sendmail from listening for incoming mail
    - copied /etc/mail/sendmail.mc to /etc/mail/sendmail_original_backup.mc
    - created a new file, /etc/mail/sendmail_nullclient.mc, with the following contents:
    Code:
    include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
    define(`__OSTYPE__', `')dnl
    FEATURE(`nullclient', `spool.mail.gandi.net')dnl
    - ln -s sendmail.mc sendmail_nullclient.mc
    - ran the following as root: m4 sendmail.mc > sendmail.cf
    - edited submit.cf, changing
    Code:
     D{MTAHost}[127.0.0.1]
    to
    Code:
     D{MTAHost}spool.mail.gandi.net
    (this is my registrar's mail server, pointed to by my MX record)

    After this, I tried to send mail to john@newballot.org and here's what I get:
    Code:
    $ mail -v -s "testing email" john@newballot.org
    testing email
    EOT
    john@newballot.org... Connecting to spool.mail.gandi.net. via relay...
    220 spool.mail.gandi.net ESMTP Postfix
    >>> EHLO www.newballot.org
    250-spool.mail.gandi.net
    250-PIPELINING
    250-SIZE 25600000
    250-VRFY
    250-ETRN
    250-ENHANCEDSTATUSCODES
    250-8BITMIME
    250 DSN
    >>> MAIL From:<john@www.newballot.org> SIZE=229
    250 2.1.0 Ok
    >>> RCPT To:<john@newballot.org>
    >>> DATA
    250 2.1.5 Ok
    354 End data with <CR><LF>.<CR><LF>
    >>> .
    250 2.0.0 Ok: queued as EC41425D3CF
    john@newballot.org... Sent (Ok: queued as EC41425D3CF)
    Closing connection to spool.mail.gandi.net.
    >>> QUIT
    221 2.0.0 Bye
    Meaning the mail went through! Thanks for the helpful info, folks. Please respond with any further help if you see something I've done wrong here. Otherwise, perhaps this post will help someone with a similar problem in the future.

  8. #8
    Join Date
    Jul 2009
    Location
    New York
    Posts
    465

    Default

    Hi. In regards to chriss's statement. The same configuration of null client applies to postfix and is not an exclusive sendmail issue.

    To factorial:
    I am suprise you have no problem with your configuration. It seems you neglected to setup a spf record. When using external mail services with mx records you should set spf records referencing your current mail server. When you fail to do so most mail send from your mail server from vpslink will not pass and have a greater efficiency of ending in the junk mail. You can test it yourself by checking the headers and looking for something like: Received-SPF: <status>
    Happily on a Link3. Feel free to request a refferal code that takes a 10% lifetime discount off your hosting.
    Please open a SUPPORT TICKET AND CALL vpslink to resolve your vpslink problems FIRST
    I am a CUSTOMER Only. Any vpslink issues should be directed to Matt@VPSLink and/or Michael@VPSLink

  9. #9
    Join Date
    Jun 2008
    Posts
    232

    Default

    Quote Originally Posted by Cwewmpz View Post
    Hi. In regards to chriss's statement. The same configuration of null client applies to postfix and is not an exclusive sendmail issue.
    Where did I state that?

  10. #10
    Join Date
    Jul 2009
    Location
    New York
    Posts
    465

    Default

    opps sorry chriss. for some reason I thought you implied it would be different with sendmail. my mistake and i apologize.
    Happily on a Link3. Feel free to request a refferal code that takes a 10% lifetime discount off your hosting.
    Please open a SUPPORT TICKET AND CALL vpslink to resolve your vpslink problems FIRST
    I am a CUSTOMER Only. Any vpslink issues should be directed to Matt@VPSLink and/or Michael@VPSLink

Bookmarks

Posting Permissions

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