I am writing, for lack of a better term, a mail server.
The user sends email from my web page to this mail
server. Initially, I test for "Contact site Admin"
that's in the body of the initial email and then
send the email out to one of my clients. Note that
I insert the email of the initiator into a header
field named "X-Mailto-Comment:" not with procmail
but in the perl mailer fired off from the web page.
I also write the subject of the email into a file.
This code seems to work fine.
:0 Bc
* Contact site Admin
| formail -cz -I "From: purple(_at_)visi(_dot_)com" \
| $SENDMAIL -oi $ADMIN
:0 wci:
* ^Subject:[ ]\/[^ ].*
| echo "Subject is: " $MATCH >>$HOME/BHmail_log
question: what's the difference between formail -rt
and formail -cz? I can't seem to find a list of
formail options.
Because I inserted the "From: purple(_at_)visi(_dot_)com", the
client can now just reply to the message and it goes
back to the mail server. The client's email header
indeed contains the line
"X-Mailto-Comment: originator(_at_)email(_dot_)address"
I am trying to have the mail server extract "client(_at_)email(_dot_)address"
from the "X-Mailto-Comment:" field and put it into the TO
field and put the clients email address in the "From:"
I am failing badly at this. Any help would be appreciated.
No match appears for the "X-Mailto-Comment:" line
Tom
#test to see if a reply from client
:0
* ^Subject:.*Re: HawkWeb
{
:0c
* ^X-Mailto-Comment:[ ]\/[^ ].*
| echo "X-Mailto-Comment: " $MATCH >>$HOME/BHmail_log
initiatoremail = $MATCH
:0c
* ^Subject:[ ]\/[^ ].*
| echo "Subject is: " $MATCH >>$HOME/BHmail_log
:0
| formail -cz \
| $SENDMAIL -oi $initiatoremail
}
I think the "FROM:" will show up as that of the client who
is replying, but I can't get that far.