https://claws-mail.org/faq/api.php?action=feedcontributions&user=Bwlang&feedformat=atomClaws Mail FAQ - User contributions [en]2024-03-29T05:20:39ZUser contributionsMediaWiki 1.35.7https://claws-mail.org/faq/index.php?title=Using_Claws_Mail_with_other_programs&diff=1535Using Claws Mail with other programs2006-09-12T16:56:53Z<p>Bwlang: %F -> %f , otherwise multiple messages don't work</p>
<hr />
<div>=== How can I use Sylpheed-Claws with bogofilter? ===<br />
<br />
First of all, make sure you have trained bogofilter; for different training methods, see [http://bogofilter.sourceforge.net/faq.shtml#training http://bogofilter.sourceforge.net/faq.shtml#training]. Method 4 is recommended, but requires a large number of ham and spam messages.<br />
<br />
Add a new filtering rule: you need a filtering condition which runs bogofilter on incoming messages; and an action that has to be performed if the message was recognised as spam.<br />
Go to the Filtering Configuration dialog, and type the following in the condition entry field:<br />
<br><br />
<pre>test "bogofilter -u < %F"</pre><br />
Note 1: this assumes that bogofilter is in your path!<br><br />
Note 2: the -u parameter of bogofilter registers the message automatically as either spam or ham.<br />
<br />
Next add an action in the Action field. The best way is to use the Define... button next to the field. As an example, if you wanted to move a spam messages to a directory called Spam, then the final action, put in the field, could look like this:<br />
<br><br />
<pre>move "#mh/Mailbox/Spam"</pre><br />
<br />
After having added the filtering rule you probably want to create two Sylpheed-Claws Actions: one for marking messages as spam, and one for marking messages as ham. These actions can be used to correct bogofilter and/or to train it with additional messages. For example, if the above filtering rule did not detect a spam message correctly, delivering it to your inbox, you can manually correct this by invoking a "Mark As Spam" action. As an added bonus, Actions are automatically added to the main menu (under Tools|Actions), and can also be added to the main toolbar.<br />
<br />
Open the Actions dialog (Configuration | Actions...). In the Menu name field, enter the following:<br />
<br><br />
<pre>Mark As Spam</pre><br />
This is just the text as it would appear in the Tools|Actions submenu.<br />
<br />
The accompanying command line for Mark As Spam should be:<br />
<br><br />
<pre>bogofilter -Ns -B %F</pre><br />
(Don't forget to use the Add button!)<br />
<br />
Likewise, the same thing you should do for marking messages as ham. Select "New" in the Current actions list, and enter the following in the Menu name:<br />
<br><br />
<pre>Mark As Ham</pre><br />
<br />
The command line for this action should be:<br />
<br><br />
<pre>bogofilter -Sn -B %F</pre><br />
And add the action by clicking the Add button.<br />
<br />
This gives you a basic setup for bogofilter and Sylpheed-Claws.<br />
<br />
<br />
=== How can I use Sylpheed-Claws with Popfile? ===<br />
You can reclass messages received trough a Popfile filter with a header link or a button in Sylpheed-Claws.<br />
Popfile lives @ http://popfile.sourceforge.net/ <br />
<br />
First read the Popfile documentation on how to set up the mail client to use Popfile.<br />
<br />
You have 2 options to reclass received messages: a simple one (header link) and a difficult one (toolbar button).<br />
<br />
'''1) Simple method'''<br />
<br />
* Open the Popfile control center, go to the "Buckets" tab, and make sure ALL buckets have the ''X-POPFile-Link Header'' turned on.<br />
* Open Sylpheed-Claws preferences window, go to Message view -> Text options.<br />
* Edit the header display options, in the "Displayed header configuration" dialog add ''X-POPFile-Link'' to the displayed headers.<br />
* All messages received via Popfile will have a header link (just above the message body) called ''X-POPFile-Link'', something like this: ''X-POPFile-Link: http://127.0.0.1:7070/jump_to_message?view=6491'' - you can click on it and Claws will open the link with the browser you set up in preferences.<br />
<br />
'''2) difficult method'''<br />
<br />
You will need 3 things:<br />
* a bash script<br />
* a Sylpheed-Claws action<br />
* change Popfile configuration a bit.<br />
<br />
'''The bash script:'''<br />
<pre><br />
#!/bin/bash<br />
url=`cat $1 | grep -e X-POPFile-Link:.* -o|grep http.* -o`<br />
firefox $url<br />
</pre><br />
<br />
Save it as /some/path/popreclass.sh<br />
<br>''Change firefox to another browser executable if needed.''<br />
<br />
'''The action:'''<br />
<br>/some/path/popreclass.sh "%f"<br />
<br>''You can set up a toolbar buttor for the action later''<br />
<br />
'''Popfile configuration'''<br />
<br>Go to http://127.0.0.1:8080/configuration, and make sure the '''X-POPFile-Link Header''' option is turned '''ON'''.<br />
<br>''Your popfile URL might be different.''<br />
<br />
You will be able to reclass messages that were received with the above option turned ON.<br />
<br />
=== How can I use Sylpheed-Claws with SpamAssassin? ===<br />
<br />
To train spamassassin in Sylpheed-Claws (>=1.9.6):<br />
<br><br />
Menu > Configuration > Actions<br />
<br> In 'Menu Name' add "Mark as Spam"<br />
<br> In 'Command line' add -sa-learn --spam %F-<br />
<br> click the Add button<br />
<br><br />
Menu > Configuration > Actions<br />
<br> In 'Menu Name' add "Mark as Ham"<br />
<br> In 'Command line' add -sa-learn --ham %F-<br />
<br> click the Add button<br />
<br />
<br> If you want to have the mail learned on a remote mail server, that's possible with a 'Command line' like this:<br />
<br> ssh host.domain sa-learn --ham < %f<br />
<br> It works best if you have already setup ssh to use keys for authentication.<br />
<br />
<br> then select a message, <b>Menu Tools > Actions</b><br />
will have the new actions to mark your email as Spam/Ham. Once you click one of the buttons spamassassin will process your request - this takes time so be patient and dont click on the 'cancel' button.</div>Bwlanghttps://claws-mail.org/faq/index.php?title=Using_Claws_Mail_with_other_programs&diff=1534Using Claws Mail with other programs2006-09-12T16:41:45Z<p>Bwlang: adds note about how to remote learn</p>
<hr />
<div>=== How can I use Sylpheed-Claws with bogofilter? ===<br />
<br />
First of all, make sure you have trained bogofilter; for different training methods, see [http://bogofilter.sourceforge.net/faq.shtml#training http://bogofilter.sourceforge.net/faq.shtml#training]. Method 4 is recommended, but requires a large number of ham and spam messages.<br />
<br />
Add a new filtering rule: you need a filtering condition which runs bogofilter on incoming messages; and an action that has to be performed if the message was recognised as spam.<br />
Go to the Filtering Configuration dialog, and type the following in the condition entry field:<br />
<br><br />
<pre>test "bogofilter -u < %F"</pre><br />
Note 1: this assumes that bogofilter is in your path!<br><br />
Note 2: the -u parameter of bogofilter registers the message automatically as either spam or ham.<br />
<br />
Next add an action in the Action field. The best way is to use the Define... button next to the field. As an example, if you wanted to move a spam messages to a directory called Spam, then the final action, put in the field, could look like this:<br />
<br><br />
<pre>move "#mh/Mailbox/Spam"</pre><br />
<br />
After having added the filtering rule you probably want to create two Sylpheed-Claws Actions: one for marking messages as spam, and one for marking messages as ham. These actions can be used to correct bogofilter and/or to train it with additional messages. For example, if the above filtering rule did not detect a spam message correctly, delivering it to your inbox, you can manually correct this by invoking a "Mark As Spam" action. As an added bonus, Actions are automatically added to the main menu (under Tools|Actions), and can also be added to the main toolbar.<br />
<br />
Open the Actions dialog (Configuration | Actions...). In the Menu name field, enter the following:<br />
<br><br />
<pre>Mark As Spam</pre><br />
This is just the text as it would appear in the Tools|Actions submenu.<br />
<br />
The accompanying command line for Mark As Spam should be:<br />
<br><br />
<pre>bogofilter -Ns -B %F</pre><br />
(Don't forget to use the Add button!)<br />
<br />
Likewise, the same thing you should do for marking messages as ham. Select "New" in the Current actions list, and enter the following in the Menu name:<br />
<br><br />
<pre>Mark As Ham</pre><br />
<br />
The command line for this action should be:<br />
<br><br />
<pre>bogofilter -Sn -B %F</pre><br />
And add the action by clicking the Add button.<br />
<br />
This gives you a basic setup for bogofilter and Sylpheed-Claws.<br />
<br />
<br />
=== How can I use Sylpheed-Claws with Popfile? ===<br />
You can reclass messages received trough a Popfile filter with a header link or a button in Sylpheed-Claws.<br />
Popfile lives @ http://popfile.sourceforge.net/ <br />
<br />
First read the Popfile documentation on how to set up the mail client to use Popfile.<br />
<br />
You have 2 options to reclass received messages: a simple one (header link) and a difficult one (toolbar button).<br />
<br />
'''1) Simple method'''<br />
<br />
* Open the Popfile control center, go to the "Buckets" tab, and make sure ALL buckets have the ''X-POPFile-Link Header'' turned on.<br />
* Open Sylpheed-Claws preferences window, go to Message view -> Text options.<br />
* Edit the header display options, in the "Displayed header configuration" dialog add ''X-POPFile-Link'' to the displayed headers.<br />
* All messages received via Popfile will have a header link (just above the message body) called ''X-POPFile-Link'', something like this: ''X-POPFile-Link: http://127.0.0.1:7070/jump_to_message?view=6491'' - you can click on it and Claws will open the link with the browser you set up in preferences.<br />
<br />
'''2) difficult method'''<br />
<br />
You will need 3 things:<br />
* a bash script<br />
* a Sylpheed-Claws action<br />
* change Popfile configuration a bit.<br />
<br />
'''The bash script:'''<br />
<pre><br />
#!/bin/bash<br />
url=`cat $1 | grep -e X-POPFile-Link:.* -o|grep http.* -o`<br />
firefox $url<br />
</pre><br />
<br />
Save it as /some/path/popreclass.sh<br />
<br>''Change firefox to another browser executable if needed.''<br />
<br />
'''The action:'''<br />
<br>/some/path/popreclass.sh "%f"<br />
<br>''You can set up a toolbar buttor for the action later''<br />
<br />
'''Popfile configuration'''<br />
<br>Go to http://127.0.0.1:8080/configuration, and make sure the '''X-POPFile-Link Header''' option is turned '''ON'''.<br />
<br>''Your popfile URL might be different.''<br />
<br />
You will be able to reclass messages that were received with the above option turned ON.<br />
<br />
=== How can I use Sylpheed-Claws with SpamAssassin? ===<br />
<br />
To train spamassassin in Sylpheed-Claws (>=1.9.6):<br />
<br><br />
Menu > Configuration > Actions<br />
<br> In 'Menu Name' add "Mark as Spam"<br />
<br> In 'Command line' add -sa-learn --spam %F-<br />
<br> click the Add button<br />
<br><br />
Menu > Configuration > Actions<br />
<br> In 'Menu Name' add "Mark as Ham"<br />
<br> In 'Command line' add -sa-learn --ham %F-<br />
<br> click the Add button<br />
<br />
<br> If you want to have the mail learned on a remote mail server, that's possible with a 'Command line' like this:<br />
<br> ssh host.domain sa-learn --ham < %F<br />
<br> It works best if you have already setup ssh to use keys for authentication.<br />
<br />
<br> then select a message, <b>Menu Tools > Actions</b><br />
will have the new actions to mark your email as Spam/Ham. Once you click one of the buttons spamassassin will process your request - this takes time so be patient and dont click on the 'cancel' button.</div>Bwlang