Find the answer to your Linux question:
Results 1 to 7 of 7
I have configured a Sendmail mail server on Red Hat Linux 9.0 for our own usage. In order to discourage improper mail usage (to keep a tab on the staffs ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2004
    Posts
    2

    BCC from within Sendmail


    I have configured a Sendmail mail server on Red Hat Linux 9.0 for our own usage. In order to discourage improper mail usage (to keep a tab on the staffs using the mail service for sending out personal mails) as well as
    for keeping a copy of all mailing transactions on a backup system, we
    want to configure the mail server so that the POSTMASTER gets a copy of
    all incoming and outbound mails.

    Is there any way so that all incoming mails that are downloaded from my ISP's server are forwarded to the POSTMASTER email address, as well as the user for which it is intended to. For example, if someone from xyz@abc.com sends a mail to a user on my domain (user@mydomain.com), the user gets the mail, and a copy of the same email is automatically forwarded to postmaster@mydomain.com.

    Similarly, can we configure Sendmail so that if any user on my domain sends an outbound mail, a copy of the same is sent to the Postmaster.

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    Hmm... I don't really approve of this behavior - I think it is wrong to save other peoples conversations. There is something called privacy, after all. If someone would send you a complaint of an abusive mail sent from your server, you could still track down who sent it from the message ID and the mail log file. If you want to audit mail usage, there are other, less intrusive, ways of doing that. If it isn't that you pay per sent byte or something like that, I don't see anything wrong with letting employees send personal mail.

    In any case, I'll still give you the solution in case you want to go through with it anyway. For inbound mails, it's really easy. Just add a procmail recipe to /etc/procmail that looks like this:
    Code:
    :0c
    !postmaster
    That will forward the mail to postmaster. If I were to do this, I'd prefer that procmail would create a maildir archive, though, like this:
    Code:
    :0c
    /root/mailarchive/
    You also need to create the /root/mailarchive directory in that case.

    As for saving outbound mails, that's a bit harder. Outbound stuff doesn't go through procmail, so you'll likely need a sendmail rule for that. The sendmail config format isn't really easy to remember, though, so I won't give you such a rule right now. Please tell me if you really, really want one, and I'll try to find the documentation.

  3. #3
    Just Joined!
    Join Date
    Jan 2004
    Posts
    2
    I do understand that its wrong to look for other people's conversations, but in this case, we really don't want to use the mailing system for anything other than for official purposes and we also want to keep a backup copy of all mailing transactions,centrally at the server.

    Hence I shall be really thankful if you can manage to find the Sendmail documentation to facilitate the forwarding of all outoing mails.





    Quote Originally Posted by Dolda2000
    Hmm... I don't really approve of this behavior - I think it is wrong to save other peoples conversations. There is something called privacy, after all. If someone would send you a complaint of an abusive mail sent from your server, you could still track down who sent it from the message ID and the mail log file. If you want to audit mail usage, there are other, less intrusive, ways of doing that. If it isn't that you pay per sent byte or something like that, I don't see anything wrong with letting employees send personal mail.

    In any case, I'll still give you the solution in case you want to go through with it anyway. For inbound mails, it's really easy. Just add a procmail recipe to /etc/procmail that looks like this:
    Code:
    :0c
    !postmaster
    That will forward the mail to postmaster. If I were to do this, I'd prefer that procmail would create a maildir archive, though, like this:
    Code:
    :0c
    /root/mailarchive/
    You also need to create the /root/mailarchive directory in that case.

    As for saving outbound mails, that's a bit harder. Outbound stuff doesn't go through procmail, so you'll likely need a sendmail rule for that. The sendmail config format isn't really easy to remember, though, so I won't give you such a rule right now. Please tell me if you really, really want one, and I'll try to find the documentation.

  4. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    To be honest with you, I cannot really figure out how to do this using sendmail. No matter how hard I think, I cannot come up with a way to make sendmail duplicate an envelope. That is the very problem - duplicating the envelope.
    If anything, I was thinking that it might be possible to make sendmail route the message through procmail, which will duplicate the envelope and set a special header, send it back to sendmail which passes it through due to the extra header.
    However, I have to admit that I'm not as good with sendmail as I'd like to be (yet), and I simply don't know what sendmail rulesets to use to check through the headers.

    It may well be possible using a MTA other than sendmail, but I haven't used any other, and thus cannot recommend one. Maybe someone else has experience with other mailers and can help you out.

    Most annoying. Sorry I couldn't help further.

  5. #5
    Just Joined!
    Join Date
    Oct 2006
    Posts
    18
    yes I have done this in postfix, another MTA.
    Option is "always_bcc=someone@somedomain.xxx"
    Try and see.
    thanks

  6. #6
    Just Joined!
    Join Date
    Oct 2006
    Posts
    18
    I have done this with sendmail and qmail. You need to search the source and edit it. Its really bit difficult. But can do with some knowledge in c. Try and see.

  7. #7
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    Hi all2dark !

    This thread is very old and I dont think Thread Starter needs any kinda suggestion right now. Please post suggestions in a bit recent threads. Locked.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •