Having a mailx oddity with BCC.

Asked by:
HubFans / n/a Points
Time:
2016-01-09 4:03 pm EST
Category:
Everything Email
Hits:
44
Got a cron job. Here's an edited example of what goes on. Duh_Snoops="aname@somewhere.com,bname@gmail.com"
Duh_Listing is the names of attachments, Duh_Subject and Duh_Stoopid.msg are text strings. Issue a mail command:
mailx $Duh_Listing -r me@mydomain.com -s "`echo $Duh_Subject`" < Duh_Stoopid.msg -b $Duh_Snoops me@mydomain.com
As you can see it's supposed to Bcc to a couple of accounts. What happens is that the message arrives in all the appropriate places, except the Bcc shows all the names/addresses. Both locally and at a gmail account. Been running a version of this for years, using various flavors of Windows/BSD/Linux. Never had a problem with Bcc before. There's no error messages to help either.

To ask this user for more information, please first login.

To submit an answer, please login.

ANSWERS

0

ScottM
Staff
16,266 Points
2016-01-11 11:07 am EST
Hello,

Sorry to hear you are having an issue with mailx not working with the BCC correctly. I did a few tests on my own server and had to tweak the command just a bit to get it to work. At first, all recipients could see the BCC list. After adding "-S smtp=localhost" right after "mailx" then it worked correctly. Below is a form of the sample I used:

mailx -S smtp=localhost -r me@example.com -b scott@example.com scottm@myrealdomain.com

The email came to my email FROM me@example.com to my scottm@myrealdomain.com and the BCC for scott@example.com did not display. The BCC domain was confirmed to have received the email as it should.

I then tested it from your specific server and it was also successful. Give that a try and it should work for you.

Kindest Regards,
Scott M

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: support@WebHostingHub.com Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.