配置 Sympa:命令输出使用错误

配置 Sympa:命令输出使用错误

我在配置 Sympa 时遇到问题。

我已经创建了一个新列表[email protected],但是当我尝试向该列表发送邮件时,我的邮件日志中出现错误:

postfix/pipe[13544]: C699261227: [email protected], relay=sympa, delay=0.33, delays=0.31/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: /home/sympa/bin/queue: usage error, one one list-name argument expected. ).

谁能告诉我 Sympa 需要什么命令参数?

我已经配置了/etc/postfix/main.cf/etc/postfix/master.cf订阅此邮件列表的每位成员都会收到邮件。

/home/sympa/etc/sympa_aliases有关于新列表的记录:

new_test_list: "| /home/sympa/bin/queue [email protected]"
new_test_list-request: "| /home/sympa/bin/queue [email protected]"
new_test_list-editor: "| /home/sympa/bin/queue [email protected]"
new_test_list-unsubscribe: "| /home/sympa/bin/queue [email protected]"
new_test_list-owner: "| /home/sympa/bin/bouncequeue [email protected]"

后配置-n

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases,hash:/home/sympa/etc/sympa_aliases
allow_percent_hack = no
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
home_mailbox = Maildir/
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
mailbox_size_limit = 0
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
myhostname = ns1.example.com
newaliases_path = /usr/bin/newaliases.postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = $mydestination, lists.examle.com
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sender_bcc_maps = hash:/etc/postfix/bcc
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_bind_address = 10.0.1.10
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_recipient_restrictions =  permit_mynetworks permit_sasl_authenticated 
                                reject_unauth_destination 
                                check_policy_service unix:/var/spool/postfix/postgrey/socket
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
transport_maps = regexp:/home/sympa/etc/transport_regexp
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual

grep C699261227 /var/log/maillog

Mar 18 20:05:52 ns1 postfix/pickup[13491]: C699261227: uid=553 [email protected]
Mar 18 20:05:52 ns1 postfix/cleanup[13515]: C699261227: [email protected]
Mar 18 20:05:52 ns1 postfix/qmgr[9232]: C699261227: [email protected], size=438, nrcpt=1 (queue active)
Mar 18 20:05:52 ns1 postfix/pipe[13544]: C699261227: [email protected], relay=sympa, delay=0.33, delays=0.31/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: /home/sympa/bin/queue: usage error, one one list-name argument expected. )
Mar 18 20:05:52 ns1 postfix/bounce[13546]: C699261227: sender non-delivery notification: CCF93615E7
Mar 18 20:05:52 ns1 postfix/qmgr[9232]: C699261227: removed

cat /home/sympa/etc/transport_regexp

/^.*-owner\@lists\\.example\\.com$/ sympabounce:

/^.*\@lists\\.example\\.com$/       sympa:

/etc/postfix/master.cf

### Added for sympa
sympa   unix    -       n       n       -       -       pipe
  flags=R user=sympa argv=/home/sympa/bin/queue ${recipient}

sympabounce     unix    -       n       n       -       -       pipe
    flags=R user=sympa argv=/home/sympa/bin/bouncequeue ${recipient}

答案1

我尝试重现您的情况,但没有成功。

根据您的邮件日志行

Mar 18 20:05:52 ns1 postfix/pipe[13544]: C699261227: [email protected], relay=sympa, delay=0.33, delays=0.31/0.01/0/0.01, dsn=5.3.0, status=bounced (command line usage error. Command output: /home/sympa/bin/queue: usage error, one one list-name argument expected. )

Postfix 通过管道将电子邮件发送给/home/sympa/bin/queuebecause oftransport_maps参数/home/sympa/etc/sympa_aliases

要进一步调试,您可以执行此步骤

  1. 创建/tmp/printargs.sh包含内容的文件

    #!/bin/sh
    echo "args: $@"
    exit 2
    

    它将回应所有论点。

  2. 设置适当的权限

    chown sympa /tmp/printargs.sh
    chmod u+x /tmp/printargs.sh
    
  3. 更改master.cf条目

    sympa   unix    -       n       n       -       -       pipe
        flags=R user=sympa argv=/tmp/printargs.sh ${recipient}
    
  4. 重新启动 postfix 并查看邮件日志条目。在我的例子中,它将输出

    Mar 23 03:23:38 sy postfix/pipe[1702]: 914A04042B: to=<[email protected]>, relay=sympa, delay=0.06, delays=0.03/0.01/0/0.02, dsn=5.3.0, status=bounced (Command died with status 2: "/tmp/printargs.sh". Command output: args: [email protected] )
    

相关内容