User Tools

Site Tools


info:mail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
info:mail [2015/01/23 22:07] – [Amavisd-new] hartmutinfo:mail [2015/01/29 20:10] – [Sieve] hartmut
Line 24: Line 24:
  
 To add custom sieve scripts, I recommend installing the [[http://sieve.mozdev.org/|Thunderbird Sieve]] extension. It allows the creation and syntax checking of sieve scripts directly on the server. On Debian, it is available as ''xul-ext-sieve'' package. To add custom sieve scripts, I recommend installing the [[http://sieve.mozdev.org/|Thunderbird Sieve]] extension. It allows the creation and syntax checking of sieve scripts directly on the server. On Debian, it is available as ''xul-ext-sieve'' package.
 +
 +Important: sieve scripts will only work when formatted with DOS-type CRLF linebreaks. The above extension takes care of that.
 +
 +If you set up a new user, do not forget that dovecot looks for a .dovecot.sieve script in that user's home directory (which may be also a symlink to an include script in a sieve folder).
  
 For specific information about managing sieve on antiguru.de look at [[moritz:antiguru.de|moritz:antiguru.de]]. For specific information about managing sieve on antiguru.de look at [[moritz:antiguru.de|moritz:antiguru.de]].
  
-===== Mail aggregation aka unified inbox (proposal) =====+===== Mail aggregation aka unified inbox ===== 
 + 
 +Objective: collect email messages from several legacy freemail inboxes, pass them through a reliable virus and spam filter, and dispatch them to the IMAP inbox on the server. 
 + 
 +Benefits: reliable and controllable spam filtering, POP3 inboxes made accessible via IMAP 
 + 
 +Drawback: on clients that can't be configured otherwise, answering mails received that way will result in the answers carrying your IMAP inbox address as sender. 
 + 
 +==== TLDR; ==== 
 + 
 +Now that the system wide setup is  working, it is simple to add a service that is polling an external inbox into your user's IMAP inbox here. Just create a file called .fetchmailrc in your user directory and adjust the  
 +permissions so that fetchmail is going to accept them. 
 +<code> 
 +  $ touch ~/.fetchmailrc 
 +  $ chmod 0600 /etc/fetchmailrc 
 +</code> 
 +Then, edit this file to match your credentials for the inbox you want to poll: 
 +<code> 
 +#log to system log - enable after verifying your setup 
 +#set syslog 
 +poll pop.gmx.net protocol pop3: 
 + username "XXXXXX" password "..........", is someuser here smtphost localhost/2345 
 +  # use secure connection relying on CA certificates 
 +  ssl 
 +  # do not delete from server (for testing) 
 +  keep 
 +  # get all messages, not just the ones that arrived after the last poll (use this after commenting out keep) 
 +  #fetchall 
 +</code> 
 +Now, run fetchmail verbosely: 
 + 
 +  $ fetchmail -v 
 + 
 +and check the output. If all is well, change the .fetchmailrc to delete messages from the remote inbox and log to system log, and add it to your crontab, so that it will be executed regularly by the system. 
 + 
 + 
 +  $ crontab -e 
 +   
 +Add a line like this to your crontab: 
 +<code> 
 +*/5 * * * * /usr/bin/fetchmail &> /dev/null 
 +</code> 
 +(this will poll every 5 minutes). Then, save and exit the editor. Now, the fetchmail job will run unattended as set in the crontab. 
 + 
 +Once this works, one could filter mail using the sieve method described above. 
 + 
 + 
 +==== For the administrator ==== 
 + 
 +To fine-tune the setup, there are some things to be taken into account: 
 +  * spam scores: In /etc/amavis/50-user, we define numerical spam score levels. The sa_tag2_level_deflt variable lets the spam filter decide if a mail is to be considered SPAMMY. This variable is set to 4.51 on our server at the time of writing, which may have to be adjusted after a test period. 
 +  * spam from the inboxes polled by fetchmail will be silently deleted when the score of sa_kill_level_deflt (now 20) is reached. You might want to review the logs for some time to look for false-positives being discarded. 
 +  * on the server, the rewriting of the subject lines of messages considered spam has been disabled. This makes it easier to deal with false positives. Just move them out of the spam folder. 
 +  * learning: do not delete true spam messages. After collecting lots of them, they should be used to train the spam filter. 
 +  * Ports: now, all clients submitting messages on port 465 (smtps) are considered local. Check if this is a valid assumption. If not, modify the system to accept these submissions on port 587 (submission). See below. 
 + 
 +===Setup details  ====
  
 The setup described does now fulfill the expectations. Amavisd does now scan and decorate mails from fetchmail. The setup described does now fulfill the expectations. Amavisd does now scan and decorate mails from fetchmail.
Line 150: Line 210:
 </code> </code>
 (just the last line was added!). (just the last line was added!).
 +
 +===Still problematic===
 +
 +But this assumes that only roaming clients will connect to the smtps port, which possibly is false.
 +
 +So, I think it would actually be preferable to separate the roaming user service from the other smtp(s) services. That's where the port used for mail submission comes in (port 587), it is in postfix' master.cf.
 +We'll have to take care that the chroot works for this too, and move the content flter for port 10042 to this service in master.cf.  And we'll need to open it in the firewall. Then, we'll have to change the port for the roaming smtp clients accordingly, so that the new submission path will be used. 
 +
  
 Finally, look for a line like this and comment it out as shown. Finally, look for a line like this and comment it out as shown.
info/mail.txt · Last modified: 2024/02/20 12:46 by hartmut

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki