PDA

View Full Version : how to change the from address when sending email on cli?


ganzelini
05-03-2006, 05:15 PM
pretty much sums it up... I am using Tiger and am wondering how to change the from address (for my user) when I am sending mail from the cli.

right now it sends from username@computername.local, can I change this to something meaningful?

thanks.

acme.mail.order
05-03-2006, 05:43 PM
Depends entirely on the mail agent you use. `mail` doesn't look like it does this, but sendmail/postfix will do pretty much whatever you tell them. Just build a header with a "From: ......." directive, or use one of the command line options. See the manual for the appropriate program for the option and syntax to use.

Raven
05-04-2006, 11:01 AM
Indeed Mail only seems to have a separate "Reply To field"
One thing you could do though is to create a fake POP account leading to nowhere in Mail, make sure it doesn't get checked for new emails (would give errors each time otherwise) and make sure the email address for it is the From address you wish to use. That way in Mail, you'll have when creating a new email an drop down menu asking which account to send from... BUt becarefull to have a proper return address too.

ganzelini
05-04-2006, 11:08 AM
by mail, i am referring to the commandline program mail

Raven
05-04-2006, 12:05 PM
Ah ! Sorry don't use it so I don't know if its even possible.

voldenuit
05-04-2006, 12:20 PM
There are far better MUAs around such as mutt or pine.
mail is really stone knives and bearskins ;) .

Raven
05-04-2006, 12:30 PM
Here (http://forums.macosxhints.com/showthread.php?t=40757) is a nice thread about other CLI mail clients started by none other than voldenuit himself ;)

ganzelini
05-04-2006, 12:31 PM
There are far better MUAs around such as mutt or pine.
mail is really stone knives and bearskins ;) .

all i am doing is mailing from a script, but i will look into mutt as i used it back in the day when i was on linux and LIVED in the CLI.

acme.mail.order
05-04-2006, 07:45 PM
Great if it's your machine, but if you are trying to write portable code then the more omnipresent ones are a better choice. Sendmail may be a dinosaur, but it's THERE. Creating a header really isn't that difficult, I just dissect a real message and extract what's needed.