Of course, sorry my reply wasn't clear but that was understood, however I do very much appreciate that you clarified this.
Just to clarify things a bit more, here's how you can change the "From: " address using plain mailx(1)
.
Make sure that you give a valid from address so that rejected emails can be seen.
Send mail with your Gmail address:
$ mail you@your-company.com -f you@gmail.com
Now, if you check your your-company.com
emails you may, or may not , see the mail sent with your Gmail address. The your-company.com
email server (MTA) can:
a) Accept the mail for delivery (valid domain, even if coming from a non-domain address)
b) Accept, but, force a delay (reason: valid domain, but, comes from a non-domain address). In this case, your local MTA, postfix
, will keep the mail in queue, and retry after the grey-listing delay.
c) Reject outright (reason: valid domain, but, comes from a non-domain address: Looks like Spam, spam, spam, lovely spaaam).
d) Accept it, then chuck it away quietly.
In cases a) & b) the message might end up in a Spam
folder instead of the Inbox
.
Without the -f email-addr
option (which is actually an MTA option), all mail servers will simply reject the message--what the heck is ...@hostname.localdomain
?
Try these tests, if you care:
$ mail you@gmail.com -f you@yahoo.com
Gmail will reject outright. Check on Yahoo for rejection.
$ mail you@yahoo.com -f you@gmail.com
Yahoo will accept, but, drop the message into Spam
.
$ mail you@gmail.com -f you@gmail.com
Here, the rejection message itself will be rejected. Who, then, gets that message?--Exercise left for reader.
Given all these problems, you can see why I suggested configuring and using modern MUAs like alpine
or mutt
.