test email existance

Questions and answers about how to do stuff
Post Reply
nicola.piazzi
Posts: 389
Joined: 23 Apr 2015 09:45

test email existance

Post by nicola.piazzi »

My EFA send all emails to Exchange after analisis
But it send also email for users that do not exists
There is a way to test user existance and generate in EFA NDR reports ?
nicola.piazzi
Posts: 389
Joined: 23 Apr 2015 09:45

Re: test email existance

Post by nicola.piazzi »

Ok, but :

1) It seeme that thhis script import usernames and not mai address
2) There is a way to not pass all domain.com to Exchange server but only mailboxes in the imported user table ?
3) There is a way that efa generate NDR not for all messages with unknown user but only for messages not classified as spam ?
nicola.piazzi
Posts: 389
Joined: 23 Apr 2015 09:45

Re: test email existance

Post by nicola.piazzi »

I tried to populate email addresses in efa/mysql using ldap
It works but i think that it can be unstable, i have a problem retrieving too many rows

but i solved in other way

vi /etc/postfix/main.cf

Modify the row smtpd_recipient_restrictions adding reject_unverified_recipient
So postfix check mailbox existance of our mailboxex in our Exchange each time someone try to put a message

Postifix give an error 450 that is non know in RFC as Maibox Unknown so i add these two lines to give the same response as efa was the real final server

unverified_recipient_reject_code = 550
unverified_recipient_reject_reason = Casella di posta non trovata sui nostri sistemi
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: test email existance

Post by shawniverson »

:text-bravo:

Good postfix feature. I think many people would like this option.

https://github.com/E-F-A/v3/issues/218
anti-spam
Posts: 40
Joined: 06 Oct 2015 14:32
Contact:

Re: test email existance

Post by anti-spam »

hi,

i give it a try, and it was not working ... The first incoming emails are ok, but suddently every valid email address are rejected ...
We have many CPanel shared hosting servers, possible that this will not work correctly in our case.
Our MailFoundry was able to cache the invalid email addresses, don't know how they did that ... :think:
:arrow: always fighting spams ... :hand:
chris
Posts: 14
Joined: 16 Jan 2015 08:31

Re: test email existance

Post by chris »

I have populated /etc/postfix/recipient_acces with all email addresses from Exchange.

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_recipient, reject_unknown_recipient_domain, check_recipient_access hash:/etc/postfix/recipient_access, reject_unverified_recipient

Non existing recipient still goes through, adding reject at the end to smtpd_recipient_restrictions works for me:

smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, reject_non_fqdn_recipient, reject_unknown_recipient_domain, check_recipient_access hash:/etc/postfix/recipient_access, reject_unverified_recipient, reject

2019-12-13 09:56:01 SMTP Error: The following recipients failed: email@domain.xx: : Recipient address rejected: Access denied
Message sending failed.
nicola.piazzi
Posts: 389
Joined: 23 Apr 2015 09:45

Re: test email existance

Post by nicola.piazzi »

Chris
You dont need to do this
Is better to do an AD query to check mail existance

vi /etc/postfix/main.cf
## File di configurazione LDAP per la verifica degli email address da accettare
relay_recipient_maps = ldap:/etc/postfix/ldap_relay_recipient_maps.cf
Creare il file di configurazione che utilizza un utente ad hoc senza alcun tipo di permesso per la query :
vi /etc/postfix/ldap_relay_recipient_maps.cf
#/etc/postfix/ldap_relay_recipient_maps.cf
# Configurazione LDAP per query recipients consentiti
# Restituisce sia le email degli utenti che quelle dei gruppi
# Server
server_host = 10.1.1.120 10.1.1.121
server_port = 389
# Search on entire domain
search_base = DC=gruppocomet,DC=net
version = 3
#scope = sub
bind_dn = cometnt\efaldap
bind_pw = YOURADUSERPASSWORD
bind = yes
query_filter = (|(proxyAddresses=smtp:%s) (proxyAddresses=SMTP:%s))
result_attribute = mail
Post Reply