stat=Deferred: h.mx.mail.yahoo.com.: No route to host
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I don't quite understand what you mean by a workaround from the ISP side.
If you want to run a mailserver and be able to send and receive mail, you need a domain registered in some dns and your mailserver being the MX record for that domain.
Without it, for just sending out mail you can use the tricks above (masquerading, genericstable etc). But you'll never be able to receive mail.
I don't quite understand what you mean by a workaround from the ISP side.
Let me explain in this way. As you said, Yahoo accepts incoming emails from myisp.com since it doesn't know mahmood@srv1
Also myisp.com first receive emails from mahmood@srv1 and then relays them to Yahoo. If myisp.com does not know mahmood@srv1, then it will discard my emails. Is that right? What I meant was that should I tell myisp.com to add mahmood@srv1 to its trusted list?
UPDATE:
Before trying genericstable, here is the results of sendmail
Code:
mahmood@srv1:freqmine$ sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter <ruleset> <address>
> /tryflags HS
> /try esmtp someone@yahoo.com
Trying header sender address someone@yahoo.com for mailer esmtp
canonify input: someone @ yahoo . com
Canonify2 input: someone < @ yahoo . com >
Canonify2 returns: someone < @ yahoo . com . >
canonify returns: someone < @ yahoo . com . >
1 input: someone < @ yahoo . com . >
1 returns: someone < @ yahoo . com . >
HdrFromSMTP input: someone < @ yahoo . com . >
PseudoToReal input: someone < @ yahoo . com . >
PseudoToReal returns: someone < @ yahoo . com . >
MasqSMTP input: someone < @ yahoo . com . >
MasqSMTP returns: someone < @ yahoo . com . >
MasqHdr input: someone < @ yahoo . com . >
MasqHdr returns: someone < @ yahoo . com . >
HdrFromSMTP returns: someone < @ yahoo . com . >
final input: someone < @ yahoo . com . >
final returns: someone @ yahoo . com
Rcode = 0, addr = someone@yahoo.com
>
If genericstable doesn't exist, you have to create it. And then use "makemap hash" to hash it.
Since mail goes out as from mahmood@srv1, you need to rewrite this address.
Quote:
Also myisp.com first receive emails from mahmood@srv1 and then relays them to Yahoo. If myisp.com does not know mahmood@srv1, then it will discard my emails. Is that right? What I meant was that should I tell myisp.com to add mahmood@srv1 to its trusted list?
From the logs posted, your mailserver connects directly to yahoo to deliver the mail. There is no isp mailserver in between.
root@srv1:~# cat /etc/mail/genericstable
mahmood@srv1 mahmood@srv1.myisp.com
root@srv1:~# makemap hash /etc/mail/genericstable < /etc/mail/genericstable
root@srv1:~# cat /etc/mail/sendmail.mc
divert(-1)dnl
#-----------------------------------------------------------------------------
# $Sendmail: debproto.mc,v 8.14.3 2010-02-15 09:38:10 cowboy Exp $
#
# Copyright (c) 1998-2009 Richard Nelson. All Rights Reserved.
#
# cf/debian/sendmail.mc. Generated from sendmail.mc.in by configure.
#
# sendmail.mc prototype config file for building Sendmail 8.14.3
#
# Note: the .in file supports 8.7.6 - 9.0.0, but the generated
# file is customized to the version noted above.
#
# This file is used to configure Sendmail for use with Debian systems.
#
# If you modify this file, you will have to regenerate /etc/mail/sendmail.cf
# by running this file through the m4 preprocessor via one of the following:
# * make (or make -C /etc/mail)
# * sendmailconfig
# * m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
# The first two options are preferred as they will also update other files
# that depend upon the contents of this file.
#
# The best documentation for this .mc file is:
# /usr/share/doc/sendmail-doc/cf.README.gz
#
#-----------------------------------------------------------------------------
divert(0)dnl
#
# Copyright (c) 1998-2005 Richard Nelson. All Rights Reserved.
#
# This file is used to configure Sendmail for use with Debian systems.
#
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.3-9.1ubuntu1 2010-02-15 09:38:10 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl # into this directory before writing files.
dnl # If *all* your user accounts are under /home then use that
dnl # instead - it will prevent any writes outside of /home !
dnl # define(`confSAFE_FILE_ENV', `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
dnl #
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
FEATURE(`use_cw_file')dnl
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
FEATURE(genericstable)dnl
FEATURE(generics_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
GENERICS_DOMAIN(`myisp.com')dnl
MAILER_DEFINITIONS
MAILER(`local')dnl
MAILER(`smtp')dnl
root@srv1:~# cat /etc/hosts
127.0.0.1 localhost.localdomain localhost
192.168.1.1 srv1
195.25.62.105 srv1 srv1.myisp.com
192.168.1.2 client1
192.168.1.3 client2
192.168.1.4 client3
# The following lines are desirable for IPv6 capable hosts
#::1 localhost ip6-localhost ip6-loopback
#fe00::0 ip6-localnet
#ff00::0 ip6-mcastprefix
#ff02::1 ip6-allnodes
#ff02::2 ip6-allrouters
root@srv1:~# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
root@srv1:~# /etc/init.d/sendmail restart
* Restarting Mail Transport Agent (MTA) sendmail [ OK ]
root@srv1:~# exit
exit
mahmood@srv1:~$ mail -s "test" someone@yahoo.com < test.txt
mahmood@srv1:~$
this is shown in the log
Code:
May 21 17:40:33 srv1 sm-mta[32363]: starting daemon (8.14.3): SMTP+queueing@00:10:00
May 21 17:40:44 srv1 sendmail[32383]: p4LDAinP032383: from=mahmood, size=83, class=0, nrcpts=1, msgid=<201105211310.p4LDAinP032383@srv1.myisp.com>, relay=mahmood@localhost
May 21 17:40:44 srv1 sm-mta[32384]: p4LDAiST032384: from=<mahmood@srv1.myisp.com>, size=346, class=0, nrcpts=1, msgid=<201105211310.p4LDAinP032383@srv1.myisp.com>, proto=ESMTP, daemon=MTA-v4, relay=localhost.localdomain [127.0.0.1]
May 21 17:40:44 srv1 sendmail[32383]: p4LDAinP032383: to=<someone@yahoo.com>, ctladdr=mahmood (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30083, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p4LDAiST032384 Message accepted for delivery)
May 21 17:42:01 srv1 sm-mta[32386]: p4LDAiST032384: to=<someone@yahoo.com>, ctladdr=<mahmood@srv1.myisp.com> (1000/1000), delay=00:01:17, xdelay=00:01:17, mailer=esmtp, pri=120346, relay=b.mx.mail.yahoo.com. [74.6.136.65], dsn=4.0.0, stat=Deferred: b.mx.mail.yahoo.com.: No route to host
May 21 17:40:44 srv1 sm-mta[32384]: p4LDAiST032384: from=<mahmood@srv1.myisp.com>,
At least now the sender address was rewritten
You can try to send mail to some other address (in gmail maybe) and see what you get. Maybe your IP is banned temporarily from yahoo
If you get the same logs for gmail, then I guess it's your isp that blocks outgoing smtp connections. Can you try to connect to gmail:
Code:
telnet smtp.gmail.com 25
and see what happens?
If you can't connect, then you need to define your isp's mailserver as a smarthost for sendmail.
A quick way is to edit sendmail.cf and change DS to
Code:
DSsomehting.myisp.com
If you connect, but you get authentication errors, you should configure smtp auth. Check this to see what you need to change in sendmail configuration
If your isp accepts plain login, then you need to use your password unencrypted. Of course /etc/mail/client-info should have 600 permissions, so it can only be read by root. Note also that you can (re)move this file after you've hashed it.
If your isp accepts other forms of login (among those in onfAUTH_MECHANISMS), you can encrypt the password accordingly. You should contact your isp on this and use google to see how you can encrypt the password. One useful page could be this (especially step 7) to do some auth tests.
Something is not clear for me.
On srv1, my username is mahmood
Also my email username at myisp.com is different. When I set smarthost as myisp.com, then this procedure is done:
No.
You use the username mahmood.surname@myisp.com along with your password in order to connect to your isp mailserver and use it as a relay. This is done because your isp blocks all outgoing smtp traffic except for its mailserver.
There is no encapsulation if I can understand what you mean by this term. The mail you send will still have as a sender mahmood@srv1 (of course you need to fix srv1 to be a valid fqdn) and a recipient like user@gmail.com
Hi
I come back... after some emailing with the myisp.com and receiving not so many useful information, I tried to solve it my self.
As I said my user account on the server is mahmood@srv1.myisp.com and I have an email account which is mahmood.surname@myisp.com (please note that the user name on the server is different from myisp.com email account).
The content of sendmail.mc is
Code:
mahmood@srv1:~$ cat /etc/mail/sendmail.mc
divert(-1)dnl
divert(0)dnl
define(`_USE_ETC_MAIL_')dnl
include(`/usr/share/sendmail/cf/m4/cf.m4')dnl
VERSIONID(`$Id: sendmail.mc, v 8.14.3-9.1ubuntu1 2010-02-15 09:38:10 cowboy Exp $')
OSTYPE(`debian')dnl
DOMAIN(`debian-mta')dnl
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
undefine(`confHOST_STATUS_DIRECTORY')dnl #DAEMON_HOSTSTATS=
dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE
dnl #
dnl # General defines
dnl #
dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()
dnl # into this directory before writing files.
dnl # If *all* your user accounts are under /home then use that
dnl # instead - it will prevent any writes outside of /home !
dnl # define(`confSAFE_FILE_ENV', `')dnl
dnl #
dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!
dnl # Remove `, Addr=' clauses to receive from any interface
dnl # If you want to support IPv6, switch the commented/uncommentd lines
dnl #
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
dnl #
dnl # Be somewhat anal in what we allow
define(`confPRIVACY_FLAGS',dnl
`needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl
dnl #
dnl # Define connection throttling and window length
define(`confCONNECTION_RATE_THROTTLE', `15')dnl
define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl
dnl #
dnl # Features
dnl #
dnl # use /etc/mail/local-host-names
FEATURE(`use_cw_file')dnl
dnl #
dnl # The access db is the basis for most of sendmail's checking
FEATURE(`access_db', , `skip')dnl
dnl #
dnl # The greet_pause feature stops some automail bots - but check the
dnl # provided access db for details on excluding localhosts...
FEATURE(`greet_pause', `1000')dnl 1 seconds
dnl #
dnl # Delay_checks allows sender<->recipient checking
FEATURE(`delay_checks', `friend', `n')dnl
dnl #
dnl # If we get too many bad recipients, slow things down...
define(`confBAD_RCPT_THROTTLE',`3')dnl
dnl #
dnl # Stop connections that overflow our concurrent and time connection rates
FEATURE(`conncontrol', `nodelay', `terminate')dnl
FEATURE(`ratecontrol', `nodelay', `terminate')dnl
dnl #
dnl # If you're on a dialup link, you should enable this - so sendmail
dnl # will not bring up the link (it will queue mail for later)
dnl define(`confCON_EXPENSIVE',`True')dnl
dnl #
dnl # Dialup/LAN connection overrides
dnl #
include(`/etc/mail/m4/dialup.m4')dnl
include(`/etc/mail/m4/provider.m4')dnl
dnl #
dnl # Default Mailer setup
FEATURE(genericstable)dnl
FEATURE(generics_entire_domain)dnl
FEATURE(masquerade_envelope)dnl
GENERICS_DOMAIN(`myisp.com')dnl
MAILER_DEFINITIONS
define(`SMART_HOST', relayadd.myisp.com)dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo', `hash /etc/mail/auth/client-info')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
according to this , I have created a file "/etc/mail/auth/client-info" and filled with
what does stat=User unknown mean? when I send to myisp.com, there is no problem.
Means that you're not allowed to use your ISP's mailserver as a relay, probably because you're authenticated.
Maybe you should use U:mahmood@srv1.myisp.com (usually U and I are the same and you don't have to specify them both) and add a M:PLAIN LOGIN, e.g.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.