سؤال

I am writing a mailing List in php and need a way to force while sending a mail via smtp (Postfix) on localhost just really sending that mail to the BCC receivers.

(Having To and Cc headers sending them in the mail, but not sending the mail TO them)

The reason: If a mail is sent to the list it was sent to those receivers before; In the php script, I edit the mail (Removing forbidden Words, adding a footer with signout-link etc.) and want to send it than via smtp (mail() isnt good, it does no error handling)

Is there any Class or simple way to do that? or is it possible to stay in the postfix queue (The Mail is piped to the php-script)

The Mail, I send has as to: the mailing.list-adress (Because it has to be shown that the mail was delivered to the mailing list) and all other Tos, but the script should not send them to that adresses, it just should send to the bcc adresses.

The Mail-Flow is

Sender => specific-list@server.de => lists@server.de => php-programm => drop

Every 5 Minutes (Or other time the user specified) the List will be rolled out:

mail in database => script => receipients as bcc, to is list-adress (specific-list@server.de)

The Mail looks like:

From: original-sender@original-server.org
To: specific-list@server.de, <any other tos from original mail>
Cc: <any ccs from original mail>
Bcc: <all the list subscribers> //JUST REALLY SEND TO THIS ADRESSES
Subject: [Listname | Topicid] Topic Name

Content:
<original content>
--
signature for unsubscribe, etc.

I have an Idea how I could solve this, but need help for doing it.

  1. I create a internal mail-address, that forwards to my real receipients
  2. I send the mail to that address
  3. Postfix has to handle that mail not as an outgoing mail but as a new mail delivered to that adress.
  4. Because it is a received mail, postfix doesnt deliver to all other Receivers, it just delivers to that specifix address (that is a Forwarding)
هل كانت مفيدة؟

المحلول

Whenever you send mail, by the rules established universally, you need to have a To recipient. If you want to send the mail to yourself or to an address just for the purpose, fine. Once you have a To you can go ahead and create your bccs.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top