Thank you for notice Bill. I'll try paste all again as text:

I noticed that in my postfix configuration there is a problem with
${original_recipient} which is not set or is overwritten by
${recipient}
My master.cf is below. The problem is that in the autoresponder -r
${original_recipient} is equal to ${recipient}.
Because of that, if user address belongs to a group (aliases) then if
sender sends message to this group then the autoresponder responds
from uses address. I want autoresponder only replay if the mail was
sent directly to the user (not throught alias).
I'd like to know the ${original_recipient} to check if the mail was
sent directly to user or to alias group.

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -       n       -       -       smtpd
#  -o smtp_send_xforward_command=yes
amavis    unix  -       -       n       -       4       smtp
  -o smtp_data_done_timeout=1200
  -o smtp_send_xforward_command=yes
  -o disable_dns_lookups=yes
  -o max_use=20
  -o 
receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_address_mappings
#  -o receive_override_options=no_address_mappings
#smtp      inet  n       -       n       -       1       postscreen
#smtpd     pass  -       -       n       -       -       smtpd
#dnsblog   unix  -       -       n       -       0       dnsblog
#tlsproxy  unix  -       -       n       -       0       tlsproxy
#submission inet  n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
#  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_tls_auth_only=yes
#  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
#  -o smtpd_sasl_security_options=noanonymous
#  -o smtpd_sasl_tls_security_options=noanonymous
##  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       n       -       -       smtpd
  #-o content_filter=autoresponder:dummy  #włączenie tego spowoduje
dublowanie wszystkich maili
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_tls_auth_only=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_sasl_security_options=noanonymous
  -o smtpd_sasl_tls_security_options=noanonymous
  -o milter_macro_daemon_name=ORIGINATING
  -o receive_override_options=no_address_mappings
#628       inet  n       -       n       -       -       qmqpd
pickup    fifo  n       -       n       60      1       pickup
  -o content_filter=
  -o receive_override_options=no_header_body_checks
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       300     1       tlsmgr
rewrite   unix  -       -       n       -       -       trivial-rewrite
bounce    unix  -       -       n       -       0       bounce
defer     unix  -       -       n       -       0       bounce
trace     unix  -       -       n       -       0       bounce
verify    unix  -       -       n       -       1       verify
flush     unix  n       -       n       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       n       -       -       smtp
# When relaying mail as backup MX, disable fallback_relay to avoid MX loops
relay     unix  -       -       n       -       -       smtp
  -o smtp_fallback_relay=
# -o smtp_helo_timeout=5
# -o smtp_connect_timeout=5
showq     unix  n       -       n       -       -       showq
error     unix  -       -       n       -       -       error
retry     unix  -       -       n       -       -       error
discard   unix  -       -       n       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       n       -       -       lmtp
anvil     unix  -       -       n       -       1       anvil
localhost:10025 inet   n       -       n       -       -       smtpd
  -o content_filter=autoresponder:dummy
  -o smtpd_delay_reject=no
  -o smtpd_client_restrictions=permit_mynetworks,reject
  -o smtpd_helo_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o smtpd_data_restrictions=reject_unauth_pipelining
  -o smtpd_end_of_data_restrictions=
  -o smtpd_restriction_classes=
  -o mynetworks=127.0.0.0/8
  -o smtpd_error_sleep_time=0
  -o smtpd_soft_error_limit=1001
  -o smtpd_hard_error_limit=1000
  -o smtpd_client_connection_count_limit=0
  -o smtpd_client_connection_rate_limit=0
  -o 
receive_override_options=no_unknown_recipient_checks,no_header_body_checks,no_address_mappings
  -o local_recipient_maps=
  -o relay_recipient_maps=
#  -o local_header_rewrite_clients=
scache    unix  -       -       n       -       1       scache
#
autoresponder unix -     n       n       -       -       pipe
  flags=OFq user=autoresponse argv=/usr/local/sbin/autoresponse -s
${sender} -r ${original_recipient} -o ${mailbox} -S ${sasl_username}
-C ${client_address}

Here is some logs:
Message was sent from a...@go2.pl (don't bother srs) to
t...@company.pl which is alias group containing recipi...@company.pl.
The mail was finally succesfuly delivered to recipient@ but the
autoresponder relay didn't know that the original_recipient was test@

#cat mail.info | grep 116691B9F4B
2014-09-25T09:18:30.072138+02:00 mailserver postfix/smtpd[9610]:
116691B9F4B: client=moh2-ve1.go2.pl[193.17.41.186]
2014-09-25T09:18:30.076264+02:00 mailserver postfix/cleanup[9563]:
116691B9F4B: message-id=<196ba997.66d4cc8a.5423c1c6.37...@go2.pl>
2014-09-25T09:18:30.078146+02:00 mailserver postfix/qmgr[9539]:
116691B9F4B: from=<SRS0=735Z=6S=go2.pl=a...@company.pl>, size=1294,
nrcpt=1 (queue active)
2014-09-25T09:18:30.733682+02:00 mailserver amavis[9191]: (09191-02)
Passed CLEAN {RelayedInbound}, [193.17.41.186]:57037 [193.17.41.186]
<SRS0=735Z=6S=go2.pl=a...@company.pl> -> <recipi...@company.pl>,
Queue-ID: 116691B9F4B, Message-ID:
<196ba997.66d4cc8a.5423c1c6.37...@go2.pl>, mail_id: Kz3XmBexBnUN,
Hits: 0.802, size: 1294, queued_as: AD0561BA015, 651 ms
2014-09-25T09:18:30.739229+02:00 mailserver postfix/smtp[9564]:
116691B9F4B: to=<recipi...@company.pl>, orig_to=<t...@company.pl>,
relay=127.0.0.1[127.0.0.1]:10024, delay=0.88, delays=0.22/0/0/0.66,
dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025):
250 2.0.0 Ok: queued as AD0561BA015)
2014-09-25T09:18:30.741398+02:00 mailserver postfix/qmgr[9539]:
116691B9F4B: removed

#cat mail.info | grep AD0561BA015
2014-09-25T09:18:30.709472+02:00 mailserver postfix/smtpd[9567]:
AD0561BA015: client=localhost[127.0.0.1]
2014-09-25T09:18:30.711714+02:00 mailserver postfix/cleanup[9563]:
AD0561BA015: message-id=<196ba997.66d4cc8a.5423c1c6.37...@go2.pl>
2014-09-25T09:18:30.714004+02:00 mailserver postfix/qmgr[9539]:
AD0561BA015: from=<SRS0=735Z=6S=go2.pl=a...@company.pl>, size=1781,
nrcpt=1 (queue active)
2014-09-25T09:18:30.718153+02:00 mailserver amavis[9191]: (09191-02)
FWD from <SRS0=735Z=6S=go2.pl=a...@company.pl> ->
<recipi...@company.pl>,BODY=7BIT 250 2.0.0 from
MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as AD0561BA015
2014-09-25T09:18:30.733682+02:00 mailserver amavis[9191]: (09191-02)
Passed CLEAN {RelayedInbound}, [193.17.41.186]:57037 [193.17.41.186]
<SRS0=735Z=6S=go2.pl=a...@company.pl> -> <recipi...@company.pl>,
Queue-ID: 116691B9F4B, Message-ID:
<196ba997.66d4cc8a.5423c1c6.37...@go2.pl>, mail_id: Kz3XmBexBnUN,
Hits: 0.802, size: 1294, queued_as: AD0561BA015, 651 ms
2014-09-25T09:18:30.739229+02:00 mailserver postfix/smtp[9564]:
116691B9F4B: to=<recipi...@company.pl>, orig_to=<t...@company.pl>,
relay=127.0.0.1[127.0.0.1]:10024, delay=0.88, delays=0.22/0/0/0.66,
dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025):
250 2.0.0 Ok: queued as AD0561BA015)
2014-09-25T09:18:30.877264+02:00 mailserver postfix/pipe[9568]:
AD0561BA015: to=<recipi...@company.pl>, relay=autoresponder,
delay=0.17, delays=0/0/0/0.16, dsn=2.0.0, status=sent (delivered via
autoresponder service)
2014-09-25T09:18:30.878215+02:00 mailserver postfix/qmgr[9539]:
AD0561BA015: removed


postconf -n:

alias_maps = hash:/etc/postfix/aliases
autoresponder_destination_recipient_limit = 1
biff = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
defer_transports =
delay_warning_time = 2h
disable_dns_lookups = no
disable_mime_output_conversion = no
disable_vrfy_command = yes
html_directory = /usr/share/doc/packages/postfix-doc/html
inet_interfaces = all
inet_protocols = all
local_recipient_maps =
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 21474836480
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
maximal_backoff_time = 8000s
message_size_limit = 31457280
message_strip_characters = \0
minimal_backoff_time = 1000s
mydestination = $myhostname, localhost.$mydomain
mydomain = company.company.pl
myhostname = fmmail.company.pl
mynetworks = 192.168.0.0/24, 127.0.0.0/8
mynetworks_style = host
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix-doc/README_FILES
recipient_canonical_classes = envelope_recipient
recipient_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf, tcp:127.0.0.1:10002
relay_clientcerts =
relay_domains = $mydestination, hash:/etc/postfix/relay
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix-doc/samples
sender_canonical_classes = envelope_sender
sender_canonical_maps = hash:/etc/postfix/pfix-no-srs.cf, tcp:127.0.0.1:10001
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_connect_timeout = 120s
smtp_enforce_tls = yes
smtp_helo_timeout = 120s
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = mysql:/etc/postfix/smtp_auth.cf
smtp_sasl_security_options =
smtp_tls_CAfile =
smtp_tls_CApath =
smtp_tls_cert_file =
smtp_tls_key_file =
smtp_tls_note_starttls_offer = yes
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_tls_security_level = may
smtp_tls_session_cache_timeout = 3600s
smtp_use_tls = yes
smtpd_banner = Company Mail Server
smtpd_client_restrictions = check_client_access
hash:/etc/postfix/access, reject_rbl_client bl.spamcop.net,
reject_rbl_client cbl.abuseat.org, reject_rbl_client
dul.dnsbl.sorbs.net, reject_rbl_client sbl-xbl.spamhaus.org
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_sasl_authenticated,
permit_mynetworks, reject_invalid_hostname, permit
smtpd_recipient_restrictions = permit_sasl_authenticated,
check_client_access hash:/etc/postfix/clients, check_sender_access
hash:/etc/postfix/senders, check_recipient_access
hash:/etc/postfix/recipients, reject_unauth_pipelining,
reject_non_fqdn_recipient, reject_unauth_destination,
reject_unknown_recipient_domain, reject_unverified_recipient,
permit_mynetworks, reject_non_fqdn_helo_hostname, reject_rbl_client
bl.spamcop.net, reject_rbl_client cbl.abuseat.org, reject_rbl_client
dul.dnsbl.sorbs.net, reject_rbl_client sbl-xbl.spamhaus.org, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = cyrus
smtpd_sender_restrictions = permit_sasl_authenticated,
permit_mynetworks, warn_if_reject reject_non_fqdn_sender,
reject_unknown_address, reject_sender_login_mismatch,
reject_unknown_sender_domain, reject_unauth_pipelining, permit
smtpd_tls_CAfile =
smtpd_tls_CApath =
smtpd_tls_ask_ccert = yes
smtpd_tls_cert_file = /etc/ssl/private/poczta.company.pl.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_security_level = may
smtpd_use_tls = yes
strict_8bitmime = no
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = mysql:/etc/postfix/mysql_alias.cf
virtual_gid_maps = static:303
virtual_mailbox_base = /var/spool/mail/virtual
virtual_mailbox_domains = mysql:/etc/postfix/mysql_domains.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = mysql:/etc/postfix/mysql_mailbox.cf
virtual_maildir_limit_message = Niestety użtkownik przekroczył limit
miejsca na dysku. Proszę spróbować później.
virtual_minimum_uid = 303
virtual_transport = virtual
virtual_uid_maps = static:303




--
View this message in context: 
http://postfix.1071664.n5.nabble.com/Postfix-original-recipient-tp71161p71293.html
Sent from the Postfix Users mailing list archive at Nabble.com.

Reply via email to