2 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] Maildrop + Sendmail +...
FromSent OnAttachments
Eric MayoNov 2, 2005 3:01 pm 
Todd LyonsNov 2, 2005 3:32 pm 
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: [maildropl] Maildrop + Sendmail + Local Virtual Mailboxes & Maildrop not getting domain nameActions...
From:Todd Lyons (tly@ivenue.com)
Date:Nov 2, 2005 3:32:08 pm
List:net.sourceforge.lists.courier-maildrop

Eric Mayo wanted us to know:

I admit this is probably a sendmail configuration problem but I've had zero luck
in getting help from the sendmail folks.

I am using Maildrop as a local delivery agent. In my sendmail.mc file I have
the following configuration line:

FEATURE(`local_procmail', `/usr/local/bin/maildrop', `maildrop -d $u')dnl

This results in a sendmail.cf setting of: Mlocal, P=/usr/local/bin/maildrop, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, T=DNS/RFC822/X-Unix, A=maildrop -d $u

Maildrop is configured to use authdaemond with a PostgreSQL backend.

Your system is similar to mine, except it uses ldap backend. But I cheat to get around the following limitation:

Anytime I send email to one of my local virtual mailboxes while monitoring the PostgreSQL logs, I see queries for the user name that do not include the domain name. For example, consider the following SMTP communication:

---------------------------------------------- telnet my.smtp.host 25 mail from: te@someplace.com rcpt to: me@mydomain.com data some test data .

----------------------------------------------

maildrop seems to query the PostgreSQL database correctly but with the wrong parameters passed in for $u which is a variable sendmail sets and passes to maildrop. My Postgresql logs show a look up for "me" instead of
me@mydomain.com.

The way I get around this is by configuring PAM to know about these users as well. Here is an example:

# joy.domain.com, users, ivenue.net dn: uid=joy.domain.com,ou=users,dc=ivenue,dc=net loginShell: /sbin/nologin gidNumber: 1000 uidNumber: 4890 shadowMax: 99999 objectClass: posixAccount objectClass: top objectClass: shadowAccount objectClass: account objectClass: CourierMailAccount uid: jo@domain.com uid: joy.domain.com mail: jo@domain.com gecos:: IA== shadowLastChange: 11740 cn:: IA== homeDirectory: /netapp1/mail/maildirs/d/o/m/joy.domain.com description: customerNumber->58663 shadowWarning: 7 quota: 50000000S

# jo@domain.com, virtuser, ivenue.net dn: sendmailMTAKey=jo@domain.com,sendmailMTAMapName=virtuser,dc=ivenu e,dc=net objectClass: sendmailMTA objectClass: sendmailMTAMap objectClass: sendmailMTAMapObject sendmailMTACluster: Servers description: domain.com description: customerNumber->58663 sendmailMTAMapName: virtuser sendmailMTAKey: jo@domain.com sendmailMTAMapValue: joy.@smtp.ivenue.com

When put together, these two make it work properly. Sendmail accepts an email for "jo@domain.com", finds it in the virtuser table as "joy.@smtp.ivenue.com", and strips the domain off, leaving you with just "joy.domain.com" for the username. The lookup by maildrop for uid "joy.domain.com" results in the homeDirectory above.

To summarize, sendmail uses ldap to do the virtuser mapping and come up with a username. maildrop uses ldap to do the lookup to come up with the home directory.

I will note that I am using maildrop 1.7.0 because maildrop 1.8.0 changed to using authdaemond, and I have not tested it yet.

I require the domain name portion because I have many virtual domains with same user portion in front that I need to keep mail for.

That's why I did it the method above.

It apperas as if $u being passed to maildrop is getting stripped along the way.

Correct.

I've spent months looking into various things with sendmail with no luck. My latest advise was to craft my own sendmail rewrite rules. I took an example and tried to implement it with no luck.

That's a long row to hoe. If you choose that method, good luck.

The following was tried in my sendmail.mc file:

----------------------------------------------------------------------- LOCAL_RULE_0 Rbb + $+ < @ $=w . > $#local $: + $1@$2

Neither do I. Wish I did. I plan to learn about it (in my spare time <tm>).