Wednesday, January 12, 2011

I have configured a postfix mailserver on Linux with dovecot. Now problem is when I configure autoreply it reply two mail to sender

I have configured a postfix mailserver on Linux with dovecot. Now the problem is when I configure autoreply it replies with two mails to the sender. I have used vacation.pl, a Perl script of postfix admin to autoreply a mail to sender. I have configured it before and tested at that time that there was no problem. But after change of database structure I have changed the postfix configuration, dovecot configuration and vacation.pl script. As I think there is not a problem in the database query.

I get the same problem when I send bcc to some user. The user will get two mails. I didn't find the problem in which is it in dovecot,autoreply.

My master.cf file is as shown below.

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
smtp      inet  n       -        -       -       -       smtpd 
#    -o content_filter=spamfilter:dummy
     -o content_filter=vacation:dummy
     -o content_filter=dfilt:dummy
vacation  unix  -   n    n   -   -   pipe
    flags=Rq user=vacation argv=/var/spool/vacation/vacation3.pl -f ${sender} -- ${recipient}
# flags=Rq user=vacation argv=/usr/bin/perl argv=/var/spool/vacation/vacation.pl -f ${sender} -- ${recipient}
pickup    fifo  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      fifo  n       -       n       300     1       qmgr
#qmgr     fifo  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   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
scache    unix  -       -       n       -       1       scache
#
#spamassassin unix -      n       n       -       -       pipe
#    flags=Rq user=spamd argv=/usr/bin/spamc -u ${user} -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}
dovecot    unix  -       n       n       -       -       pipe
    flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/deliver -d ${recipient}
#spamfilter unix     -   n   n   -   -   pipe
#   flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}
#spamfilter unix -   n   n   -   -   pipe
#    flags=Rq user=vmail argv=/usr/bin/spamc -u ${user}@${domain} -e /usr/sbin/sendmail.postfix -oi -f ${sender} ${recipient}
dfilt     unix    -       n       n       -       -       pipe
    flags=Rq user=filterAlt argv=/etc/postfix/disclaimer -f ${sender} -- ${recipient}
#vacation  unix  -       n        n       -       -       pipe
#    flags=Rq user=vacation argv=/var/spool/vacation/vacation3.pl -f ${sender} -- ${recipient}
  • You can do the vacation reply through sieve plugins. They will also add powerful server-side mail filtering capabilities.

    A sieve file example for vacation responder:

    require ["fileinto", "vacation"];
    
    vacation
      # Reply at most once a day to a same sender
      :days 1
      :subject "Out of office reply"
      # List of additional recipient addresses which are included in the auto replying.
      # If a mail's recipient is not the envelope recipient and it's not on this list,
      # no vacation reply is sent for it.
      :addresses ["j.doe@company.dom", "john.doe@company.dom"]
    "I'm out of office, please contact Joan Doe instead.
    Best regards
    John Doe";
    

    See Dovecot sieve page for more information.

    From hayalci
  • I've experiences an issue with content filters as well. Adding this line after the content filters fixed multiple messages from being sent..

    -o receive_override_options=no_address_mappings
    

    add that line after all of your filters in your smtp declaration so that it looks like this..

    smtp      inet  n       -        -       -       -       smtpd 
    #    -o content_filter=spamfilter:dummy
         -o content_filter=vacation:dummy
         -o content_filter=dfilt:dummy
         -o receive_override_options=no_address_mappings
    

    Admittedly however, I have only tested it with my spamassassin filter. Let me know if it works.

    From goose

0 comments:

Post a Comment