LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 06-30-2011, 01:43 PM   #1
mali2
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
sendmail unable to send message to external servers (e.g. hotmail,gmail etc)


first of all, I am new to mailing server stuff.
Long story in short; I am trying to send an email by sendmail (ubuntu) to external servers, but unable to send.

following is what i am trying to do and what i got the response:

sendmail -v xxx@hotmail/gmail.com < mail.test

where mail.test contains
[COLOR="rgb(105, 105, 105)"]
From: bla@bla.com
Subject: bla bla bla
This is test email.

and this is the reply:

WARNING: local host name (mylab) is not qualified; see cf/README: WHO AM I? xxx@hotmail.com... Connecting to [127.0.0.1] via relay... 220 mylab ESMTP Sendmail 8.14.3/8.14.3/Debian-9.1ubuntu1; Thu, 30 Jun 2011 17:58:52 +0200; (No UCE/UBE) logging access from: localhost.localdomain(OK)-localhost.localdomain [127.0.0.1]......
MAIL From: SIZE=849 AUTH=root@mylab
250 2.1.0 ... Sender ok
-RCPT To:
-DATA
250 2.1.5 ... Recipient ok
354 Enter mail, end with "." on a line by itself
.


and then nothing happened and keep the cursor blinking.

and following information is logged in syslog:

... mailer=es mtp, pri=570307, relay=mx2.hotmail.com. [65.55.37.104], dsn=4.0.0, stat=Deferred: Connection timed out with mx2.hotmail.com.

I also tried

telnet mx1.hotmail.com 25

it stucked at

trying to connect 65.55.37.72...

any idea would be appreciated. Thanks for your concentration.
 
Old 06-30-2011, 03:21 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,962

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

I guess your ISP blocks outgoing traffic to port 25. If you want to be able to send mail outside, you should use the ISP mailserver as a smarthost

Regards
 
Old 07-01-2011, 01:41 PM   #3
agentbuzz
Member
 
Registered: Oct 2010
Location: Texas
Distribution: Debian, Ubuntu, CentOS, RHEL
Posts: 118

Rep: Reputation: 22
mali2,
bathory is probably right; SMTP sockets from customer premises equipment are firewalled. Now you need to configure sendmail to use your ISP's MTA for outgoing mail.

First ensure that you have SASL support in your sendmail binary:

Code:
Site$ sendmail -d0.1 -bv root | grep SASL
		NAMED_BIND NETINET NETUNIX NEWDB PIPELINING SASLv2 SCANF
If you do not see SASL listed in the output of the above command, compile sendmail with the appropriate lines in your site.config.m4 file, which is found at /usr/src/sendmail-8.14.3/devtools/Site/, or where you put your source code. If there is no site.config.m4 in devtools/Site, then do this:

Code:
$ cd devtools/Site
$ cp ../OS/Linux site.config.m4
You might as well add milter support while you're at it. Open your Makefile and append "libmilter" at the end of the SUBDIRS line:

Code:
SUBDIRS= libsm libsmutil libsmdb sendmail editmap mail.local \
         mailstats makemap praliases rmail smrsh vacation libmilter
This is the relevant part of a known-good site.config.m4. There are more lines below it:

Code:
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 LOGIN')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 LOGIN')dnl
define(`confDEF_AUTH_INFO', `/etc/mail/auth/auth-info')dnl
define(`confDEPEND_TYPE', `CC-M')
define(`confSM_OS_HEADER', `sm_os_linux')
define(`confMANROOT', `/usr/man/man')
define(`confLIBS', `-ldl')
define(`confEBINDIR', `/usr/sbin')
APPENDDEF(`confLIBSEARCH', `crypt nsl')
APPENDDEF(`confLIBSEARCH', `crypt nsl')
APPENDDEF(`confENVDEF', `-DSASL=2')
APPENDDEF(`conf_sendmail_LIBS', `-lsasl2')
APPENDDEF(`confLIBDIRS', `-L/usr/local/lib/sasl2')
APPENDDEF(`confINCDIRS', `-I/usr/local/include')
APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER_ROOT_UNSAFE')
define(`confMAPDEF',`-DNEWDB')
Use "./Build -c" at the root of your source tree to do the compile, since you have changed site.config.m4.

Find the "smart host" line in /etc/mail/sendmail.cf and type in your ISP's SMTP hostname:

Code:
# "Smart" relay host (may be null)
DSsmtp.domain.com
There should be a line in sendmail.cf like this:


Code:
# authinfo list database: contains info for authentication as client
Kauthinfo hash /etc/mail/auth/client-info
In your client-info file you should have a line according to this syntax:

Code:
AuthInfo:smtp.domain.com "U:USERNAME" "I:USERNAME" "P:PASSWORD" "M:LOGIN PLAIN"
Then call sendmail like this to watch your SMTP ssession:

Code:
mail:~$ sudo sendmail -Am -v -t
To: jblow@domain.com
From: jblow@domain.com
Subject: boom

here
jblow@domain.com... Connecting to smtp.domain.com via relay...

220 smtp.domain.com ESMTP
>>> EHLO mail.domain.org
250-smtp.domain.com
250-AUTH LOGIN PLAIN XYMCOOKIE
250-PIPELINING
250 8BITMIME
>>> AUTH LOGIN
334 VXNlcm5hbWU6
>>> YkVf5434DvbiQ5v==
334 Sdfd465rbfg
>>> nGt6578trtgtT==
235 OK, go ahead
>>> MAIL From:<user@domain.org> AUTH=user@domain.org
250 OK , completed
>>> RCPT To:<jblow@domain.com>
>>> DATA
250 OK , completed
354 Start Mail. End with CRLF.CRLF
>>> .
250 OK , completed
jblow@domain.com... Sent (OK , completed)
Closing connection to smtp.domain.com
>>> QUIT
221 Service Closing transmission
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Sendmail to use Gmail's SMTP to send mail lpallard Linux - Software 12 05-01-2011 02:05 PM
sendmail - can't send to gmail/hotmail... - Relaying denied. IP name possibly forged spids Linux - Server 2 03-30-2009 08:57 PM
sendmail Temporary AUTH failure on hotmail servers hua Linux - Server 1 10-27-2008 01:46 PM
Can't send e-mail to hotmail, msn but work with yahoo and gmail taydu3000 Linux - Server 3 07-17-2007 11:38 PM
SendMail wont send anything to Hotmail or Yahoo Users. paroxsitic Linux - Software 2 04-15-2007 04:19 PM


All times are GMT -5. The time now is 01:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration