Find the answer to your Linux question:
Results 1 to 9 of 9
About a year ago, when I first set up my apache server, I was able to use the formmail.pl script to send emails (via sendmail) from a form on my ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283

    Sendmail & "No Route To Host"


    About a year ago, when I first set up my apache server, I was able to use the formmail.pl script to send emails (via sendmail) from a form on my website to my gmail address. Then, a few months ago, it stopped working to any of my addressed other than giles@localhost. Because there were more pressing problems at the time, and I could always check for emails on localhost, I left it, and now I can't remember for certain the circumstances around when it broke - I think I may have just reinstalled httpd, and therefore it might be a lack of configuration somewhere, but I'm not sure.

    What worries me is that, since the script works exactly as it should when posting to localhost, but wont (as far as I can tell) post anywhere else, I might have made an error in the configuration in the first place that allowed the server to be used as a spam relay, so that it's now been blacklisted.

    In order to try to narrow down the problem I've tried running sendmail on it's own. I'm not certain I used it right, but running
    Code:
    sendmail giles@localhost
    then entering these lines
    Code:
    test email at 5:02pm 1/8/2007
    .
    sent an email successfully to giles@localhost, but running
    Code:
    sendmail myaddress@gmail.com
    and entering the same lines as the text hasn't been successful.


    Can anyone shed any light on whether my fears are justified? And if they are, is there any way to get myself off the spammers list, and to make sure my server's nailed down so it cant happen again?
    Thanks for looking at this
    Toodle-oo
    Giles
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

  2. #2
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    have you checked your logs? I think sendmail uses /var/log/mail.log and mail.err

    like does it say it connected to the google mail server successfully and sent the mail or does it bounce there for any kind of reason?

  3. #3
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283
    Checking the logs is a kinda obvious thing for me to have forgotten...
    I can't find a mail.err (even running locate for it doesn't produce anything, but I do have maillog. Essentially the non-localhost messages seem to all end up with "No route to host" errors, but if that's not enough detail the file is attached (although I had to remove some of the older entries and rename it to maillog.txt so that the forum software would accept it).

    Thanks
    Giles

    EDIT: I was thinking of just putting the file up on my server, but I'm not really sure whether any of the info in it would be damaging in the wrong hands...
    Attached Files Attached Files
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    sounds like its never even getting off your machine. No route to host generally means just that, your mail server can't connect to the remote mail server. are you hardcoding where the emails get delivered, like are you telling sendmail @gmail goes to these places? also do you have any other those gmail servers listed in your host file? and more importantly, from that machine, can you ping the servers, like gsmtp183.google.com

  6. #5
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283
    - I haven't put in any hardcoded instructions (at least not intentionally) - I don't think I'd know how to, tbh.

    - /etc/hosts only has two uncommented lines:
    Code:
    # For loopbacking
    127.0.0.1 localhost
    127.0.0.1 Bess.gilesfleming.com Bess
    (Bess is the name i gave my server, in case that's not obvious)
    /etc/hosts.allow and /etc/hosts.deny are empty, and /etc/hosts.equiv only lists localhost.

    - I've tried a selection of the mail servers, and have managed to ping them all.

    Thanks for your help so far
    Giles
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

  7. #6
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283
    A friend of mine who knows rather more about this sort of thing than me has said I should give up on sendmail, and try postfix instead. Since I'm thinking of upgrading my server from Slackware 11.0 to 12.0, I thought I might try that then - I reckon if it works, great, if not then I haven't lost anything.

    Any thoughts as to whether this is likely to be worthwhile?
    Thanks
    Toodle-oo
    Giles
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

  8. #7
    Linux Engineer jledhead's Avatar
    Join Date
    Oct 2004
    Location
    North Carolina
    Posts
    1,077
    I prefer postfix over sendmail because it is just as powerful and much more easy to configure.

  9. #8
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283

    struggling with sendmail/no route to host

    I cant get anywhere with postfix - even when I install it the easy way (with urpmi on my mandriva box) it doesn't seem to do anything... I've no doubt that's a relatively sortable problem, but I don't want to get caught up in it - the thing that bothers me is these no route to host errors, and I know it's not just cos I'm using sendmail that I'm getting them (since sendmail used to work), so I'm going to ignore postfix for now.

    To that end I had another google of the error, and eventually came across an old thread in the other forums, that recommended trying to traceroute to the servers, and see where it gets stuck. This is one example, using the yahoo mail server:

    I get the address of the mail server from my maillog ("mx2.mail.ukl.yahoo.com").
    I ping that address to get an IP address.
    Code:
    PING mx2.mail.ukl.yahoo.com (217.12.11.64) 56(84) bytes of data.
    64 bytes from mx2.mail.ukl.yahoo.com 217.12.11.64): icmp_seq=1 ttl=247 time=36.2 ms
    So I run "traceroute 217.12.11.64", and that gives:
    Code:
    traceroute to mx2.mail.ukl.yahoo.com (217.12.11.64), 30 hops max, 38 byte packets
     1  . (192.168.2.1)  0.631 ms  0.556 ms  0.522 ms
     2  globixhg0.reading.broadband.bt.net (213.120.200.145)  38.047 ms  23.396 ms  21.257 ms
     3  10.15.254.252 (10.15.254.252)  21.237 ms  32.506 ms  35.302 ms
     4  unknown.level3.net (212.187.170.161)  58.022 ms  48.348 ms  41.952 ms
     5  ae-0-51.bbr1.london1.level3.net (4.68.116.1)  38.765 ms  71.051 ms  29.887 ms
     6  as-0-0.bbr2.london2.level3.net (4.68.128.110)  87.066 ms ae-1-0.bbr1.london2.level3.net (212.187.128.46) 43.145 ms  56.429 ms
     7  ge-5-0.hsa1.london2.level3.net (4.68.117.39)  55.539 ms ge-4-0-51.hsa1.london2.level3.net (4.68.117.7)  56.068 ms ge-5-2.hsa1.london2.level3.net (4.68.117.167)  50.821 ms
     8  195.50.112.102 (195.50.112.102)  46.905 ms  36.806 ms  65.364 ms
     9  ge-2-1.bas-a1.ukl.yahoo.com (217.12.0.211)  42.695 ms ge-1-13.bas-a1.ukl.yahoo.com (217.12.0.209)  48.010 ms  50.267 ms
    10  alteon7.28.ukl.yahoo.com (217.12.11.7)  47.636 ms  35.769 ms  32.872 ms
    11  alteon7.28.ukl.yahoo.com (217.12.11.7)  28.563 ms  44.015 ms  43.660 ms
    All looks good, yeah? Further digging suggests running it on port 25, so I try "traceroute -p25 217.12.11.64". That produces:
    Code:
    traceroute to mx2.mail.ukl.yahoo.com (217.12.11.64), 30 hops max, 38 byte packets
     1  . (192.168.2.1)  0.589 ms  0.563 ms  0.513 ms
     2  globixhg0.reading.broadband.bt.net (213.120.200.145)  21.178 ms  31.240 ms  85.813 ms
     3  10.15.254.252 (10.15.254.252)  61.509 ms  42.326 ms  24.415 ms
     4  unknown.level3.net (212.187.170.161)  24.199 ms  25.209 ms  23.981 ms
     5  ae-0-51.bbr1.london1.level3.net (4.68.116.1)  22.458 ms  33.583 ms  48.106 ms
     6  as-0-0.bbr2.london2.level3.net (4.68.128.110)  40.968 ms ae-1-0.bbr1.london2.level3.net (212.187.128.46)  83.416 ms as-0-0.bbr2.london2.level3.net (4.68.128.110)  70.151 ms
     7  ge-5-1.hsa1.london2.level3.net (4.68.117.103)  42.803 ms ge-4-0-51.hsa1.London2.Level3.net (4.68.117.7)  76.591 ms ge-5-0.hsa1.London2.Level3.net (4.68.117.39)  57.293 ms
     8  195.50.112.102 (195.50.112.102)  98.152 ms  25.038 ms  23.236 ms
     9  ge-3-1.bas-a1.ukl.yahoo.com (217.12.2.200)  26.707 ms  87.330 ms ge-3-1.bas-a2.ukl.yahoo.com (217.12.2.204)  59.715 ms
    10  * * *
    11  * * *
    12  * * *
    13  * * *
    14  * * *
    15  * * *
    16  * * *
    17  * * *
    18  * * *
    19  * * *
    20  * * *
    21  * * *
    22  * * *
    23  * * *
    24  * * *
    25  * * *
    26  * * *
    27  * * *
    28  * * *
    29  * * *
    30  * * *
    So if I use port 25, I'm getting stuck just before my destination. (A very similar set of output is produced when I try with gsmtp163.google.com, so it's not just this yahoo mail server).

    Unfortunately, I have less than no idea what I ought to do with this new information - I really need someone to talk me through it like I'm 4, I think

    Thanks again
    Giles
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

  10. #9
    Linux User Giles's Avatar
    Join Date
    May 2005
    Location
    Gloucestershire and Cambridge, UK
    Posts
    283
    Is there any information that seems to be missing here? I can't think of anything i could add, but then I dont fully understand the problem, let alone what the solution might be. One site discussing something vaguely related sugested trying to telnet out - but I don't know which hosts would be worth trying...

    Not sure where to go from here.
    Giles
    "Our greatest fear is not that we are powerless. Our greatest fear is Microsoft"
    Registered linux user #391027

Posting Permissions

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