1

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
  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.