1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Mail Handler at "before-remote" is not getting the whole mail

Discussion in 'Plesk 9.x for Linux Issues, Fixes, How-To' started by BoMbY, Apr 11, 2011.

  1. BoMbY

    BoMbY New Pleskian

    Apr 11, 2011
    Likes Received:
    Hi all,

    yesterday I tried to implement a simple Plesk Mail Handler (as described in this API reference) for a Sender Rewriting Scheme.

    Unfortunately the handler at the hook "before-remote" is not getting the whole mail, and any changes to the mail seem to be ignored. All I'm getting is something like this:

    Received: from my.host.invalid (localhost [])
    	by my.host.invalid (Postfix) with ESMTP id 3AB84CC303DC
    	for <[my_name]@googlemail.com>; Sun, 10 Apr 2011 18:51:43 +0200 (CEST)
    Message-Id: <20110410165143.3AB84CC303DC@my.host.invalid>
    Date: Sun, 10 Apr 2011 18:51:43 +0200 (CEST)
    From: [my_name]@gmx.net
    To: undisclosed-recipients:;
    The other hooking points work like described in the reference (mail is written completely to STDIN, and I write it back to STDOUT, including my changes). The funny thing is, the default DKIM handlers from Parallels seem to work at this point. Are they using some trick? Or is this behavior only occurring because I'm using Postfix and not Qmail?

    I think it might have to do something with this part of the configuration in the Postfix master.cf:

    plesk_virtual unix - n n - - pipe flags=DORhu user=popuser:popuser argv=/usr/lib/plesk-9.0/postfix-local -f ${sender} -d ${recipient} -p /var/qmail/mailnames inet n n n - - spawn user=mhandlers-user argv=/usr/lib/plesk-9.0/postfix-queue 10027 before-queue inet n - - - - smtpd  -o smtpd_client_restrictions=  -o smtpd_helo_restrictions=  -o smtpd_sender_restrictions=  -o smtpd_recipient_restrictions=permit_mynetworks,reject  -o smtpd_data_restrictions=  -o receive_override_options=no_unknown_recipient_checks inet n n n - - spawn user=mhandlers-user argv=/usr/lib/plesk-9.0/postfix-queue 10026 before-remote
    plesk_saslauthd unix y y y - 1 plesk_saslauthd status=5 listen=6 dbpath=/plesk/passwd.db
    But honestly, I've no clue about how this config works, and how I could get what I need - or if this is just a coincidence with the naming.

    Any hints would be appreciated ...

    Thanks and Regards,