Solved

sendmail ldap lookup sbs 2003

Posted on 2009-07-08
4
505 Views
Last Modified: 2013-12-24
hi.. hoping some email experts might be able to pin this one down 4 me..

I have sendmail configured as a backup mailserver for my domain that stores and forwards mail iin events of primary downtime. Mail is forwarded on with mailertable. This works ok, but get ndrs for non existent users on the domain. If I build a virtuser list with all my email addresses i believe it may help to stop this bounced ndr as mail will be dropped. what i was wondering is it possible to retrieve a list of email addresses from my exchange server with an ldap lookup to automatically populate the virtuser table?  one other thing i do get a large number of failed relay non delivery emails. at the moment i am firing these off to /dev/null because they are all spam rubbish is this the best way to certain them?
0
Comment
Question by:dodyryda1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 26

Expert Comment

by:jar3817
ID: 24803863
I'm using a version of this perl script to fetch all the email addresses (users,contacts, groups, public folders) from AD:

http://www-personal.umich.edu/~malth/gaptuning/postfix/getadsmtp.pl

Obviously you'll have to change the domain controllers names and probably your search base. Look for this line: "push(@valid, $mail." OK\n");" and change that to the format of your virtusertable file.

Once you have it working ok you can schedule it via cron to auto update.
0
 
LVL 26

Expert Comment

by:jar3817
ID: 24804087
By default that'll work for every account, but you probably want to exclude the disabled accounts. Add this to the filter to exclude disabled accounts:

( !(userAccountControl:1.2.840.113556.1.4.803:=2))
0
 

Accepted Solution

by:
dodyryda1 earned 0 total points
ID: 24806788
nice one thanks jar3817 i think this is exactly what i'm after, bit new to this so to check.....

once configure with my setup correctly simply executing this script from a terminal will populate my virtuser table automatically correct?. I can then schedule this to run cron etc, to populate virtuser with any changes in AD correct?

To double check on the usage of this setup, By having these email addresses in the virtuser table,  I then can configure sendmail to drop mail silently from addresses not contained in this table to prevent being slammed with these ndr's. And forward everything on to my main server with mailertable


I do wish to exclude my disable users so filter will be something like

 if ( $mail =~ s/^(smtp|SMTP)://gs ) ( !(userAccountControl:1.2.840.113556.1.4.803:=2)) {
       push(@valid, $mail." OK\n");
     }

thanks for your help..
0
 
LVL 26

Assisted Solution

by:jar3817
jar3817 earned 250 total points
ID: 24808313
Yup..

But the disabled exclusion part goes in the filter part of the search, mine looks like this:

(& (!(userAccountControl:1.2.840.113556.1.4.803:=2)) (mailnickname=*) (| (&(objectCategory=person) (objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*))) (&(objectCategory=person)(objectClass=user)(|(homeMDB=*) (msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact)) (objectCategory=group)(objectCategory=publicFolder)(objectClass=msExchDynamicDistributionList) ))

Also keep in mine you may need to restart sendmail when you change the virtusertable file for the changes to take effect.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Read this checklist to learn more about the 15 things you should never include in an email signature.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
This video discusses moving either the default database or any database to a new volume.

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question