[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[postfix-jp: 3994] 送信リレー先の動的変更方法について



お世話になっております。
松浦と申します。

送信メールリレー先を動的におこないたいがやり方がわからず
色々と試行錯誤してきましたが解決できず投稿させて頂きました。
やり方等間違っている点あるかもしれませんがご存知の方が入ればご教授頂けないでしょうか。
詳細は次の通りとなります。

◆概要
クライアントからSMTP-AUTHを利用してPostfixに接続
その後にユーザー毎にGmailへメールをリレーしたいが
smtp_sasl_password_mapsで受け取れる引数としてリレー先しか取得できていない
ユーザー毎にリレー先を変更するようなことが可能かお聞きしたい。

◆構成
構成  :Postfix+ MySQL
Amazon Linux AMI :Amazon Linux AMI release 2011.09
Postfix:2.6.6 yumで取得
MySQL :5.1.52

◆postconf -nの結果
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relayhost = [smtp.gmail.com]:587
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_sasl_auth_enable = yes
smtp_sasl_mechanism_filter = plain
smtp_sasl_password_maps = mysql:/etc/postfix/smtp_mysql_auth.cf
smtp_sasl_tls_security_options = noanonymous
smtp_tls_CApath = /etc/pki/tls/certs/ca-bundle.crt
smtp_use_tls = yes
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination, reject
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $mydomain

◆smtp_mysql_auth.cfの中身
user=root
password=password
dbname=database
hosts=localhost
query = select concat(user,'@',domain, ':', password) from users where
 user = '%u'
#query = select concat(user, '@', domain, ':', password) from users
where user = 'matsuura'

※ここでクライアントから入力されたユーザー名を受け取りたい
 固定値にした場合にはリレーされることを確認

◆smtpd.confの中身
pwcheck_method: auxprop
auxprop_plugin: sql
mech_list: PLAIN LOGIN
sql_engine: mysql
sql_hostnames: localhost
sql_user: root
sql_passwd: password
sql_database: database
sql_select: SELECT smtp_password a FROM users WHERE user = '%u'

_______________________________________________
Postfix-jp-list mailing list
Postfix-jp-list@xxxxxxxxxxxxxxxxxxxx
http://lists.sourceforge.jp/mailman/listinfo/postfix-jp-list


[検索ページ] [Postfix-JP ML Home]