6 messages in net.sourceforge.lists.courier-usersRe: [courier-users] reformatting of c...
FromSent OnAttachments
Uwe FrickeMar 30, 2006 4:17 am 
Jay LeeMar 30, 2006 5:33 am 
Jay LeeMar 30, 2006 8:08 am 
Uwe FrickeMar 30, 2006 8:26 am 
Sam VarshavchikMar 30, 2006 3:15 pm 
Uwe FrickeMar 31, 2006 12:27 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [courier-users] reformatting of certain email adresses - how is it done?Actions...
From:Jay Lee (jl@pbu.edu)
Date:Mar 30, 2006 8:08:01 am
List:net.sourceforge.lists.courier-users

Uwe Fricke wrote:

Let's keep replies on list so that others can offer help and for the benefit of the archives...

Hard to figure out, there are approx. 15k directories in /home/vmail, with such striking names as 00116499 instead of user names. However, I tried a 'find . -name .forward' in /home/vmail, hoping to find about 20 results... but it returned nothing.

As the previous company adminstrating the servers has gone insolvent, there's no one knowing the architecture. But, my contact (who isn't very tech savy) told me, that there's probably a file around with a list of the email accounts (listing the twentysome internal users) to forward to the internal server.

*sigh* I doubt this statement, and didn't manage to find such file.

Sounds more like a guess than an actual understanding of how things run...

Yes, in the ldap directory. Here's a typical log for one of the 15k users - a mail with the real username comes in, and via ldap the mailfile number is looked up. The mail for the user regarding the log below would be stored in /home/vmail/0057358/Maildir/

mail courierd: newmsg,id=01CAA52C.442A9A96.00001B7F: dns; mx1.company.com (mx.comp.de [::ffff:<externalIP>]) mail authdaemond: received userid lookup request: <titel.surname.name>@company.com mail authdaemond: authldap: trying this module mail authdaemond: using search filter: (uid=<titel.surname.name>@company.com) mail authdaemond: one entry returned, DN: CN=<surname name>,O=<company initials> mail authdaemond: raw ldap entry returned: mail authdaemond: | mailfile: 0057358

OK, looks like the user's home directory is determined based on the mailfile attribute. So learn what the mailfile attribute is for one of the working Notes users and explore their home directory...

Below I pasted the relevant log, showing a successful and an unsuccessful delivery. The logs below show that, right after courieresmtpd receives a new message, it somehow formats acco@company.com to acco@internal.company.com, after virus-checking courierd takes over, and the email get's delivered to Notes. This formatting isn't done with the newly created email account, and right after courieresmtpd receives this message, a lookup with ldap is done - this isn't necessary.

I do something similar myself, I have an LDAP backend. We have another internal email server that we call Mercury. I use maildrop, Courier's local delivery agent, to do virus and spam filtering, maildrop also does an ldap lookup of the user, if they're a member of group Mercury, then the email gets delivered to us@merc.domain.com instead of us@domain.com which would be the courier server. My approach is dynamic, but this could also be handled by putting .forward or .courier or .mailfilter files in the user's home directory. Or just using aliases.

I just tried a 'find . -name .courier', and a 'find . -name *mailfilter', to no avail. Do you have any idea were to look for the configuration of such a dynamic approach you described?

From below it looks like Courier is basing it's configuration on /usr/lib/courier/etc files... /usr/lib/courier/etc/maildroprc then would be the global maildrop filter that runs for all accounts. That is of course, assuming that maildrop is configured as the local delivery agent. What does DEFAULTYDELIVERY= look like in etc/courierd? What does your authldaprc file look like?

(in /usr/lib/courier, a 'grep -ri <validemailaccount> *' returned nothing. in /etc/, there aren't any courier config files.).

I would appreciate any hints on where this configuration is done try searching for your domain name or the name/ip address of the Notes server instead. Also check if the working Lotus accounts have home directories on the Courier server. Feel free to report back what you find.

a grep resulted in the following:

/usr/lib/courier/etc/esmtproutes: internal.company.com preference=20, mail exchanger =internal.company.com /usr/lib/courier/etc/ldapaddressbook: <company initials> <internal IP of ldap server> 389 /usr/lib/courier/etc/ldapaliasrc: LDAP_SERVER <internal IP of ldap server>

This last one is significant it means your email aliases are configured in LDAP. You need to find out where in the LDAP tree Courier is looking for aliases and see if there are aliases for the Notes users. I don't think we're dealing with aliases though, my guess is the forwarding is happening in maildrop.

I thought of another approach. Take a look at the modules processing the mails, the flow is different for each case:

[courieresmtpd => courierd => authdaemond => courierd] for the 15k users, [courieresmtpd => cramcour =>courierd => courieresmtp] for the twentysome users to redirect to the internal server [courieresmtpd => authdaemond] for my problem user

So, base on http://www.courier-mta.org/?queue.html, the input module (courieresmtpd), or the submit module, rewrites the addresses. I just don't know were to look for such a configuration..