VPSによるメールサーバーの構築(バーチャルホスト)
CentOs7 Postfix Dovecot でバーチャルホスト運用したいと考えています。
aaa.com
bbb.com
というの別のドメインでメールサーバーを作りたいと考えています。
もともとaaa.comというドメインで構築したものに、bbb.comを追加しました。
症状
送受信ともに出来るようにはなったのですが
Fromのドメインが付与されない状態でメールが送信されます。
ヘッダーを見ると、From: <admin>とだけ表示されています。
設定
vmailというグループとユーザー作成(uid,gidは11111)
/var/spool/virtualというディレクトリ作成(所有権、vmail:vmail)
/etc/postfix/main.cfを編集&追加
myhostname = mail.aaa.com mydomain = aaa.com myorigin = $mydomain inet_interfaces = all mydestination = home_mailbox = Maildir/ virtual_mailbox_domains = /etc/postfix/vdomain virtual_mailbox_domains = /etc/postfix/vdomain virtual_mailbox_maps = hash:/etc/postfix/vmailbox virtual_uid_maps = static:11111 virtual_gid_maps = static:11111
/etc/postfix/vdomainに以下を追加
aaa.com bbb.com $postmap vmailbox (DBファイル作成)
/etc/postfix/vmailboxに以下を追加
admin@aaa.com aaa.com/admin/Maildir/ admin@bbb.com bbb.com/admin/Maildir/
/etc/dovecot/conf.d/10-auth.confを以下に編集
disable_plaintext_auth = no !include auth-passwdfile.conf.ext !include auth-static.conf.ext
/etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
/etc/dovecot/conf.d/auth-passwdfile.conf.extを編集
passdb { driver = passwd-file args = scheme=CRAM-MD5 username_format=%u /etc/dovecot/users }
/etc/dovecot/conf.d/auth-static.conf.extを編集
userdb { driver = static args = uid=vmail gid=vmail home=/var/spool/virtual/%d/%n }
/etc/dovecot/usersにユーザー情報追加
admin@aaa.com:{CRAM-MD5}xxxxxxxxxxx ← doveadm pwで生成したパスワード admin@bbb.com:{CRAM-MD5}xxxxxxxxxxx ← doveadm pwで生成したパスワード
バージョン
CentOS Linux release 7.7.1908 (Core)
Postfix 2.10.1
Dovecot 2.2.36
###追加
メールソフト(Thunderbird)から、メールを送信しました。
maillogは以下です。
Nov 4 11:28:11 133-130-126-209 postfix/smtpd[28864]: connect from p349118-ipngn200302sasajima.aichi.ocn.ne.jp[122.19.212.118] Nov 4 11:28:11 133-130-126-209 postfix/smtpd[28864]: Anonymous TLS connection established from p349118-ipngn200302sasajima.aichi.ocn.ne.jp[122.19.212.118]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits) Nov 4 11:28:11 133-130-126-209 postfix/smtpd[28864]: B46D11203D8: client=p349118-ipngn200302sasajima.aichi.ocn.ne.jp[122.19.212.118], sasl_method=CRAM-MD5, sasl_username=admin@aaa.com Nov 4 11:28:11 133-130-126-209 postfix/cleanup[28866]: B46D11203D8: message-id=<> Nov 4 11:28:11 133-130-126-209 postfix/qmgr[28820]: B46D11203D8: from=<admin@aaa.com>, size=733, nrcpt=1 (queue active) Nov 4 11:28:11 133-130-126-209 postfix/smtpd[28864]: disconnect from p349118-ipngn200302sasajima.aichi.ocn.ne.jp[122.19.212.118] Nov 4 11:28:13 133-130-126-209 postfix/smtp[28867]: B46D11203D8: host gmail-smtp-in.l.google.com[2404:6800:4008:c07::1b] said: 421-4.7.0 [xxxx:xxxx:xxxx:xxx:xxx:xxx:xxx:xxx 15] Our system has detected 421-4.7.0 that this message is suspicious due to the very low reputation of the 421-4.7.0 sending IP address. To protect our users from spam, mail sent from 421-4.7.0 your IP address has been temporarily rate limited. Please visit 421 4.7.0 https://support.google.com/mail/answer/188131 for more information. y16si12300826pfm.241 - gsmtp (in reply to end of DATA command) Nov 4 11:28:14 133-130-126-209 postfix/smtp[28867]: B46D11203D8: to=<xxxxxxxx@gmail.com>, relay=gmail-smtp-in.l.google.com[74.125.204.26]:25, delay=3.2, delays=0.09/0.01/2.4/0.74, dsn=2.0.0, status=sent (250 2.0.0 OK 1572834494 b24si2859552pge.61 - gsmtp) Nov 4 11:28:14 133-130-126-209 postfix/qmgr[28820]: B46D11203D8: removed
あなたの回答
tips
プレビュー