So formail is to extract headers? Even after looking at some code I still have no clue what's going on. I found a page that does exactly what I want, and this is the main code to do it, but I just have no clue what's even going on in that code. Only thing I reconize is the cat command which would dump the actual message.
| (formail -r
-I"Precedence: junk"
-A"From: $VACATION_SENDER"
-A"X-Loop: $VACATION_XLOOP";
cat $VACATION_MSG ) |
$SENDMAIL_CMD
The whole code is here, but I don't need all the fancy stuff just need to send an email to the sender.
http://www.clarkconnect.com/wiki/index...._-_Procmail_Vacation_Auto-Reply_Recipe
Also, they never define the $SENDMAIL var so I have no clue what's suppost to go there, and it's used in $SENDMAIL_CMD, and in that code I don't see how it's being sent to the sender since there's no variable with the sender's address being plugged into the sendmail command (which is non existent to begin with). I'm thinking the -A"From: $VACATION_SENDER" \ part actually takes what is in front of from: and puts it in that variable, but then again, maybe $VACATION_SENDER is already defined and being plugged in there, hard to tell.
Would all this be easier with maildrop? I was reading up on it, and the syntax makes way more sense, which would make things easier I think, but deploying it would be a different story given my mail system is all based on procmail (my bad mistake).
Oh and in case this helps this is my entire procmail file, don't mind the commented parts, that's all my (failed) attempts at making it send an email to a fixed address, until I can figure out how to make it use the sender's address instead of a static.
:0fw
| spamc
:0H
* ^subject:.*\[SPAM\]
/home/email_news/mail/spam
:0fw
|/data/samba/shared/ryan/applications/news_parser/parser.app
:0
* ^X-parse-status:.*fail
{
:0 c
!73424.iceteks.news.34785245353@gmail.com
:0
/home/email_news/mail/not-parsed
#:0fw
#|mail -s "News parse Failed"
email_webmaster@borg.loc < /data/samba/shared/ryan/applications/news_parser/bounce_email.txt
#:0e
#|cat /data/samba/shared/ryan/applications/news_parser/bounce_email.txt | sendmail
email_ryan@borg.loc
:0e
|sendmail
email_ryan@borg.loc </data/samba/shared/ryan/applications/news_parser/bounce_email.txt
}
:0
*! ^X-parse-status:.*fail
/home/email_news/mail/parsed