Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

How do you specify the from field with emails sent with mail or mailx?

Eg, I am sending from the user 'test' on my system, but I want the email to be sent as 'noreply@example.org'.

Is this possible? I tried several ways but no joy.

I am using Ubuntu 12.04 LTS



I have tried the -r option and I tried ending the command with -- -f email@somedomain.org with no luck. Those were the only things I could find.

share|improve this question
What have you tried? Did you try the -r from-addr option from the first line of the man page? Tell us everything you have already tried. –  Ladadadada Nov 15 '12 at 13:27
Updated the OP with things I tried –  Newbzors Nov 15 '12 at 18:57
Good. Next question: How do you know it's not working? Error message? Log files? Bounced email? Email arrives but with the wrong From: address? –  Ladadadada Nov 15 '12 at 19:34
The email just comes form the user I am sending it from regardless of what I try to make it change which is strange. –  Newbzors Nov 16 '12 at 10:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.