Originally Posted by dennismonsewicz
So if user is logged in and they run the script it tries to send the email to firstname.lastname@example.org
That's weird, but it's difficult to find out the reason without viewing the actual script. Re-reading your previous post, I have some doubt on the correctness of the command line. First, uuencode should send its output to standard output
in order to pipe it to the mail command (correct me if I'm wrong). Second, the option -a 'FROM:email@example.com'
looks strange to me, but maybe it depends on the specific mail client used.
In the meanwhile, let me to suggest an alternative method which uses another "uu" application called uudeview
. I'm used to send binary attachments in the following way and I've never had an issue:
subject="This is the subject"
/usr/bin/uuenview -m "$recipient" -f "$sender" -s "$subject" -a attachment_file_name << EOF
This is the e-mail body.
Note that uudeview is the name of the package, whereas the encoding command is uuenview. Moreover uuenview takes care to pipe the mail to sendmail for you (without need to explicitly pipe it to the mail command). Just my
A little hint: I hope the e-mail you wrote in post #1 is not real, otherwise better to change it into a fictional address!