MTA/Perl script for relaying only to Exchange-users

Vincent Miszczak vmiszczak at ankama.com
Thu Nov 22 15:09:19 GMT 2012


Hi,

We are using in production the script you describe, you'll find it attached.
(need to replace, dc1,dc2, login and password, save as sh script and that's it)

In Postfix main.cf, set
relay_recipient_maps=hash:/etc/postfix/recipients.list

http://www.postfix.org/postconf.5.html#relay_recipient_maps

Vince


De : mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] De la part de Johan Hendriks
Envoyé : jeudi 22 novembre 2012 15:41
À : MailScanner discussion
Objet : RE: MTA/Perl script for relaying only to Exchange-users

In postfix there is a verify option.

From main.cf

# HELO restrictions:
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions =
    permit_mynetworks,
    reject_non_fqdn_helo_hostname,
    reject_invalid_helo_hostname,
    check_helo_access pcre:/usr/local/etc/postfix/helo_access.pcre,
    permit

# Sender restrictions:
smtpd_sender_restrictions =
    permit_mynetworks,
    reject_non_fqdn_sender,
    reject_unknown_sender_domain,
    permit

# Recipient restrictions:
smtpd_recipient_restrictions =
   permit_mynetworks,
   reject_unauth_pipelining,
   reject_non_fqdn_recipient,
   reject_unauth_destination,
   reject_unknown_recipient_domain,
   reject_unverified_recipient,
   reject_rbl_client bl.spamcop.net

# address verify
address_verify_map = btree:/var/db/postfix/verify_cache
unverified_recipient_reject_code = 550

From master.cf

verify    unix  -       -       n       -       1       verify

I am very short on time, so maybe i miss something.
But google will help you out.

But in general before a message is accepted postfix  first ask the destination MTA if the address could be delivered.
If not the sender wil get bounce.

No  need to script the whole shabang together. !

gr
Johan Hendriks
Neuteboom Automatisering


Van: mailscanner-bounces at lists.mailscanner.info [mailto:mailscanner-bounces at lists.mailscanner.info] Namens Jonas Lilja
Verzonden: woensdag 21 november 2012 22:59
Aan: mailscanner at lists.mailscanner.info
Onderwerp: MTA/Perl script for relaying only to Exchange-users

Hi, for a couple of years ago there was a guide on mailscanner.info about restricting the MTA (Sendmail) to only deliver email to valid users in an Exchange environment. This made the performance of the server much better because either MailScanner or Spamassassin need to process invalid emails.

I remember that there was a perl-script which picked up the content from a textfile (with all smtp-addresses in the domain) and then build a special file in /etc/mail/

I can't find this guide on the site. Anyone who can help me?

BR /Jonas Lilja



--
This message has been scanned for viruses and
dangerous content by MailScanner<http://www.mailscanner.info/>, and is
believed to be clean.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20121122/38cff0b2/attachment.html 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: updatePostfixRecipients.txt
Url: http://lists.mailscanner.info/pipermail/mailscanner/attachments/20121122/38cff0b2/attachment.txt 


More information about the MailScanner mailing list