[NTLUG:Discuss] How to dump a list of email addresses from your mail server?

Stuart Johnston saj at thecommune.net
Wed Sep 19 19:07:33 CDT 2007


Daniel Hauck wrote:
> I'm preparing to deploy ESVA (a vmware appliance for email filtering) at
> home.  I have been using it at work with fantastic results.  One feature
> on there that is absolutely necessary is to specify the relay_recipients
> for Postfix to use, rejecting all other incoming emails.  To simply
> accept all email for a domain will result in thousands of different
> random email addresses being sent to my domains, each being filtered and
> scanned before finally being rejected by the actual email server.  It
> results in a HEAVY processor load and I don't want it.
> 
> At work, we have an exchange email server and with a handy-dandy Perl
> script that does some LDAP magic, I am able to download a list of all
> email addresses from the exchange server and feed it to ESVA via an
> hourly cron job.  (This allows me to simply add or delete a user and the
> list will update itself within the hour automagically)
> 
> I want to do the same thing at home but the problem is, I don't have any
> such LDAP thing running at home... I'm all Linux and it's set up rather
> simply.  So, with that said, what would be an easy way to have the
> mail/web server I'm loading generate a list of valid email addresses for
> the domains I'm hosting?  This would be accounts *and* aliases.
> 
> I suppose performing multiple steps where I scan the passwd file and
> then the aliases file might work but I'm no shell or perl script wizard
> to be sure.  So before I do it "the hard way" I'm hoping someone with
> superior skillz could show me what a dummy I am by showing me an easier way?

One common solution is to have you filtering server politely ask the 
mail server, is this a valid email recipient?  The filtering server will 
cache these to avoid burdening the mail server.

http://www.postfix.org/ADDRESS_VERIFICATION_README.html



More information about the Discuss mailing list