Force Postfix From Address

I have Postfix set up on a Linux box.  Its only job is to send emails that are automatically generated through cron jobs (Perl scripts) and PHP web pages to various domain email address.  I'm not sure I'm explaining this correctly, but the Linux box sits on my intranet and sends emails out to the internet.  However - because my domain hosting company uses sender authentication, the emails are being bounced because, even though I set a valid FROM address in my scripts, Postfix is sending them from root@domain.com or apache2@domain.com, etc.  I have figured out how to set the domain name correctly in main.cf (mydomain=domain.com), but I can't figure out how to force it to send from a specific user and not the user that's running the script.   I'd like to set Postfix to send all emails from validuser@domain.com regardless of which cron job runs the script.  I hope I explained this correctly.

ANY HELP WOULD BE GREATLY APPRECIATED.
biffsmithAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

WarpsehCommented:
I'm not completely sure, but this doesn't seem like a Postfix error, but a script error. Are you sure you are correctly setting the from in the script? If you could paste here the bit of code that sends the email it would be very helpful :)
0
http:// thevpn.guruCommented:
Open your main.cf file
# vi /etc/postfix/main.cf

Append following parameter
smtp_generic_maps = hash:/etc/postfix/generic

Save and close the file. Open /etc/postfix/generic file:
# vi /etc/postfix/generic

Make sure tom-01@server01.hosting.com change to tom@domain.com
tom-01@server01.hosting.com tom@domain.com

Save and close the file. Create or update generic postfix table:
# postmap /etc/postfix/generic


http://www.cyberciti.biz/tips/howto-postfix-masquerade-change-email-mail-address.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
biffsmithAuthor Commented:
AWESOME shakoush2001!!  Thank you!!
0
http:// thevpn.guruCommented:
Glad I could help :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.