Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: jibe on January 05, 2012, 05:00:38 PM
-
Hi,
I'm trying to add a new plugin to qpsmtpd, but it seems not working...
Here is what I did :
- Put my plugin named "my_plugin" in /usr/share/qpsmtpd/plugins/
- Create a template: /etc/e-smith/templates-custom/var/service/qpsmtpd/config/peers/0/55my_plugin containing "my_plugin"
- Create the same template in .../local/
- signal-event email-update
I can see the added template in /var/service/qpsmtpd/config/peers/0 as well as in .../local :
...
check_goodrcptto extn -
rcpt_ok
my_plugin
# pattern_filter disabled
tnef2mime
...
But it has no effect...
what did I miss ?
Another almost similar problem : how can I enable Gavin's denysoft_multi_rcpt plugin ? I tried to do the same way, but it doesn't work. But here, I surely miss some config file for the matching domain and config tests. How to do that ?
Thanks.
-
That all looks right to me.
Have you tried increasing the log level and checking the logs for any messages?
config setprop qpsmtpd LogLevel 8
signal-event email-update
-
Hi,
The loglevel was already set to 8.
I try with a very simple plugin :
sub register {
my ($self, $qp, %arg) = @_;
$self->{_match} = $arg{match};
$self->register_hook("rcpt", "my_plugin");
}
sub my_plugin {
my ($self, $transaction, $rcpt) = @_;
$self->qp->log(LOGINFO, "my_plugin is working !");
return DECLINED;
}
In the log, I have :
2012-01-09 15:58:43.593785500 4156 rcpt_ok hooking rcpt
2012-01-09 15:58:43.595949500 4156 my_plugin hooking rcpt
2012-01-09 15:58:43.597659500 4156 tnef2mime hooking data_post
but not the message supposed to be written in the log. I tried with various loglevels, and also $self->log instead of $self->qp->log, but I never get anything more in the log file...
What is wrong ? What can I try more ?
-
I found I had to issue sv t qpsmtpd before qpsmtpd would recognize any changes to either the config files or the contents of the plugin.
Doing this got a message in /var/log/qpsmtpd/current:
1) Download your plugin code and save it as /usr/share/qpsmtpd/plugins/my_plugin
2) Change 'LOGINFO' to 'LOGWARN' (just to avoid changing my loglevel)
3) Insert "my_plugin" between "#bcc disabled" and "check_relay" in /var/service/qpsmtpd/config/peers/0
4) restart qpsmtpd using sv t qpsmtpd
5) send myself an email from an outside host
results:
@400000004f0c378e34f27374 4866 my_plugin is working !
@400000004f0c378e35e3f794 4866 check_goodrcptto plugin (rcpt): stripping '-' extensions
-
Hi,
Sorry to be so late to answer...
Yes, it's working !
I don't understand why it cannot work just with
signal-event email update
and works well with
sv t qpsmtpd
??? Should not this command launched by the email-update event ?