Mailx Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and linux mailx not sending emails policies of this site About Us Learn more about Stack Overflow the company
How To Check Mailx Is Working Or Not
Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users mailx not working Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a how to check mailx is working or not in linux minute: Sign up mailx function is not working up vote 1 down vote favorite 1 I am trying to use mailx function to send an e-mail to my personal email address.But I never received an email.Can someone help me pls. Here is my command below. PRI_EMAIL_SUBJECT="Some Blah Blah" PRI_EMAIL_ADDRESS="bobby.teja@gmail.com" PRI_EMAIL_BODY="$PRI_SETS_RAN_SUCSFL_CNT no. of sets ran successfully." echo "Sending e-mail" mailx -s $PRI_EMAIL_SUBJECT
Mailx Command Not Working In Linux
$PRI_EMAIL_ADDRESS < $PRI_EMAIL_BODY echo linux email unix mailx share|improve this question asked Feb 21 '13 at 15:59 Teja 4,627154374 1 add -v to mailx to see progress messages and find out where it's going... –twalberg Feb 21 '13 at 16:23 First run it on command line and test : echo "something" | mailx -v -s "subject" recipient@somewhere.com –Satish Feb 21 '13 at 16:23 Thanks Satish.It worked. :) –Teja Feb 21 '13 at 16:46 add a comment| 3 Answers 3 active oldest votes up vote 0 down vote accepted This perfectly works. echo "something" | mailx -v -s "subject" recipient@somewhere.com share|improve this answer answered Feb 21 '13 at 16:47 Teja 4,627154374 you steal my answer :( lol... –Satish Feb 21 '13 at 17:14 Hehe no bro.. I wanted to make it as an answer instead keeping it as comment. –Teja Feb 21 '13 at 18:13 that is fine i was kidding.. –Satish Feb 21 '13 at 18:23 add a comment| up vote 0 down vote Use the -d option of mailx for debug
Search Tutorials/Articles Search HCL Search Reviews Search ISOs Go to Page... LinuxQuestions.org > Forums > Non-*NIX Forums > Programming [SOLVED] Bash Shell program question - if error then mailx User Name Remember Me? Password Programming This forum is for all programming how to start mailx service in linux questions. The question does not have to be directly related to Linux and any language mailx command in unix not working is fair game. Notices Welcome to LinuxQuestions.org, a friendly and active Linux Community. You are currently viewing LQ as a guest. By joining
Mailx Configuration
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 http://stackoverflow.com/questions/15006711/mailx-function-is-not-working that registered members see fewer ads, and ContentLink is completely disabled once you log in. Are you new to LinuxQuestions.org? Visit the following links: Site Howto | Site FAQ | Sitemap | Register Now 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. Introduction to Linux - http://www.linuxquestions.org/questions/programming-9/bash-shell-program-question-if-error-then-mailx-937621/ A Hands on Guide This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter. For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own. Click Here to receive this Complete Guide absolutely free. Search this Thread 04-01-2012, 11:36 PM #1 khandu Member Registered: Sep 2003 Posts: 93 Rep: Bash Shell program question - if error then mailx Hey Guys Multiple questions Basically I am trying to write a shell script in bash which does the following 1) Does some export and zip -- this part is easy and done 2) create a folder if it does not exist 3) Move files to that folder in (2) 4) if an error happens in step (1-3) then send a mail (mailx) Now What I have figured is Code: start if loop start for loop for number of files do export fi
heirloom mailx command in Linux is still providing service for guys like me, especially when we need to send email automatically by script. gmail is great. Now, how to use gmail's smtp in mailx/mail? gmail is a little special http://www.systutorials.com/1411/sending-email-from-mailx-command-in-linux-using-gmails-smtp/ since gmail's smtp server requires tls authorization. The good news is that mailx supports it. Let's look at how to use it. First, find out Firefox's profile directory in the http://serverfault.com/questions/498588/smtp-gmail-com-from-bash-gives-error-in-certificate-peers-certificate-issuer home directory (I believe most of the users on Linux use Firefox. If you are not using Firefox, what you need to do is try it ;) . It how to has a format like this:~/.mozilla/firefox/yyyyyyyy.defaultyyyyyyyy is a random string that's different for different users. You can easily find it out by looking into the directory ~/.mozilla/firefox.There are two ways to do this: using all-in-one command or putting configurations into profile. The all-in-one-command way needs no other configurations except the command line itself, while the way using configuration has a how to check clearer command.All-in-one commandThis is an all-in-one command that sends email to $TO_EMAIL_ADDRESSmailx -v -s "$EMAIL_SUBJECT" -S smtp-use-starttls -S ssl-verify=ignore -S smtp-auth=login -S smtp=smtp://smtp.gmail.com:587 -S from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)" -S smtp-auth-user=$FROM_EMAIL_ADDRESS -S smtp-auth-password=$EMAIL_ACCOUNT_PASSWORD -S ssl-verify=ignore -S nss-config-dir=~/.mozilla/firefox/yyyyyyyy.default/ $TO_EMAIL_ADDRESSReplace the $XXX with the value that is actually used. The meaning is obvious. And remember to change yyyyyyyy to the string that's part of the Firefox profile directory.This command will ask for the email content. Type in the mail content and after finishing the email, use "Ctrl+d" to tell mailx you have finished. Then this mail will be sent out through gmail's smtp server. You can also use pipe like this:echo "The mail content" | mail -v -s ...Use configuration fileThere are too many options in the above command? Yes… I must confess so. We can write most of them into mailx/mail's configuration file ~/.mailrcset smtp-use-starttls set nss-config-dir=~/.mozilla/firefox/yyyyyyyy.default/ set ssl-verify=ignore set smtp=smtp://smtp.gmail.com:587 set smtp-auth=login set smtp-auth-user=$FROM_EMAIL_ADDRESS set smtp-auth-password=$EMAIL_ACCOUNT_PASSWORD set from="$FROM_EMAIL_ADDRESS($FRIENDLY_NAME)"Change the $YYYY and yyyyyyyy to the right value for you. When sending mails, use this command:$ mailx -v -s "$EMAIL_SUBJECT" $TO_EMAIL_ADDRESSThen, tim
Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Server Fault Questions Tags Users Badges Unanswered Ask Question _ Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute: Sign up Here's how it works: Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top smtp.gmail.com from bash gives “Error in certificate: Peer's certificate issuer is not recognized.” up vote 6 down vote favorite 5 I needed my script to email admin if there is a problem, and the company only uses Gmail. Following a few posts instructions I was able to set up mailx using a .mailrc file. there was first the error of nss-config-dir I solved that by copying some .db files from a firefox directory. to ./certs and aiming to it in mailrc. A mail was sent. However, the error above came up. By some miracle, there was a Google certificate in the .db. It showed up with this command: ~]$ certutil -L -d certs Certificate Nickname Trust Attributes SSL,S/MIME,JAR/XPI GeoTrust SSL CA ,, VeriSign Class 3 Secure Server CA - G3 ,, Microsoft Internet Authority ,, VeriSign Class 3 Extended Validation SSL CA ,, Akamai Subordinate CA 3 ,, MSIT Machine Auth CA 2 ,, Google Internet Authority ,, Most likely, it can be ignored, because the mail worked anyway. Finally, after pulling some hair and many googles, I found out how to rid myself of the annoyance. First, export the existing certificate to a ASSCII file: ~]$ certutil -L -n 'Google Internet Authority' -d certs -a > google.cert.asc Now re-import that file, and mark it as a trusted for SSL certificates, ala: ~]$ certutil -A -t "C,," -n 'Google Internet