Info | ||
---|---|---|
| ||
|
Setup DMS fetchmail:
First of all: install fetchmail
Code Block | ||||
---|---|---|---|---|
| ||||
# yum install fetchmail |
then you need to edit
/opt/fetchmail.script
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#! /bin/bash fetchmail -q fetchmail -v -K -p pop3 --auth password -f /etc/fetchmailrc --logfile /var/log/fetchmail.log --invisible --smtphost 192.168.1.71 --smtpaddress serviva.com -d 300 |
...
then edit /etc/fetchmailrc
defaults
proto pop3
...
Code Block | ||||
---|---|---|---|---|
| ||||
defaults proto pop3 set logfile "/var/log/fetchmaillog" |
...
poll pop.1und1.de |
...
proto pop3 |
...
user "serviva@epmanagement.eu" |
...
pass "mypassword" |
...
is "serviva" |
...
keep |
most important setting is “keep” to keep the polled emails on the server. If you omit this, the polled mails will be deleted from the pop3 (exchange) server which might result in a shitstorm.
The file fetchmailrc can hold as many mail accounts as you like.
create User fetchmail
Code Block | ||||
---|---|---|---|---|
| ||||
# adduser fetchmail |
...
# passwd fetchmail |
...
# usermod -aG wheel fetchmail |
now make fetchmail the owner of the file /etc/fetchmailrc
Code Block | ||||
---|---|---|---|---|
| ||||
# chown fetchmail /etc/fetchmailrc |
And set that file to exclusive for user fetchmail
Code Block | ||||
---|---|---|---|---|
| ||||
# chmod -v 600 /etc/fetchmailrc |
then try if the user is working
Code Block | ||||
---|---|---|---|---|
| ||||
# su fetchmail |
whilst in the user fetchmail create a cronjob
Code Block | ||||
---|---|---|---|---|
| ||||
# crontab -e |
...
30 * * * * /opt/fetchmail.script |
Result:
Fetchmail picks up new emails from the defined email inboxes and delivers them to the postfix of DMS. This happens every 5 Minutes and the whole job is reinitiated every 30 minutes.
There is a lot more detail hundreds of fetchmail tutorials or the man page of fetchmail. This is my own cheatsheet and is by no means complete or all encompassing.
...
Verwandte Artikel
Content by Label | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...