Nachtrag:
Es klappt dann wohl noch mit postconnect:
Aus /etc/fetchmailrc:
Code:
# /etc/fetchmailrc
# ----------------------------------------------------------------------
# global options
# ----------------------------------------------------------------------
set daemon 900 # Poll every 15 minutes
set postmaster root # defaults to postmaster
set no bouncemail # avoid loss on 4xx errors
# on the other hand, 5xx errors get
# more dangerous...
set no syslog # log through syslog facility
set logfile /var/log/fetchmail.log # ...or specify a logfile
# ----------------------------------------------------------------------
# accounts
# ----------------------------------------------------------------------
poll pop.kundenserver.de with protocol POP3
user "bla" there with password "geheim" is "myuser" here
user "blupp" there with password "strenggeheim" is "myuser" here
ssl sslproto tls1
sslfingerprint "8F:97:49:0A:BC:47:B9:C0:85:33:F1:18:AB:4D:EC:44"
postconnect /usr/local/bin/check_fingerprint_not_match
... und hier die Prüfdatei "check_fingerprint_not_match":
Code:
#!/bin/bash
bin_grep=/bin/grep
bin_logtail=/usr/sbin/logtail
bin_mail=/usr/bin/mailx
log_mail=/var/log/fetchmail.log
${bin_logtail} ${log_mail} |\
${bin_grep} -B1 'fingerprints do not match' |\
${bin_mail} -e -s 'fetchmail: fingerprint do not match, evtl. wurde das Zertifikat mal wieder gewechselt' postmaster
Da der fetchmail-daemon nicht nicht als root läuft, muss die Logdatei den richtigen Benutzer haben. Beim ersten Mal einfach die beiden Dateien /var/log/fetchmail und /var/log/fetchmail.offset (logtail!) anlegen und Besitzer und Rechte anpassen, später stellt logrotate sicher, dass es so bleibt:
Die Datei /etc/logrotate.d/fetchmail:
Code:
/var/log/fetchmail.log {
rotate 7
daily
compress
missingok
notifempty
create 640 fetchmail adm
}
Monolog beendet
L00NIX
Lesezeichen