191

ubuntuでsendmailの設定を検索したところ、明確な答えが得られませんでした.

基本的な構成でメール送信を有効にしたいだけです。基本的にはGoogleアプリエンジンで使用して、開発サーバーからのメール送信を有効にします。

私はすでにこれをしました:

sudo apt-get install sendmail

それから

sudo sendmailconfig

しかし、最後のものが実際に何をしたかはわかりません。

4

3 に答える 3

150

と入力するとsudo sendmailconfig、sendmail を構成するように求められるはずです。

参考までに、構成中に更新されるファイルは次の場所にあります (手動で更新する場合)。

/etc/mail/sendmail.conf
/etc/cron.d/sendmail
/etc/mail/sendmail.mc

コマンドラインに次のように入力して、sendmail が適切に構成および設定されているかどうかをテストできます。

$ echo "My test email being sent from sendmail" | /usr/sbin/sendmail myemail@domain.com

以下は、smtp リレーを sendmail に追加することを可能にします:

#Change to your mail config directory:
cd /etc/mail

#Make a auth subdirectory
mkdir auth
chmod 700 auth

#Create a file with your auth information to the smtp server
cd auth
touch client-info

#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"

#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..

次の行を sendmail.mc に追加しますMAILERDEFINITIONS. smtp サーバーを更新してください。

define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl

作成 sendmail.cf を呼び出します (または実行しますmake -C /etc/mail):

m4 sendmail.mc > sendmail.cf

sendmail デーモンを再起動します。

service sendmail restart
于 2012-04-28T00:35:45.733 に答える
35

小さな編集を1回行った後、トップアンサーが機能しました(まだ返信できません)

これは私にはうまくいきませんでした:

FEATURE('authinfo','hash /etc/mail/auth/client-info')dnl

各文字列の最初の一重引用符は、次のようにバックティック( `)に変更する必要があります。

FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

変更後、私は実行します:

sudo sendmailconfig

そして私は仕事をしています:)

于 2012-10-09T20:46:33.637 に答える
14

上記の2つの答えを組み合わせると、最終的に機能します。ファイル sendmail.mcでは、各文字列の最初の一重引用符がバッククォート (`)になっていることに注意してください。

#Change to your mail config directory:
cd /etc/mail

#Make a auth subdirectory
mkdir auth
chmod 700 auth  #maybe not, because I cannot apply cmd "cd auth" if I do so.

#Create a file with your auth information to the smtp server
cd auth
touch client-info

#In the file, put the following, matching up to your smtp server:
AuthInfo:your.isp.net "U:root" "I:user" "P:password"

#Generate the Authentication database, make both files readable only by root
makemap hash client-info < client-info
chmod 600 client-info
cd ..

#Add the following lines to sendmail.mc. Make sure you update your smtp server
#The first single quote for each string should be changed to a backtick (`) like this:
define(`SMART_HOST',`your.isp.net')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

#run 
sudo sendmailconfig
于 2014-01-08T17:41:25.363 に答える