Transition from UNIX to Linux and in sendmail purgatory
Good afternoon,
New to Linux (since Monday) and have encountered a few things with sendmail that need some solutions to. Bit of background. We took our same sendmail construct from UNIX in LINUX. Basic code structure is as follows ------------ mpack -s "Morning Report" -d <report text body> -o <report tempfile> morningspreadsheet.xls /usr/sbin/sendmail -f <sender address> <recipient address> < <report tempfile> ------------- It will send the email but we have noticed the following 1.) the "To" tag is currently always blank 2.) the "From" does not show a from name but it shows the name of the process that is running with the recipient address. For example "root (personwhoworkshere@thiscompany.com)" instead of "My Name (personwhoworkshere@thiscompany.com)" Is there any means of working with the current options to get the "To" tag to show and fix the name of the "From"? So far we have deduced that we will have to create a text with this information in it in order to do. However, if there is a way to do this without having to update a few hundred text files that would be great. Thanks! RIP |
sendmail should behave the same in Linux as it does in Unix: the source is the same.
The sendmail command you specify doesn't set a recipient in the header; use the -t switch. Use the -F switch to set the sender's 'full name'. Different e-mail clients show different 'from' for the same message. Different recipients are seeing it differently. Perhaps you have a different sendmail.cf - though I don't know what differences would cause the difference you report. |
Welcome to Linux and LQ,
You should specify your distro, so we could help you better. Depending on distro, if sendmail is not installed, the sendmail command is linked to a compatibility binary of the installed smtp server s/w (like postfix, qmail, exim etc). So while for the real sendmail, the -f switch is correct and it should work in your example, in the compatibility binaries it may not work. That said, you can use mutt, or mail/mailx to do your job. E.g: Code:
EMAIL=<sender address> mutt -s "Morning Report" <recipient address> < <report tempfile> |
Quote:
|
Quote:
|
Whoops! You have read the man page correctly. I set up programs to do this automatically years ago and forgot what the -t switch does. Sorry.
I use echo to prepend recipients and subject to a dummy file, concatenate the message to that dummy file, then send it with -t. For example: Code:
|
Quote:
But again it depends on distro, that's why I've asked you to tells us the Linux distribution you're running. Anyway if you don't want to use mutt as in my example above, read the manpage of mail/nail/mailx (whatever your distro uses) to find the correct options. Regards |
I agree with Bathory, tell us your distro.
A lot of modern distros have moved on eg RHEL derived systems have moved on to postfix. Even if if you then install sendmail, it might not actually be what's running. |
Quote:
|
Quote:
Quote:
|
Quote:
|
There's no reason you can't install sendmail. I customize sendmail.mc so I build my own. It's not onerous.
|
Quote:
|
All times are GMT -5. The time now is 02:37 AM. |