カスタム送信者:フィールドを使用して電子メールを送信する

カスタム送信者:フィールドを使用して電子メールを送信する

私はメールの設定は本当に好きではありませんが、何とかexim4を設定し、電子メールを送信します。数え切れないほど多くの時間を費やしました。 (要件は一般的に非常に似ていますが、なぜそれほど複雑なのかわかりません。実際には、電子メールを送信するために使用する必要がある電子メールアドレスが必要です。これはほとんどの場合、認証に関するセキュリティトピックを除いてほぼすべてです)。

電子メールを送信するときに、FROMフィールドを自動的に「root」(Linuxユーザー)に設定しました。カスタムフィールド(「連絡先」など)が必要ですが、これを行う方法に対する回答はインターネットにありません。

第二に、電子メールアドレスに関連付けられたLinuxユーザーを使用することは悪いと言う人もいます。たとえば、次のようになります。 http://t-machine.org/index.php/2014/06/27/webmail-on-your-debian-server-exim4-dovecot-roundcube/ しかし、それを使うチュートリアルを見つけました。上記のURLのデータベースを使用していませんが、まだ電子メールに関連付けられているLinuxユーザーを望んでいません。達成するのは難しいですか?どうすればいいですか?

これは/etc/exim4/update-exim4.conf.confの内容です:

# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='internet'
dc_other_hostnames='url.com; mail.url.com; url; localhost;  localhost.localdomain'
dc_local_interfaces='127.0.0.1; my_ip'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

とにかく私のドメイン名をurlに、ipをmy_ipに変更しました。

/etc/email-addressesは非常に短いです。

root: [email protected]

ベストアンサー1

使用したい名前を話す必要があります(現在はmailで探している可能性が最も高い)。/etc/passwdもちろん、ユーザーのフルネームを変更することもできます/etc/passwd(たとえば経由で)、rootにメールを送信しないでください。chfn -f 'New Name' user

fromHeirloomメールの場合は、環境変数、対応するmailrc設定ファイル、またはオプションを使用できます-r。次のいずれかのようになります。

echo 'This is a test.' | mail -r 'Contact Me <root>' \ 
                              -s 'Testing' '[email protected]'   # using -r argument

# ... or ...

echo 'This is a test.' | from='Contact Me <root>' mail \
                              -s 'Testing' '[email protected]'   # env var 'email'

他のバージョンの場合は、mailそのマンページを確認してください。

おすすめ記事