1

Topic: Postfix error when e-mail in list of e-mails not exists

==== Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.4
- Linux/BSD distribution name and version: Centos7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:
====

Dear,

I have a problem and I would like some help.
I'll explain the problem in the lines below:

* My example email is postmaster@yourdomain.com

1) I have a list with several e-mails (from the same domain as yourdomain.com);
2) When I try to send an e-mail to this list, and one of the e-mails in the list does not exist, my e-mail client generates an error saying that it is not possible to send the e-mail because one of the e-mails in the list does not exist .

How can I solve?
I would like that if the email does not exist, postfix ignores it and sends it to the others too many in the list.

Is this possible?

Thank you in advance

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Postfix error when e-mail in list of e-mails not exists

Your Postfix parameter in /etc/postfix/main.cf should look like this:

smtpd_recipient_restrictions = ... reject_unlisted_recipient, ... permit_sasl_authenticated, ...

Try to move "reject_unlisted_recipient" AFTER "permit_sasl_authenticated", then reload or restart postfix service and try again.

3 (edited by fhansen 2017-02-09 17:51:24)

Re: Postfix error when e-mail in list of e-mails not exists

Dear,
I did what you suggested but it did not work.
Any other suggestions?

By the logs below, it is giving error in the step checking recipient maps: mail_addr_find: email@domain.com -> (not found)

I wish that if the email did not exist it would be bounce and not reject.

>>> CHECKING RECIPIENT MAPS <<<
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: ctable_locate: move existing entry key email@domain.com
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: maps_find: recipient_canonical_maps: email@domain.com: not found
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? mail.domain.com
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? localhost
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? localhost.localdomain
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_list_match: domain.com: no match
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: maps_find: recipient_canonical_maps: @domain.com: not found
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: mail_addr_find: email@domain.com -> (not found)
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: maps_find: canonical_maps: email@domain.com: not found
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? mail.domain.com
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? localhost
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_string: domain.com ~? localhost.localdomain
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: match_list_match: domain.com: no match
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: maps_find: canonical_maps: @domain.com: not found
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: mail_addr_find: email@domain.com -> (not found)
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: send attr request = lookup
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: send attr table = mysql:/etc/postfix/mysql/virtual_alias_maps.cf
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: send attr flags = 16448
Feb  9 07:28:53 mail postfix/submission/smtpd[19295]: send attr key = email@domain.com

4

Re: Postfix error when e-mail in list of e-mails not exists

Please show me the original error log in Postfix log file.

5 (edited by fhansen 2017-02-09 18:09:00)

Re: Postfix error when e-mail in list of e-mails not exists

Log is below:

Feb  9 08:00:05 mail postfix/submission/smtpd[22040]: Anonymous TLS connection established from unknown[x.x.x.x]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Feb  9 08:00:05 mail postfix/submission/smtpd[22040]: NOQUEUE: reject: RCPT from unknown[x.x.x.x]: 550 5.1.1 <teste@domain.com>: Recipient address rejected: User unknown in virtual mailbox table; from=<user@domain.com> to=<teste@domain.com> proto=ESMTP helo=<[x.x.x.x]>

Today when I send an e-mail to a list and one of the e-mails from the list did not exist, the e-mail client returns an error and does not send the e-mail.

I saw that the catch-all configuration exists, that when an e-mail is sent to a recipient that does not exist, it forwards it to the e-mail registered in catch-all.

But I would like it not to forwards, I would like the email to be sent to the whole list and then returned a bounce message for the email that does not exist.

Plesk implements this functionality.

Is it possible?

6

Re: Postfix error when e-mail in list of e-mails not exists

Show us output of command:

postconf smtpd_recipient_restrictions

7

Re: Postfix error when e-mail in list of e-mails not exists

[root@mail ~]# postconf smtpd_recipient_restrictions
smtpd_recipient_restrictions = permit_mynetworks 
permit_sasl_authenticated 
reject_unknown_recipient_domain 
reject_non_fqdn_recipient 
reject_unlisted_recipient 
check_policy_service inet:127.0.0.1:7777 
reject_unauth_destination

8

Re: Postfix error when e-mail in list of e-mails not exists

Please don't change the default settings of below 3 parameters.

smtpd_helo_restrictions =
    permit_mynetworks
    permit_sasl_authenticated
    reject_non_fqdn_helo_hostname
    reject_unknown_helo_hostname
    check_helo_access pcre:/etc/postfix/helo_access.pcre

# Sender restrictions
smtpd_sender_restrictions =
    reject_unknown_sender_domain
    reject_non_fqdn_sender
    reject_unlisted_sender
    permit_mynetworks
    permit_sasl_authenticated
    check_sender_access pcre:/etc/postfix/sender_access.pcre

# Recipient restrictions
smtpd_recipient_restrictions =
    reject_unknown_recipient_domain
    reject_non_fqdn_recipient
    reject_unlisted_recipient
    check_policy_service inet:127.0.0.1:7777
    permit_mynetworks
    permit_sasl_authenticated
    reject_unauth_destination

9 (edited by fhansen 2017-02-09 22:19:53)

Re: Postfix error when e-mail in list of e-mails not exists

Ok, I am set to default values.
Same error.

10

Re: Postfix error when e-mail in list of e-mails not exists

"user unknown in virtual mailbox table" means the recipient doesn't exist in your sql database. Do you really have this user in sql db?

11 (edited by fhansen 2017-02-10 16:51:01)

Re: Postfix error when e-mail in list of e-mails not exists

Yes, but I wish there was no such error in the email client (thunderbind and others ...).
Do you know the catch-all function?
I would like something similar, but instead of redirecting email to a specific account, I would like to discard it.

12

Re: Postfix error when e-mail in list of e-mails not exists

Try this:

1: Follow my old reply: http://www.iredmail.org/forum/post54466.html#p54466
2: Set "smtpd_reject_unlisted_recipient = no" in /etc/postfix/main.cf.

WARNING: I think you're probably making simple thing complex, and make your mail server accepting more illegal emails to waste system resource (CPU/RAM/...). If you get error like "user unknown in virtual mailbox table", why not simply fix the invalid recipient address?