LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-19-2013, 05:55 AM   #1
tonmoy
LQ Newbie
 
Registered: Apr 2013
Location: Dhaka, Bangladesh
Distribution: CentOS, Red Hat
Posts: 28

Rep: Reputation: 2
Problem in sending copy of a mail to another email address


Dear All:
In my mail server [Postfix+Dovecot], I wish that admin will have a copy of all incoming emails of all users. I can accomplish my need by the below commands.

Quote:
[root@redbox ~]# vi /etc/aliases

# Person who should get root's mail
#root: marc

accounts: admin accounts
logistic: admin logistic
jack: admin jack
katha: admin katha
joe: admin joe
laila: admin laila
chopol: admin chopol

[root@redbox ~]# newaliases
Now, the problem is if someone sends mail to both of accounts and admin, the admin user gets two copies of same mail in his inbox. It even be 4/more copies of a same email in his inbox if the mail's recipients are 4/more from the list. Now, the admin need to get only one copy of that mail whether the recipients contain admin user or any one/more user from the list. Please suggest me how I can do that...

Last edited by tonmoy; 06-19-2013 at 05:58 AM.
 
Old 06-19-2013, 09:01 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tonmoy View Post
Dear All:
In my mail server [Postfix+Dovecot], I wish that admin will have a copy of all incoming emails of all users. I can accomplish my need by the below commands.


Now, the problem is if someone sends mail to both of accounts and admin, the admin user gets two copies of same mail in his inbox. It even be 4/more copies of a same email in his inbox if the mail's recipients are 4/more from the list. Now, the admin need to get only one copy of that mail whether the recipients contain admin user or any one/more user from the list. Please suggest me how I can do that...
Things are working exactly as you have them set up. So, you have three choices:
  • Don't read other peoples emails without their knowledge, and remove the admin forwarding
  • Learn to live with multiple copies and hit the 'delete' key
  • Write a script to periodically remove duplicates
 
2 members found this post helpful.
Old 06-19-2013, 10:45 PM   #3
tonmoy
LQ Newbie
 
Registered: Apr 2013
Location: Dhaka, Bangladesh
Distribution: CentOS, Red Hat
Posts: 28

Original Poster
Rep: Reputation: 2
Quote:
Things are working exactly as you have them set up. So, you have three choices:

Don't read other peoples emails without their knowledge, and remove the admin forwarding
Learn to live with multiple copies and hit the 'delete' key
Write a script to periodically remove duplicates
Dear TB0ne:

I work in a Service Provider company. It's one of our clients' requirement that the owner would have receive all emails sent to their merchandisers' email addresses so that no employee can follow any illegal way. I think it's OK in such a situation. The mentioned addressees (admin, joe, jack etc.) are as demo only. Previously they were using Microsoft's Exchange where the owner got all the mails without duplication. That is why, I am trying this in postfix. Can you please let me know any other SMTP application which can fulfill my need easily without scripting? (i.e. exim, qmail, mailx etc.). Or, please guide me providing a demo script for postfix...

Thanks a lot
 
Old 06-20-2013, 12:37 AM   #4
descendant_command
Senior Member
 
Registered: Mar 2012
Posts: 1,876

Rep: Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643Reputation: 643
Rather than aliases, you should use bcc_recipient_maps directive.
 
Old 06-20-2013, 08:27 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tonmoy View Post
Dear TB0ne:

I work in a Service Provider company. It's one of our clients' requirement that the owner would have receive all emails sent to their merchandisers' email addresses so that no employee can follow any illegal way. I think it's OK in such a situation. The mentioned addressees (admin, joe, jack etc.) are as demo only. Previously they were using Microsoft's Exchange where the owner got all the mails without duplication. That is why, I am trying this in postfix.
However you want to put it, surreptitiously intercepting/forwarding emails behind peoples backs is wrong, unless the owner has come out and explicitly TOLD everyone that it's happening.
Quote:
Can you please let me know any other SMTP application which can fulfill my need easily without scripting? (i.e. exim, qmail, mailx etc.).
There aren't any, since email programs exist to send emails...not perform the function you're looking for. descent_command has a good idea, but that may not even work the exact way you want, since if someone emails the admin, they'll then get two copies (the admin email, and the bcc). Not sure, but it's worth looking in to.
Quote:
Or, please guide me providing a demo script for postfix...
No...you write your own scripts to do what you want. We will HELP you, but we aren't going to write scripts FOR YOU.
 
Old 06-20-2013, 11:33 PM   #6
tonmoy
LQ Newbie
 
Registered: Apr 2013
Location: Dhaka, Bangladesh
Distribution: CentOS, Red Hat
Posts: 28

Original Poster
Rep: Reputation: 2
Quote:
However you want to put it, surreptitiously intercepting/forwarding emails behind peoples backs is wrong, unless the owner has come out and explicitly TOLD everyone that it's happening.
Employees in that office are informed from the beginning that their emails are visible to the owner so that they leave thinking of doing anything wrong.

I'm extremely sorry if I've hurt you. Thanks a lot for your valuable information.

Regards,
-
Tonmoy
 
Old 06-21-2013, 08:50 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by tonmoy View Post
Employees in that office are informed from the beginning that their emails are visible to the owner so that they leave thinking of doing anything wrong.

I'm extremely sorry if I've hurt you. Thanks a lot for your valuable information.
Haven't hurt anyone at all, but you didn't offer that information up front. It's always best to give as much detail as possible, especially where privacy is concerned.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending mail with mail() and postfix when using namecheap's DNS and Email Hosting iLinx Linux - Server 2 07-19-2010 05:53 PM
Why is PostFix sending mail using the email address of the smtp account? taigon Linux - Server 34 02-09-2007 01:09 AM
Sending a form to an email address problems! cucolin@ Programming 1 06-23-2004 05:21 AM
Sending Email to an SMTP address from sendmail guilmetrp Linux - Newbie 6 03-01-2004 08:51 PM
sending an email to a email address after a perl operation meluser Programming 9 04-07-2003 01:26 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration