I would like to send (batch) emails from a linux (ubuntu, postfix) command line.
I would like to include a bcc header (that actually sends the mail to this address), and
I would like to give a from: address.
I do not need attachments, text only. However, unicode support would be nice (not essential).
I would like a solution that is simple and robust (less important: will works on other machines/MTAs as well)
So far I tried:
- sendmail. This works great, but the BCC headier is ignored (which might be a postfix setting? I would not want to modify my postfix settings…
- mutt. can be used via command line, but then you have to create an own muttrc for the from: header, and there you might have to change some other settings too; again this does not seem very simple or robust.
- the old “mail” command does not seem to work as expected in newer versions, at least the one I get on ubunto does not recognice the -b (bcc) option.
Thanks for any input.
If you have a local mail server running (exim, sendmail, …) you can pipe a full, properly formatted message into it and it will be delivered. You must have a complete set of header (From:, To:, Cc:, Date: …), there must be a blank line after the headers and before the message text, e.g.
Most mailservers will pretend to be sendmail and will accept the -t flag.