How to check whether I can send mail from my Linux server?











up vote
1
down vote

favorite












When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?



When I tried to see help for mail and mailx, I found below message:



[root@ukwcrbmorctd01 test_ezradsx]# mail --help
mail: illegal option -- -
Usage: mail -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
[root@ukwcrbmorctd01 test_ezradsx]# mailx --help
mailx: illegal option -- -
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users "


Does the server I use support mail or mailx?



This is the log file.



Oct 11 12:12:53 abcpostfix/smtp[31869]: connect to abci1012.abc.net[10.209.205.31]:25: Connection timed out
Oct 11 12:12:53 abc01postfix/smtp[31869]: 2FC2D38A9C: to=<s.radhakrishnan@abc.com>, relay=none, delay=969, delays=939/0.06/3









share|improve this question




















  • 1




    What command do you use to send emails?
    – Egor Vasilyev
    Oct 11 '17 at 10:24






  • 2




    You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
    – Raman Sailopal
    Oct 11 '17 at 10:30












  • echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
    – Radhakrishnan Rk
    Oct 11 '17 at 10:58








  • 1




    Do you check log files? See /var/log/mail.log
    – Egor Vasilyev
    Oct 11 '17 at 11:02






  • 1




    Does iptables enabled on your server? Can you append your question with log file data?
    – Egor Vasilyev
    Oct 11 '17 at 11:26















up vote
1
down vote

favorite












When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?



When I tried to see help for mail and mailx, I found below message:



[root@ukwcrbmorctd01 test_ezradsx]# mail --help
mail: illegal option -- -
Usage: mail -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
[root@ukwcrbmorctd01 test_ezradsx]# mailx --help
mailx: illegal option -- -
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users "


Does the server I use support mail or mailx?



This is the log file.



Oct 11 12:12:53 abcpostfix/smtp[31869]: connect to abci1012.abc.net[10.209.205.31]:25: Connection timed out
Oct 11 12:12:53 abc01postfix/smtp[31869]: 2FC2D38A9C: to=<s.radhakrishnan@abc.com>, relay=none, delay=969, delays=939/0.06/3









share|improve this question




















  • 1




    What command do you use to send emails?
    – Egor Vasilyev
    Oct 11 '17 at 10:24






  • 2




    You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
    – Raman Sailopal
    Oct 11 '17 at 10:30












  • echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
    – Radhakrishnan Rk
    Oct 11 '17 at 10:58








  • 1




    Do you check log files? See /var/log/mail.log
    – Egor Vasilyev
    Oct 11 '17 at 11:02






  • 1




    Does iptables enabled on your server? Can you append your question with log file data?
    – Egor Vasilyev
    Oct 11 '17 at 11:26













up vote
1
down vote

favorite









up vote
1
down vote

favorite











When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?



When I tried to see help for mail and mailx, I found below message:



[root@ukwcrbmorctd01 test_ezradsx]# mail --help
mail: illegal option -- -
Usage: mail -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
[root@ukwcrbmorctd01 test_ezradsx]# mailx --help
mailx: illegal option -- -
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users "


Does the server I use support mail or mailx?



This is the log file.



Oct 11 12:12:53 abcpostfix/smtp[31869]: connect to abci1012.abc.net[10.209.205.31]:25: Connection timed out
Oct 11 12:12:53 abc01postfix/smtp[31869]: 2FC2D38A9C: to=<s.radhakrishnan@abc.com>, relay=none, delay=969, delays=939/0.06/3









share|improve this question















When I tried using mail or mailx with -r -s -a and other options, I am not able to send mail. Is there anything I need to check before sending mail from Linux server?



When I tried to see help for mail and mailx, I found below message:



[root@ukwcrbmorctd01 test_ezradsx]# mail --help
mail: illegal option -- -
Usage: mail -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users
[root@ukwcrbmorctd01 test_ezradsx]# mailx --help
mailx: illegal option -- -
Usage: mailx -eiIUdEFntBDNHRV~ -T FILE -u USER -h hops -r address -s SUBJECT -a FILE -q FILE -f FILE -A ACCOUNT -b USERS -c USERS -S OPTION users "


Does the server I use support mail or mailx?



This is the log file.



Oct 11 12:12:53 abcpostfix/smtp[31869]: connect to abci1012.abc.net[10.209.205.31]:25: Connection timed out
Oct 11 12:12:53 abc01postfix/smtp[31869]: 2FC2D38A9C: to=<s.radhakrishnan@abc.com>, relay=none, delay=969, delays=939/0.06/3






shell-script mailx mail-command






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 21 at 21:04









Rui F Ribeiro

38.2k1475125




38.2k1475125










asked Oct 11 '17 at 9:58









Radhakrishnan Rk

476




476








  • 1




    What command do you use to send emails?
    – Egor Vasilyev
    Oct 11 '17 at 10:24






  • 2




    You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
    – Raman Sailopal
    Oct 11 '17 at 10:30












  • echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
    – Radhakrishnan Rk
    Oct 11 '17 at 10:58








  • 1




    Do you check log files? See /var/log/mail.log
    – Egor Vasilyev
    Oct 11 '17 at 11:02






  • 1




    Does iptables enabled on your server? Can you append your question with log file data?
    – Egor Vasilyev
    Oct 11 '17 at 11:26














  • 1




    What command do you use to send emails?
    – Egor Vasilyev
    Oct 11 '17 at 10:24






  • 2




    You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
    – Raman Sailopal
    Oct 11 '17 at 10:30












  • echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
    – Radhakrishnan Rk
    Oct 11 '17 at 10:58








  • 1




    Do you check log files? See /var/log/mail.log
    – Egor Vasilyev
    Oct 11 '17 at 11:02






  • 1




    Does iptables enabled on your server? Can you append your question with log file data?
    – Egor Vasilyev
    Oct 11 '17 at 11:26








1




1




What command do you use to send emails?
– Egor Vasilyev
Oct 11 '17 at 10:24




What command do you use to send emails?
– Egor Vasilyev
Oct 11 '17 at 10:24




2




2




You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
– Raman Sailopal
Oct 11 '17 at 10:30






You will need to use something along the lines of echo "This is a test" | mailx -r "mrsender" -s "test" -a "testattachment.txt" somebody@somewhere.com
– Raman Sailopal
Oct 11 '17 at 10:30














echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
– Radhakrishnan Rk
Oct 11 '17 at 10:58






echo "Message_body" | mailx -s "test" s.radhakrishnan@abc.com and tried this command too. echo "Message_body" | mailx -r "d.dinesh@abc.com" -s "test" s.radhakrishnan@abc.com
– Radhakrishnan Rk
Oct 11 '17 at 10:58






1




1




Do you check log files? See /var/log/mail.log
– Egor Vasilyev
Oct 11 '17 at 11:02




Do you check log files? See /var/log/mail.log
– Egor Vasilyev
Oct 11 '17 at 11:02




1




1




Does iptables enabled on your server? Can you append your question with log file data?
– Egor Vasilyev
Oct 11 '17 at 11:26




Does iptables enabled on your server? Can you append your question with log file data?
– Egor Vasilyev
Oct 11 '17 at 11:26















active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397414%2fhow-to-check-whether-i-can-send-mail-from-my-linux-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown






























active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes
















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397414%2fhow-to-check-whether-i-can-send-mail-from-my-linux-server%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

サソリ

広島県道265号伴広島線

Setup Asymptote in Texstudio