How do I stop forwarding mail when sender match with receiver using .forward
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How do I stop forwarding mail when sender match with receiver using .forward
I am using sedmail and .forward for forwarding list. But the problem is there when I sent mail to a particular contact that contains a list and me also in this list I got a copy of this mail. I want stop it in my server when sender match to one of the receiver of that list, it would be send to others member but not matches sender.
Please help me if you guys completed this task
Best Regards.
Last edited by mahedi.cse; 02-17-2014 at 10:04 PM.
I believe that if you put an entry in the .forward file containing a backslash and the primary account name this should prevent the loop that you describe, thus:
Mail recipient contactA .forward file
\contactA, contactB, contactC, contactD
Mail recipient contactB .forward file
\contactB, contactA, contactC, contactD
Mail recipient contactC .forward file
\contactC, contactA, contactB, contactD
Mail recipient contactD .forward file
\contactD, contactA contactB, contactC
Thanks for prompt effort. My configuration so similar with your suggestion but my problem is that when I sent mail to group (like contactA) and me self contactB and contactA has .forward file configure like
\contactA, contactB, contactC, contactD me also received a copy for this mail by generally. I want to prevent this if anyone send mail to a group and he also be be member of that group he will not got mail that sent by him...
If you have any way to prevent it will be very much helpful for me
If you are going to use the suggested approach then remember to remove the .forward entries from each of the respective ~ home folders / directories and also run the newaliases command after making any amendments to the /etc/aliases file.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.