I'm not sure that that you've read all the documentation, because I think you'll find that postfix provides a complete sendmail drop-in replacement. You think you're talking to the sendmail binary, but it fact postfix has replaced it with its own version, that connects to the postfix backend. In theory the change should be transparent. Can you describe the problems you are having?
I note that you are not testing whether you actually succeed in opening the pipe to your mailer. You should do something like:
open (MAIL, "|$mail_prog -t") or die "Could not open output pipe to $mail_prog: $!\n";Secondly, beware of the marching print statements. Use a here-doc or a template system (if you want to get fancy). A here-doc looks like this:
print MAIL <<MAIL_MESSAGE; To: $recip Reply-to: $email From: $email Subject: Blah Display Name: $display Username: $username Password: $password Domain: $domain Updates: $service IP: $ip MAIL_MESSAGE
In fact, having cleaned up your code, I realise you were using double-quoted strings, hence subject to interpolation, but instead of interpolating variables, you were manually concatenating strings and variables, thus getting the worst of both worlds (in terms of readability). All those extra tokens are just syntax errors waiting to happen.
Finally, you are better off using a module that does some level of encapsulation of sending e-mail, be it Mimetools, Mail::Sendmail or even Net::SMTP. If you used one of these modules, it would matter even less to your script what MTA (Mail Transfer Agent) was in use.
Hope this helps.
In reply to Re: Postfix Sending Mail
by grinder
in thread Postfix Sending Mail
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |