0

Help would be greatly appreciated. I am not a server admin but I have been tasked with making a means of auto-removing a email recipient from the database containing a table with a list of emails, should an email bounce or be unable to be delivered.

I have been working on this for sometime and looked/tried many different ways of doing it, so I am open to suggestions. It would be nice if ideas could be fairly detailed if possible.

I would prefer to not have to use any additional software. However I do not mean my own script, and writing some if necessary should be doable.

Also, thought that I should include that I am not looking for someones help with scripting if that is necessary. I only need help with what to do with the postfix end and how to set that up so this can work. Just thought that I should clarify.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92

1 Answers1

2

The easiest way is to use an actual mailing list software. They know how to do this, and many can use a database as a source of addresses.

Failing that, this is basically how to handle bounces in the same way as proper mailing list software does:

  • You use a real address that is (at least occasionally) checked by a human as the From: or Reply-To:-address in the mail
  • You set an envelope sender that is specifically and only used for this purpose. This will not be seen by the recipients (unless they look at the headers), so you won't get any "personal" responses to that address - but all the bounces will be delivered to the envelope sender address, not the From: or Reply-To: address.
  • You set up postfix so that all mails to the address used as envelope sender will cause a script to be run. There are several ways to do this, depending on your server setup.

You also, and before doing anything else, need to read the Spamhaus bulk email FAQ. It tells you a number of things to be on the lookout for in order to be a responsible bulk email sender, which will reduce the risk of your email being labelled spam.

HopelessN00b
  • 53,795
  • 33
  • 135
  • 209
Jenny D
  • 27,780
  • 21
  • 75
  • 114
  • The first one cannot be done as we will not have someone continuously working on this and with a large number that would be almost impossible. I tried the second one but could not figure out how to create another inbox for the new user even after extensive looking. I tried adduser and adding the alias and everything, however, I was unable to find additional steps. The third one was also tried to pipe through script, however the email was not reinjected to postfix after exiting the script. Even without script it seems to get trapped in the pipe and I could not figure out how to send it back. – user3496561 Apr 24 '14 at 04:58
  • Unfortunately, additional software is not likely an option, at least now. If you could possibly elaborate on the second and third option, I would be most appreciative. Of course if I were to look into a software to bring up specific ones that fit would be nice if you could send suggestions also. Thank you again for the input. – user3496561 Apr 24 '14 at 05:17
  • That wasn't "second and third option" - that was all the steps you need to do. All of them. If you do not have the staff to properly maintain a mailing list, then you should not run a mailing list. Yes, this is harsh. I've spent a few decades cleaning up after people who didn't follow these rules. If you can't manage it, then start paying some reputable list vendor to do it for you - it will cost less in the long run, both in terms of money and in terms of your reputation. – Jenny D Apr 24 '14 at 07:00
  • Oh, I understand. I thought you were giving me options. Well, that is fine. Thank you for the help. I will look into this then. – user3496561 Apr 24 '14 at 07:39