-3

I have a server [Redmine] which sends notifications to users on the project and it happens that some of the user mails are not correct. The server puts everbody in the "To" or "Bcc" field depending on configuration.

Is there any way to configure mail server so that when mail is sent to multiple users those non existent mail addresses are ignored. For instance

from: 
to: existing_user1, existing_user2, non_existing_user
subject: ....

the message should be sent to all users apart from the last one. Currently, the server returns 5.1.1 User unknown

closed as off-topic by slm, Anthon, jasonwryan, derobert, terdon Oct 22 '13 at 20:22

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question has been posted on multiple sites. Cross-posting is strongly discouraged; see the help center and community FAQ for more information." – slm, Anthon, jasonwryan, derobert, terdon

4

Dovecot isn't a mail server

You're looking at the wrong thing when you say "Dovecot to ignore....". Dovecot is a POP/IMAP client and doesn't really have anything to do with the attempt of Redmine to send emails to different users.

This functionality rests with Redmine itself and whatever mail server/frontend you're using (Sendmail, Postfix, etc.).

There's an issue that was opened 4 years ago on the Redmine website, titled: Better handling of unknown and aliased email addresses when submitting issue via email.

Your mail server

Lastly go through this guide on setting up email with Redmine and make sure you have it setup correctly (which you likely should). If'll notice towards the bottom of that page, there are directions for debugging email issues.

You'll likely need to configure what ever mail server you're using (Sendmail, Postfix, etc.) into sending these emails, but dropping the attempts to illegal addresses, or provide your mail server with the ability to ignore delivery attempts for a certain set of email addresses.

Blocking with Postfix

Here's an example that shows you how to go about blocking certain email addresses within Postfix. The article is titled: Postfix blacklist or reject an email address.

General steps

  1. Open /etc/postfix/sender_access file

    $ cd /etc/postfix
    $ vi sender_access
    
  2. Append sender email id as follows:

    user@abadboy.com REJECT
    
  3. Save and close the file. Use postmap command to create a database:

    $ postmap hash:sender_access
    
  4. Now open main.cf and add code as follows:

    smtpd_recipient_restrictions = check_sender_access hash:/etc/postfix/sender_access
    
  5. Save and close the file. Restart / reload postfix MTA:

    $ sudo /etc/init.d/postfix restart
    
  • What do you mean dovecot isn't mail server ?! It certainly is and can handle attempts to deliver emails. Actually, your final sentence "provide your mail server with the ability to ignore delivery attempts" is exactly what I need. – majkinetor Oct 22 '13 at 17:40
  • About redmine setup, I did it as it is documented. This is clearly an issue since I am not the only one to report this (for instance #8157 apart from the one you mentioned). – majkinetor Oct 22 '13 at 17:44
  • 1
    @majkinetor - no dovecot is not a mail server. It's an IMAP and POP server. They are distinctly different things and this is part of where you're getting confused. POP/IMAP are protocols for accessing your mail, not for delivering it. Re-read the front page of dovecot: dovecot.org – slm Oct 22 '13 at 17:44
  • @majkinetor - mail delivery agents such as Sendmail/Postfix are what are returning you the 5.1.1 User unknown messages. They're the servers that are attempting to deliver the email to the bogus addresses and are kicking back the failures. Once you work this out, update your Q with the info about what mail server you're using. – slm Oct 22 '13 at 17:48
  • @majkinetor You can flip the solution around and omit emails that aren't on a whitelist. – slm Oct 22 '13 at 18:27

Not the answer you're looking for? Browse other questions tagged or ask your own question.