info:mail
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
info:mail [2015/01/23 17:01] – implemented hartmut | info:mail [2024/02/20 11:46] (current) – [Address Mapping] hartmut | ||
---|---|---|---|
Line 9: | Line 9: | ||
The domain of the incoming address must be one of the domains listed in '' | The domain of the incoming address must be one of the domains listed in '' | ||
- | After editing the file, run the following | + | If you changed the aliases, run |
+ | # postalias / | ||
+ | After editing the '' | ||
# postmap / | # postmap / | ||
+ | |||
+ | After that, | ||
# postfix reload | # postfix reload | ||
Line 24: | Line 28: | ||
To add custom sieve scripts, I recommend installing the [[http:// | To add custom sieve scripts, I recommend installing the [[http:// | ||
+ | |||
+ | 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: | For specific information about managing sieve on antiguru.de look at [[moritz: | ||
- | ===== 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. | ||
+ | |||
+ | ===User Agents=== | ||
+ | Icedove/ | ||
+ | |||
+ | Take care when creating new folders: If you don't create them as subfolders to the mailbox root, but instead as subfolders to INBOX, it may happen that you end up with an INBOX folder on the server, containing nothing but the aforementioned subfolder. This is because in this here setup, the INBOX is no folder, but only exists virtually. So: never create subfolders to INBOX, and you won't run into difficulties | ||
+ | |||
+ | When it comes to **mobile user agents**, the picture changes: The stock email app for Android Lollipop, called ' | ||
+ | |||
+ | There are a lot of mail user agents or clients for Android, but most of them are either still a whole lot more ugly than GMail, or do not offer more functionality, | ||
+ | |||
+ | By 'doing its job' I mean: the email client should at least take note of mails appearing in subfolders, and possibly offer a unified inbox, a virtual folder where all unread mail is presented in a bundle. It should not pester you with advertisements and, if to be paid, at least be free to try out. | ||
+ | |||
+ | After testing dozens of email clients, I can conclude that I found only one that matched these criteria, and even to some extent surpassed them. It is called Aquamail[[https:// | ||
+ | |||
+ | So far, testing Aquamail has shown very positive results. I'll keep you updated. | ||
+ | |||
+ | ==== 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. | ||
+ | < | ||
+ | $ touch ~/ | ||
+ | $ chmod 0600 / | ||
+ | </ | ||
+ | Then, edit this file to match your credentials for the inbox you want to poll: | ||
+ | < | ||
+ | #log to system log - enable after verifying your setup | ||
+ | #set syslog | ||
+ | poll pop.gmx.net protocol pop3: | ||
+ | | ||
+ | # 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 | ||
+ | </ | ||
+ | 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: | ||
+ | < | ||
+ | */5 * * * * / | ||
+ | </ | ||
+ | (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 / | ||
+ | * 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. But it has not yet been implemented on the ' | + | The setup described does now fulfill the expectations. Amavisd does now scan and decorate mails from fetchmail. |
After lots of trials which didn't work, I decided to move away from the production server. | After lots of trials which didn't work, I decided to move away from the production server. | ||
Line 95: | Line 174: | ||
# the MX record (or backup mailers) should point to this IP address | # the MX record (or backup mailers) should point to this IP address | ||
# set to your external IP address | # set to your external IP address | ||
- | # this does not work when you want to run this service chrooted, see below | + | # this does not work when you want to run this service chrooted |
# | # | ||
# -o content_filter=amavisfeed: | # -o content_filter=amavisfeed: | ||
Line 130: | Line 209: | ||
< | < | ||
# regular incoming mail, originating from anywhere (usually from outside) | # regular incoming mail, originating from anywhere (usually from outside) | ||
+ | # this works chrooted if you've set a content filter in main.cf | ||
+ | # like so: content_filter = amavisfeed: | ||
+ | # (this name must match the one given above). | ||
# the MX record (or backup mailers) should point to this IP address | # the MX record (or backup mailers) should point to this IP address | ||
# set to your external IP address | # set to your external IP address | ||
Line 135: | Line 217: | ||
</ | </ | ||
Of course, you'll have to enter the external IP address of your mail server (MX record) here. | Of course, you'll have to enter the external IP address of your mail server (MX record) here. | ||
- | This will run the smtp service that can be reaches | + | This will run the smtp service that can be reached |
+ | |||
+ | For roaming users reaching the server via smtps, we add a content filter to map them to our local port for amavisd: | ||
+ | < | ||
+ | smtps | ||
+ | -o smtpd_tls_wrappermode=yes | ||
+ | -o smtpd_sasl_auth_enable=yes | ||
+ | -o smtpd_client_restrictions=permit_sasl_authenticated, | ||
+ | -o milter_macro_daemon_name=ORIGINATING | ||
+ | -o content_filter=amavisfeed: | ||
+ | </ | ||
+ | (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' | ||
+ | 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. | ||
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. | ||
Line 146: | Line 247: | ||
* listen on the external IP address as smtp server and hand over mail from there to amavis at port 10040 | * listen on the external IP address as smtp server and hand over mail from there to amavis at port 10040 | ||
+ | * listen on the smtps port and hand over email messages received there to amavis at port 10042 | ||
* listen on the local loopback email address at port 2345 as smtp server and hand over mail from there to amavis at port 10041 | * listen on the local loopback email address at port 2345 as smtp server and hand over mail from there to amavis at port 10041 | ||
* listen on the local loopback email address as smtp server and hand over mail from there to amavis at port 10042 | * listen on the local loopback email address as smtp server and hand over mail from there to amavis at port 10042 | ||
Line 188: | Line 290: | ||
# regular incoming mail, originating from anywhere (usually from outside) | # regular incoming mail, originating from anywhere (usually from outside) | ||
$policy_bank{' | $policy_bank{' | ||
- | originating => 1, | ||
}; | }; | ||
Line 203: | Line 304: | ||
# mail locally submitted on the host on which MTA runs | # mail locally submitted on the host on which MTA runs | ||
+ | # or submitted via the smtps port by roaming users | ||
$policy_bank{' | $policy_bank{' | ||
+ | originating => 1, | ||
# NOTE: this is just an example; ignoring internally generated spam | # NOTE: this is just an example; ignoring internally generated spam | ||
# may not be such a good idea, consider zombified infected local PCs | # may not be such a good idea, consider zombified infected local PCs |
info/mail.1422032493.txt.gz · Last modified: 2015/01/23 17:01 by hartmut