Procmail autoreply

If you want autoreply message with several lines in it, and have this text in a nice layout, it should be ina separate autoreply file.
So to have all function properly, you need three files in user’s home directory /home/user1 :

.forward
|exec /usr/bin/procmail

.procmailrc
SHELL=/bin/bash
LOGFILE=/home/korisnik1/procmailrc.log
VERBOSE=on
#Autoreply for every incoming mail
:0 h c
* !^FROM_DAEMON
* !^X-Loop: korisnik1@moj.domen
| (formail -r -I”Precedence: junk” \
-A”X-Loop: korisnik1@moj.domen” ; \
cat /home/korisnik1/poruka.txt) | $SENDMAIL -t

your.message.file.txt
Dear Sir,
bla bla
Best regards,
User1

Good link.

This entry was posted in Linux and tagged , . Bookmark the permalink.

Comments are closed.