Hey there,
as I do develope an Mail-Handler I wondered why it is executed twice per Mail.
I think I got the reason and now I wonder even more.
Theese are my Mail-Handlers:
As you can see I hook up "before-local", "before-sendmail" and "before-remote". I think my Mailhandler to executed twice because of "before-local" and "before-sendmail". I wanted to clarify that and read the docs, but I can't find information about "before-sendmail". I decided to hoock that queue because of "check-quota" also does that.
Here the link to the official Hooking Points: http://docs.plesk.com/en-US/12.5/extensions-guide/mail-handlers/hooking-points.71845/
No description about "before-sendmail".
Heres an Mail-Log snippet
As you can see my Handler "LWAutomail" seems to be called twice as of "LWAutomail PASS" appears twice. Once in the middle via "psa-pc-remote" and once via "postfix-local"...
as I do develope an Mail-Handler I wondered why it is executed twice per Mail.
I think I got the reason and now I wonder even more.
Theese are my Mail-Handlers:
Code:
root@v22016081573736335:~# plesk sbin mail_handlers_control --list
.---.---.-------.--------------------------------------.-----------------.------------------.-----------------.
| E | P | prior | address | name | type | queue |
|---|---|-------|--------------------------------------|-----------------|------------------|-----------------|
| | | 10 | all | spf | global | before-queue |
| X | X | 50 | all | LWAutomail | global | before-local |
| X | X | 50 | all | LWAutomail | global | before-sendmail |
| X | X | 50 | all | LWAutomail | global | before-remote |
| X | | 10 | all-recipients | check-quota | global | before-queue |
| X | | 10 | all-recipients | check-quota | global | before-sendmail |
'---'---'-------'--------------------------------------'-----------------'------------------'-----------------'
As you can see I hook up "before-local", "before-sendmail" and "before-remote". I think my Mailhandler to executed twice because of "before-local" and "before-sendmail". I wanted to clarify that and read the docs, but I can't find information about "before-sendmail". I decided to hoock that queue because of "check-quota" also does that.
Here the link to the official Hooking Points: http://docs.plesk.com/en-US/12.5/extensions-guide/mail-handlers/hooking-points.71845/
No description about "before-sendmail".
Heres an Mail-Log snippet
Code:
Oct 19 11:51:43 w4 postfix/smtpd[9475]: connect from mout.xyz.de[xyz]
Oct 19 11:51:44 w4 postfix/smtpd[9475]: 31BB03380087: client=mout.xyz.de[xyz]
Oct 19 11:51:44 w4 journal: greylisting filter[11758]: Starting greylisting filter...
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: handlers_stderr: SKIP
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: SKIP during call 'grey' handler
Oct 19 11:51:44 w4 postfix/cleanup[11757]: 31BB03380087: message-id=<[email protected]>
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: handlers_stderr: SKIP
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: SKIP during call 'check-quota' handler
Oct 19 11:51:44 w4 journal: spf filter[11760]: Starting spf filter...
Oct 19 11:51:44 w4 journal: spf filter[11760]: Error code: (2) Could not find a valid SPF record
Oct 19 11:51:44 w4 journal: spf filter[11760]: Failed to query MAIL-FROM: No DNS data for 'zxy.com'.
Oct 19 11:51:44 w4 journal: spf filter[11760]: SPF result: none
Oct 19 11:51:44 w4 journal: spf filter[11760]: SPF status: PASS
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: handlers_stderr: PASS
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: PASS during call 'spf' handler
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: handlers_stderr: LOG LWAutomail PASS
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: LWAutomail PASS
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: handlers_stderr: PASS
Oct 19 11:51:44 w4 /usr/lib64/plesk-9.0/psa-pc-remote[1805]: PASS during call 'LWAutomail' handler
Oct 19 11:51:44 w4 postfix/qmgr[1830]: 31BB03380087: from=<[email protected]>, size=84047, nrcpt=1 (queue active)
Oct 19 11:51:44 w4 postfix-local[11775]: postfix-local: [email protected], [email protected], dirname=/var/qmail/mailnames
Oct 19 11:51:44 w4 spamd[3946]: spamd: connection from localhost [::1]:37282 to port 783, fd 6
Oct 19 11:51:44 w4 spamd[3946]: spamd: using default config for [email protected]: /var/qmail/mailnames/abc.de/info/.spamassassin/user_prefs
Oct 19 11:51:44 w4 postfix/smtpd[9475]: disconnect from mout.xyz.de[xyz]
Oct 19 11:51:44 w4 spamd[3946]: spamd: processing message <[email protected]> for [email protected]:30
Oct 19 11:51:44 w4 spamd[3946]: spf: lookup failed: addr is not a string at /usr/share/perl5/vendor_perl/IO/Socket/IP.pm line 662.
Oct 19 11:51:44 w4 spamd[3946]: spf: lookup failed: addr is not a string at /usr/share/perl5/vendor_perl/IO/Socket/IP.pm line 662.
Oct 19 11:51:44 w4 spamd[3946]: spamd: clean message (0.0/5.0) for [email protected]:30 in 0.1 seconds, 83044 bytes.
Oct 19 11:51:44 w4 spamd[3946]: spamd: result: . 0 - scantime=0.1,size=83044,[email protected],uid=30,required_score=5.0,rhost=localhost,raddr=::1,rport=37282,mid=<[email protected]>,autolearn=ham autolearn_force=no
Oct 19 11:51:44 w4 spamd[16790]: prefork: child states: II
Oct 19 11:51:44 w4 postfix-local[11775]: LWAutomail PASS
Oct 19 11:51:44 w4 postfix/pipe[11774]: 31BB03380087: to=<[email protected]>, relay=plesk_virtual, delay=1.1, delays=0.85/0/0/0.27, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Oct 19 11:51:44 w4 postfix/qmgr[1830]: 31BB03380087: removed
As you can see my Handler "LWAutomail" seems to be called twice as of "LWAutomail PASS" appears twice. Once in the middle via "psa-pc-remote" and once via "postfix-local"...