Linux - SoftwareThis 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
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'm trying to send an automatic email to system users when there jobs are done on a queue. I've used sendmail but the program sends the messages to /var/spool/mail/<user> and not the user's real email address: user@somewhereelse.com.
Since I only want simple outbound emailing I don't think I need a full-blown email-server (perhaps I'm wrong). Is there a simple way to send email to users?
echo "You have a job X done" | mail -s "your job at queue X is done" user@somewhereelse.com
or even a multiline body message
Code:
mail -s "your job at queue X is done" user@somewhereelse.com <<EOM
Put your message here in theses lines.
You can use any shell variables too.
Your PATH is $PATH
regards,
EOM
In fact, it is correct. The normal behaviour is to connect to the localhost to delivery e-mail generated locally.
The localhost can be configured to send e-mails directly or to connect to a relay host to send e-mails.
In my setup here at work, I have this working in this way. The several servers can send e-mails directly and only the mailserver can accept incoming e-mails. It is up to you.
I can't help you with sendmail, because I use postfix for years.
In postfix there is a configuration file named transport where I set for what domains I can send e-mails directly or for what domains I need to relay e-mails.
You don't need to do anything at all. Just make sure your sendmail is enable and started. It's working right now. As long your company mail server will except mail from your Fedora box.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.