on the SD card create folders (in arduino):
mail. mail/mailboxes/ mail/mailboxes/yafa/ mail/mailboxes/default
create the file mail/procmailrc containing:
SHELL=/bin/sh MAILDIR=/mnt/sda1/arduino/mail/mailboxes DEFAULT=$MAILDIR/default LOGFILE=$MAILDIR/procmail.log :0:/mnt/sda1/arduino/mail/procmail.lock * ^TOme@yafasomething.com | cat - > yafa/yafa_msg.txtyou can test procmail by e.g.
procmail ./procmailrc < testmail2.txtwhere testmail2.txt contains e.g.
From: me@example.com To: me@yafasomething.com X-info: I'm just testing BODY OF MESSAGE SEPARATED BY EMPTY LINE txt txt txt txt txt txt txt txt txt txtNow in our fetchmailrc change the procmail line to:
mda "/usr/bin/procmail /mnt/sda1/arduino/mail/procmailrc"
Now if a mail is sent to me@yafasomething.com and we run fetchmail -vk the message should arrive in the specified yafa_msg.txt file. To avoid procmail errors I also created the folder /var/spool/mail, but it is not the goal that something arrives in here.
This topic is continued here.
No comments:
Post a Comment