2

a linux machine executes a cron job for a script every night that does a backup, this should then send an email to us with the basic results. However since moving to a spam filtering platform its stopped working because the format is root@maintainence and as its not a fully formed email it wont get through.

I have done some reading about adding an alias, however the commands and files dont exist. I dont know what it uses to actually to send emails or where i should start looking

Thanks in advance!

1 Answer 1

0

You can change the from address using mailx. Mailx is a Unix command line utility used to send emails from the command line. It is just a newer version of the mail command. If you do not have mailx, you can get it by running

sudo apt-get install mailutils 

To send an email with a different from address, use mailx like this

echo 'This is the email body.' | mailx -a 'From:name <the_email_address>'  -s 'a subject if needed'

Aliases are used for when you want to have multiple email addresses for the same email, which does not apply to you in this situation. You can learn more about mailx by using

man mailx
2
  • 1
    Could you expand yr answer slightly by providing info on mailx? Is it a MUA or a wrapper ? What is its main usecase ? With what MTA does it work ? Does it require config. No need to go into detail -- this is just for the sake of making yr answer more complete.).
    – Cbhihe
    May 8, 2016 at 6:18
  • I edited my answer and made it a little more complete.
    – Andrew
    May 8, 2016 at 7:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .