LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-06-2014, 02:11 PM   #1
inyourmind
LQ Newbie
 
Registered: Jul 2014
Posts: 4

Rep: Reputation: Disabled
RedHat Mailx


Hello,
i am using mailx command like below:
mailx -r 'boss@comp.com' -s 'Email Send' 'user@comp2.com' < file_body

And the email successfully sent.
I don't understand how it get the SMTP Server.
My user don't have the ~/mailrc

I have the standard configuration of /etc/postfix

Inside /var/log/maillog i have the name of the SMTP Server but it change sometimes.

Maybe mailx get the SMTP Server by a dns from /etc/resolv.conf??

Has to do something the route in /etc/sysconfig/network-scripts?
 
Old 11-08-2014, 02:17 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
And the email successfully sent.
I don't understand how it get the SMTP Server.
My user don't have the ~/mailrc
From mailx manpage:
Code:
smtp      Normally, mailx invokes sendmail(8) directly to transfer messages.  If the smtp variable is set,
              a SMTP connection to the server specified by the value of this variable is used instead.  If the
              SMTP server does not use the standard port, a value of server:port can be given, with port as  a
              name or as a number.
So mailx uses the sendmail binary (postfix has one too) to submit the message. Message is then sent by the MTA (postfix in your case). It's the MTA that uses dns to find the MX server of the recipient in order to deliver the message.

Quote:
Maybe mailx get the SMTP Server by a dns from /etc/resolv.conf??
No. As mentioned above, it's the MTA that uses dns to find the MX server of the recipient domain


Quote:
Has to do something the route in /etc/sysconfig/network-scripts?
Nope
 
Old 11-09-2014, 10:57 AM   #3
inyourmind
LQ Newbie
 
Registered: Jul 2014
Posts: 4

Original Poster
Rep: Reputation: Disabled
Ok i get it.
If i had a right configuration of DNS but postfix don't reach any MX Server, is it possible that i have to configure a route?
 
Old 11-09-2014, 12:08 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by inyourmind View Post
Ok i get it.
If i had a right configuration of DNS but postfix don't reach any MX Server, is it possible that i have to configure a route?
If you have a right dns configured, then your box (and postfix of course) should be able to find the MX record of the recipient domains.
Most likely you need to use your ISP mailserver as a relayhost, because usually ISPs block port 25 traffic. If that's the case, use:
Code:
relayhost = mail.my-isp.com
If you need authentication to connect to your ISP mailserver, have a look here

Regards
 
  


Reply

Tags
redhat, smtp



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] using mailx to send an attachment in Redhat 6 bachmanne Linux - Newbie 1 09-18-2014 12:37 PM
TO ANYONE USING MAILX (mailx 12.1). stf92 Linux - Software 22 07-08-2010 09:44 PM
Need to install Mailx on Redhat ES 3 mwlaursen@aol.com Red Hat 4 06-28-2008 02:42 PM
mailx pramka SUSE / openSUSE 3 05-01-2008 04:18 PM
mailx csaunders Red Hat 1 05-23-2007 08:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:19 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration