Sendmail, Dovecot and passwd-like file.

05.02.2008 – 21:32

Programming: Klupek
Evil plan: Platyna

How to use Sendmail and passwd like file (like /etc/passwd-mail)? Here it is: sendmail-pwlike-maildb.patch

Next we are h4x0ring sendmail.mc:

Before MAILER(local)dnl:

define(`LOCAL_MAILER_PATH’,`/usr/libexec/dovecot/deliver’)
define(`LOCAL_MAILER_FLAGS’,`DFMPhfnu9′)
define(`LOCAL_MAILER_ARGS’,`deliver -d $u’)

define(`confMAILBOX_DATABASE’, `pwlike’)

# sendmail -Am -bv test@example.net
test@example.net… deliverable: mailer local, user test

Hooray!

I tried to use mail.local and it’s -D option but that program seems to be braindead (-D pwlike gives “service unavailable” error and even in the strace output there are no hints why, do we have to hack mbdb AND mail.local code?).

I am using Dovecot’s local mailer (named deliver), which works nicely after configuring Dovecot with passwd-like file (the same as we have coded in sendmail – /etc/passwd-mail).

Anyway the documentation of the Dovecot’s LDA + Sendmail on their Wiki is bad, very very bad.

About the passwd file itself…we have to use the same password encryption sheme as the /etc/shadow (the same that getpwnam() supports, since patch features the modified version of getpwnam()), we can accomplish this using Cracklib, I will post the adduser script later on.

Now we only need to hack the the darn SASL…

  1. 2 komentarze to “Sendmail, Dovecot and passwd-like file.”

  2. Note that patching will fail when using the patch file from the link. Because somehow it lacks the spaces (and tabs) which should be in front of the lines which were *not* added to the new file. After adding the necessary spaces and tabs patching will succeed. (it’s not a html/webserver issue because the webserver is returning it as text/plain)

    Apart from that it seems to work just fine, which is nice because you only need one userfile for both imapd/pop3d and the MTA. However I guess a db-file will perform better for large amounts of users. But then again dovecot doesn’t support it either..

    Przez bartd dnia 16 Wrz 2008

  3. Ok, I have fixed the patches now. You can check then out.

    Przez Platyna dnia 17 Wrz 2008

Opublikuj komentarz

Captcha Captcha Reload