アプリ版:「スタンプのみでお礼する」機能のリリースについて

キャノネットというサーバーでフリーのメールフォームCGI設置を試みました、-fと-tオプション設定を行わなければならないみたいなのですが、今回使用したいCGIの初期設定ファイルsendmail指定部分下記に

#sendmailのパス
$init->{sendmail_path} = '/usr/local/bin/sendmail -t -f ' メールアドレス' ';

と指定しましたがCGIエラーとなってしまい、どうやらプログラム内を書き換える必要があるみたいなのですが、知識不足のため
どうやって変更するのかがわからず困っております。
お詳しい方、下記のプログラム内の変更部分をお教え下さい。
よろしくお願い致します。
(CGIはURLのものを使用しております。)
http://www.web-liberty.net/download/mailplus/ind …
--------------------------------------------------
package webliberty::Sendmail;

use strict;
use Jcode;
use webliberty::Encoder;

### コンストラクタ
sub new {
my $class = shift;

my $self = {
sendmail => shift,
send_to => undef,
send_from => undef,
subject => undef,
name => undef,
message => undef,
files => undef,
x_mailer => undef
};
bless $self, $class;

return $self;
}

### メール送信
sub sendmail {
my $self = shift;
my %args = @_;

$self->{send_to} = $args{'send_to'};
$self->{send_from} = $args{'send_from'};
$self->{subject} = $args{'subject'};
$self->{name} = $args{'name'};
$self->{message} = $args{'message'};
$self->{files} = $args{'files'};
$self->{x_mailer} = $args{'x_mailer'};

if (!$self->{send_to}) {
$self->{send_to} = 'example@example.com';
}
if (!$self->{send_from}) {
$self->{send_from} = 'example@example.com';
}
if (!$self->{subject}) {
$self->{subject} = 'No Subject';
}
if (!$self->{message}) {
$self->{message} = 'No Message';
}
if (!$self->{x_mailer}) {
$self->{x_mailer} = 'Web Liberty';
}

foreach ($self->{subject}, $self->{name}, $self->{message}) {
$_ =~ s/<br ?/>/?n/g;
$_ =~ s/&amp;/&/g;
$_ =~ s/&lt;/</g;
$_ =~ s/&gt;/>/g;
$_ =~ s/&quot;/"/g;
}

if ($self->{name}) {
$self->{send_from} = "?"" . $self->_encode($self->{name}) . "?" <$self->{send_from}>";
}

$self->{message} =~ s/?xEF?xBD?x9E/?xE3?x80?x9C/g;
$self->{message} = Jcode->new($self->{message}, 'utf8')->jis;

my @files = split(/?n/, $args{'files'});

my $boundary;
if ($files[0]) {
require webliberty::File;

$boundary = time;
while ($self->{message} =~ /$boundary/) {
$boundary++;
}
}

open(webliberty_Sendmail, "| $self->{sendmail} -t") or return(0, "Sendmail Error : $self->{sendmail}");
print webliberty_Sendmail "X-Mailer: $self->{x_mailer}?n";
print webliberty_Sendmail "To: $self->{send_to}?n";
print webliberty_Sendmail "From: $self->{send_from}?n";
print webliberty_Sendmail "Subject: " . $self->_encode($self->{subject}) . "?n";

if ($files[0]) {
print webliberty_Sendmail "Content-Type: multipart/mixed; boundary=?"$boundary?"?n?n";
print webliberty_Sendmail "--$boundary?n";
}

print webliberty_Sendmail "Content-Transfer-Encoding: 7bit?n";
print webliberty_Sendmail "Content-Type: text/plain; charset=iso-2022-jp?n?n";
print webliberty_Sendmail "$self->{message}?n";

foreach (@files) {
my $file_ins = new webliberty::File($_);
my $file_name = $file_ins->get_name . '.' . $file_ins->get_ext;

print webliberty_Sendmail "--$boundary?n";
print webliberty_Sendmail "Content-Type: application/octet-stream; name=?"$file_name?"?n";
print webliberty_Sendmail "Content-Transfer-Encoding: X-uuencode?n";
print webliberty_Sendmail "Content-Disposition: attachment; filename=?"$file_name?"?n?n";

if (open(webliberty_Sendmail_FILE, $_)) {
binmode(webliberty_Sendmail_FILE);
print webliberty_Sendmail $self->_uuencode(join('', <webliberty_Sendmail_FILE>), $file_name);
close(webliberty_Sendmail_FILE);
}
}

close(webliberty_Sendmail);

return 1;
}

A 回答 (1件)

> $init->{sendmail_path} = '/usr/local/bin/sendmail -t -f ' メールアドレス' ';



これだとシングルクオートでくくられた文字列中にシングルクオートが入っていて、正しい文字列になってません。
> $init->{sendmail_path} = '/usr/local/bin/sendmail -t -f "メールアドレス" ';

としたらどうなりますか?

この回答への補足

ご回答ありがとうございます。
以前に"メールアドレス" ';で試したのですが
エラーとなりCGIが稼働しなくなってしまいます。
(サーバーマニュアルの記述でご質問させて頂きました。)
先ほどためしにもう一度変更してアップしてみたのですが
Internal Server Errorとなってしまします。

これはCGI初期設定部分での-fオプションや-tオプションを受け付けないということなのでしょうか。

補足日時:2009/04/17 21:05
    • good
    • 0
この回答へのお礼

先ほど補足させて頂きましたが、もう一度見直した結果。
色々設定を変更している間に他の設定部分が変更されていたみたいで
ご回答頂きました内容を再度チェックした結果
正常に作動致しました。
「うっかりしておりました」誠に申し訳ございません。
お騒がせいたしました。
とても助かりました。ありがとうございます。

お礼日時:2009/04/17 21:28

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!