Unable to send mail through mailx


 
Thread Tools Search this Thread
Operating Systems Solaris Unable to send mail through mailx
# 1  
Old 04-17-2012
Unable to send mail through mailx

Hi,

I am using solaris 5.9 OS and I am facing an issues with mailx.

My SMTP port is configured to listen 6190 and not the default one which is 25. I can send mail to my inbox when i do it manually through the following steps
Code:
root@<dbname> # telnet 15.12.88.10 6190
Trying 15.12.88.10...
Connected to 15.12.88.10.
Escape character is '^]'.
220 <Domain name>.com Trend Micro InterScan Messaging Security Suite, Version: 5.7 ready at Wed, 18 Apr 2012 10:20:00 +0800
helo
250 <Domain name>.com Hello [15.12.88.201]
mail from : apsprd@domainname.com
250 apsprd@sshcorp.com: Sender Ok
rcpt to : srinath@domainname.com
250 srinath@ksenergy.com.sg: Recipient Ok
DATA
354 <Domain name>.com: Send data now.  Terminate with "."
Subject: Test mail
This is a test mail
Just ignore
.
250 <Domain name>.com: Message accepted for delivery
quit
221 <Domain name>.com closing connection. Goodbye!
Connection to 15.12.88.10 closed by foreign host.

But when i use mailx I am unable to receive the mail
Code:
root@sshldb # echo "this is the body" | mailx -v -s "Test mail" srinath@<domain name>.com
root@sshldb # srinath@<domain name>.com... Connecting to [127.0.0.1] via relay...
220 sshldb.sshcorp.com ESMTP Sendmail 8.13.8+Sun/8.13.8; Wed, 18 Apr 2012 10:43:51 +0800 (SGT)
>>> EHLO <domain name>.com
250-<domain name>.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-EXPN
250-VERB
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> VERB
250 2.0.0 Verbose mode
>>> MAIL From:<apsprd@<domain name>.com> SIZE=84
250 2.1.0 <apsprd@<domain name>.com>... Sender ok
>>> RCPT To:<srinath@<domain name>.com>
>>> DATA
250 2.1.5 <srinath@<domain name>.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
050 <srinath@<domain name>.com>... Connecting to 15.12.88.10 via relay...
050 220 sshcorp.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.4675 ready at  Wed, 18 Apr 2012 10:25:43 +0800
050 >>> EHLO <domain name>.com
050 250-<domain name>.com Hello [15.12.88.201]
050 250-AUTH=LOGIN
050 250-AUTH LOGIN
050 250-TURN
050 250-SIZE 31457280
050 250-ETRN
050 250-PIPELINING
050 250-DSN
050 250-ENHANCEDSTATUSCODES
050 250-8bitmime
050 250-BINARYMIME
050 250-CHUNKING
050 250-VRFY
050 250 OK
050 >>> MAIL From:<apsprd@<domain name>.com> SIZE=370
050 530 5.7.3 Client was not authenticated
050 <apsprd@<domain name>.com>... Connecting to local...
050 220 sshldb LMTP ready
050 >>> LHLO sshldb.sshcorp.com
050 250-sshldb
050 250-8BITMIME
050 250-ENHANCEDSTATUSCODES
050 250 PIPELINING
050 >>> MAIL From:<>
050 250 2.5.0 ok
050 >>> RCPT To:<apsprd>
050 >>> DATA
050 250 2.1.5 ok
050 354 go ahead
050 >>> .
050 250 2.1.5 apsprd OK
050 <apsprd@<domain name>.com>... Sent
250 2.0.0 q3I2hpF9019329 Message accepted for delivery
srinath@<domain name>.com... Sent (q3I2hpF9019329 Message accepted for delivery)
Closing connection to [127.0.0.1]

In one of the above lie i could notice the error
Code:
050 >>> MAIL From:<apsprd@<domain name>.com> SIZE=370
050 530 5.7.3 Client was not authenticated

This is because the smtp is tryiong to connect to port 25 and hence getting this error.

Can somebody help me on how to change the default port number for smtp. I also tried changing the below lines in sendmail.cf but that doesnt help
Code:
O DaemonPortOptions=Name=MTA-v4, Family=inet
O DaemonPortOptions=Name=MTA-v6, Family=inet6
O DaemonPortOptions=Port=6190, Name=MSA, M=E

where the port number was 587 initially

Moderator's Comments:
Mod Comment Please use code tags

Last edited by jim mcnamara; 04-19-2012 at 12:39 AM.. Reason: code tags
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Unable to send mail with 'mail' command

I am unable to cause the 'mail' command to send mail from my linux ubuntu 15.10 computer. File 'mail.log' typically reports Connection timed out. I issue the command: mail -s "my subject" recipient@domain.com < filenamewhere filename is a file containing my message. Specifically, the... (3 Replies)
Discussion started by: tcnm
3 Replies

2. UNIX for Dummies Questions & Answers

Unable to send attachment using mailx command

I am unable to send email with attachment using the mailx command. Without the attachment, the email goes through file. This is the command I use. Works : $ echo "Test" | mailx -s "Test" username@website.com Fails : $echo "Test" | mailx -a all-dss-accounts.txt -s "Test"... (3 Replies)
Discussion started by: nkarthik_mnnit
3 Replies

3. Shell Programming and Scripting

Not able to send the mail using mail and mailx command

Hi All, I am trying to send a mail from linux server but could'nt able to send the mail. I tried the below syntax's so far but no luck. mail -s Hello world abc@xyz.com < /usr/g/txt.log cat "txt.log" | mailx -s "Hello world" abc@xyz.com mailx -s Hello world abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies

4. Shell Programming and Scripting

Mailx command - send mail as table format

I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong. Intended Output in mail body: Col1 Col2 Col3 ------ ... (2 Replies)
Discussion started by: qwertyu
2 Replies

5. Shell Programming and Scripting

Send mail using mailx to CC only, not TO

Hi All, I am using mailx to send the mail. Due to some changes in the requirement, I need to send the mail to CC only (an Email id in CC), with no email ID in "TO" field. Can we do that? bcz I used -c flag only and got the message:":The flags you gave make no sense since you're not sending... (2 Replies)
Discussion started by: unankix
2 Replies

6. Linux

mailx: Unable to send Japanese

Hi All, I am facing problem in sending Japanese characters using mailx command in GNU linux machine. The mail is going with junk characters like "メールの-界へようこそ". I tried changing the LANG value to japan locale off UTF-8. But it doesn't worked. I have to send the data as body not as an... (0 Replies)
Discussion started by: Karteek
0 Replies

7. Shell Programming and Scripting

send attachment and body in one mail using mailx

Hi, Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement. --------------------- (uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients -------------------- I m not able to send any message in the... (4 Replies)
Discussion started by: ashwin3086
4 Replies

8. UNIX for Advanced & Expert Users

how to send file as attachment using mail or mailx

I have a need to send a file from the unix command line to be sent as an attachment. Is this possible? That is when I open my outlook email I need to file to appear as an attachment. Also, is there a way to use the mail binary (not mailx) to modify the "reply address". mailx -r works but I need... (1 Reply)
Discussion started by: kieranfoley
1 Replies

9. UNIX for Dummies Questions & Answers

Unable to send e-mail using mailx command

Hi All, Can you please help me in solving this. I am facing some problem sending mails. If I use like this, I am able to send mail the mail echo "This is an automated e-mail; please do not reply." | mailx -s "Good Morning ." 'abc@xys.com' But if I use like this, then I am unable to send... (1 Reply)
Discussion started by: manas6
1 Replies

10. Shell Programming and Scripting

UNABLE to send 5MB attachment using mailx

hi, i've created a script that sends out an email using the mailx and uuencode command. the script is ok, but when a 5MB attachment is sent, there are time that the intended recepients does not receive any email. i tested it and the issue is intermitent. please help on how to troubleshoot. i... (3 Replies)
Discussion started by: tads98
3 Replies
Login or Register to Ask a Question