Hello, hope someone can help as I've been tearing my hair out with this one.

I've been using Matts Script Archive Formail for many years without any problem and have always been able to make tweaks to code using the 'ReadMe' file and a bit of search engine work, however I'm drawing a blank on a particular issue and I have a very limited understanding of Perl!

A new site I'm producing is being hosted on a server that asks for the following:

Within the script, the mail program used for sending mail is /usr/lib/sendmail . You should not use this with the -t argument (which find the From and To in the email) but use -f 'from-email-address' 'to-email-address' in place of the -t argument.
So I have upgraded to the NMS Formail script for the debugging and extra features and I have spent the evening trying to get it to work with the -f flag/argument

I've removed my previously trusted "-oi -t" and tweaked it as follows:

$mailprog = '/usr/lib/sendmail -f name@domain.co.uk name@domain.co.uk';
This 'kind of' works, in that it sends a message from name@domain.co.uk to name@domain.co.uk (believe me this took me ages to work out!)

However I obviously need to replace the 'name@domain.co.uk' for the actual sender and recipient, and this is where I get stuck!

My assumption is that I just need to replace the 'name@domain.co.uk' with variables defined in the formail script, but I'm afraid I don't understand enough to work this out and all my attempts so far have failed!

I'd hoped something like this would work:

$mailprog = '/usr/lib/sendmail -f $from $to';
..but nope :-(

If anyone can advise I would be *very* grateful.


PS I can paste in the code from the NMS Formail Script if required - I've assumed that folks here are familiar with it?