Just pipe mails to filter after fetching them.
Usage: |
mailf [-d Domain] [-n Postmaster] ([-t ToDomain] [-s Host] [-l logfile]) mailf [-d Domain] [-n Postmaster] ([-t ToDomain] [-m MDA] [-l logfile]) mailf [-d Domain] [-n Postmaster] ([-r address] ...) mailf [-d ...] [-n ...] (...) ([--keepresend] [--novbs] [--no550]) mailf [-d ...] [-n ...] (...) ([--vscan "/path../scanner opt"]) mailf [-d ...] [-n ...] (...) ([--delmass] | [--mass2pm]) mailf [-v] [-h | --help] |
-d Domain part (default: yourdom.zzz) -n Postmaster Name/Alias (default: postmaster) -t Rewrite to this Domain -r EMail address for all mails (ignores all addresses in header) -s SMTP Host (only if other than localhost) -m MDA for send mail -l Logfile --keepresend On local error, not delete mail (please see other options for details) --no550 Mails "550 user unknown" won't be send to sender of a mail --novbs Overwrite VB-Worm-Virus common file extensions with .txt --vscan Scan attachments for virus with external scanner --delmass Delete mails contain X-Mailer: ...Mass Sender... (Spam) --mass2pm Send mass mail with notify to postmaster and delete -v Display Version Info -h Display this short help |
For default mailf uses SMTP on localhost to send mails and postmaster as
postmasteralias:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d yourdomain.xxx"
---snip---
Example for mail.yourdomain.xxx as SMTP-Host to send mails:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d yourdomain.xxx" -s mail.yourdomain.xxx
---snip---
Example for webmaster@yourdomain.xxx as postmasteralias and
"/usr/bin/sendmail -t" as MDA:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d yourdomain.xxx -n webmaster -m '/usr/bin/sendmail -t'"
---snip---
!!! Important: If there are spaces in the -m statement than it
have to be quoted !!!
Example for different internet and local domain and webmaster as
postmasteralias:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d internet-domain.xxx -t local-domain.yyy -n webmaster"
---snip---
Example for yourdomain.xxx as offical domain, localdomain.yyy as localdomain,
mailadmin as postmasteralias, mail.localdomain.yyy as SMTP-Host and
/var/log/mailf.log as logfile:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d yourdomain.xxx -t localdomain.yyy -n mailadmin \
-s mail.localdomain.yyy -l /var/log/mailf.log"
---snip---
!!! Important: The user mailf is started with must have write permission to the
file /var/log/mailf.log !!!
Example for different internet and local domain and webmaster as
postmasteralias:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d internet-domain.xxx -t local-domain.yyy -n webmaster"
---snip---
Example for "/usr/local/uvscan/uvscan --secure" as Virusscanner, not
delete infected files from tmp-folder only from mail and Mass Mailer
spam to postmaster:
.fetchmailrc:
---snip---
poll mail.provider.xxx protocol POP3 no dns user multimailbox password xxxxx \
mda "/usr/local/bin/mailf -d yourdomain.xxx -n postmaster --mass2pm --vscan
'/usr/local/uvscan/uvscan --secure' --nodelvir"
---snip---
!!! Important: If there are spaces in the --vscan statement than it
have to be quoted and path must be absolute path(begins with /) !!!
For details about fetchmail syntax, please refer fetchmail manual pages or the fetchmail homepage.
The Delivered-To: lines of QMail contain a prefix to the mailaddress. If mails are fetched from a provider using QMail, the filter will try to resend the mail with the mailadress including the prefix. The result of such resend-tries are "550 User unknown" errors. With the -qp QMail-Prefix option (by Guillermo Borgobello) these prefix will be striped of the mailaddress.
Example:
.fetchmailrc:
---snip---
poll mail.provider.xxx ... mda "/usr/local/bin/mailf ...(options as above)... -qp qmail_"
---snip---