Operating System - Linux
1820879 Members
5312 Online
109628 Solutions
New Discussion юеВ

Creating a Bcc: for each outbound sendmail message

 
Brian Watkins
Frequent Advisor

Creating a Bcc: for each outbound sendmail message

Hi all,

Is there a way to have sendmail automatically Cc: or Bcc: all outgoing messages to a separate e-mail account?

In other words, whenever a message to joe.blow@this.domain.net goes out, I want sendmail to CC:/Bcc: the message to big.brother@corp.net.

I'm running sendmail 8.11 in a RHEL 2.1AS environment.
I'd prefer not using a 3rd party tool (like milter). We already have enough 3rd party apps to manage :)

If anyone knows of a macro or ruleset that I can create to do this, I would be most appreciative!

Thanks in advance for your time and assitance,

Brian

8 REPLIES 8
Rick Garland
Honored Contributor

Re: Creating a Bcc: for each outbound sendmail message

Doing from the command line, use the -b option
mail rg@someaddress.com -b gr@someotheraddress.com

The -b option tells it to go bcc.
(man sendmail)

If you are using some mail client, there will be some tools option you can modify
Brian Watkins
Frequent Advisor

Re: Creating a Bcc: for each outbound sendmail message

Rick,

Thanks for the idea, but I would like sendmail to do this automatically, without any user intervention or mail client configuration.

We're wanting this to automatically send a copy of the outbound e-mail from the originating server to an "archive account" on a separate mail server for historical purposes.
Florian Heigl (new acc)
Honored Contributor

Re: Creating a Bcc: for each outbound sendmail message


Hehe, You're in the US, here in Germany that setup would be a very straight way to the court ;)

unfortunately I still don't find my way through sendmail.cf, but I'd recommend You to have a try at news://comp.mail.sendmail

florian
yesterday I stood at the edge. Today I'm one step ahead.
Rick Garland
Honored Contributor

Re: Creating a Bcc: for each outbound sendmail message

For something like this, setting up an alias would work. Keep the original functionality but add that automatic function as well by using a slighty different command.

Brian Watkins
Frequent Advisor

Re: Creating a Bcc: for each outbound sendmail message

Yes, creating aliases would work. However, the recipient addresses vary from week-to-week and there are several hundred individual addresses. That would make for a rather large aliases file which would require a lot of management.

I've been researching this since yesterday, and it appears the only "efficient" way to do this is with a 3rd part application (like milter or similar) or to run postfix in conjunction with sendmail.

The best overall option seems to be configuring the SMTP gateway to automatically copy all mail it receives from these 2 Linux hosts to an archive folder as it forwards the message to its destination address.

Thanks again for your thoughts and ideas! That's what makes the ITRC forums so great :)

Brian
Stuart Browne
Honored Contributor

Re: Creating a Bcc: for each outbound sendmail message

I've not tried using it for this, but look at the 'virtual user table'. You may be able to tweak that to automatically generate copy messages..

BUt if you just want to alter the envelope.. well, yea, horrible sendmail rules..
One long-haired git at your service...
Brian Watkins
Frequent Advisor

Re: Creating a Bcc: for each outbound sendmail message

Stuart,

Given the large number of outbound e-mail addresses that will be processed and the frequency of those addresses changing, using a virtual users table will present a similar problem to using aliases.

It's really starting to sound like the best solution (read: least complicated) is to have our Notes admins configure the SMTP gateway to copy all mail originating from these 2 servers to an archive folder and then forward the mail to its final destination. I don't want to end up breaking sendmail by messing with the rules and hosing everything up.

If there are any sendmail "super-gurus" out there, they may know of a rule or macro that could do this....

If the user count/change frequency wasn't so great, that's the way I'd probably go.
Stuart Browne
Honored Contributor

Re: Creating a Bcc: for each outbound sendmail message

sendmail mailing lists, or news groups *nod*.

It's something I'm sure has been done before..

Don't forget that the virtual-user-table takes wildcards.. %1 etc...
One long-haired git at your service...