V2.2.5 E-mail autoresponder function

Discussion in 'General' started by Hans, Jul 19, 2006.

  1. Hans

    Hans Moderator Moderator

    I guess the autoresponder function (with Maildir) is not functioning as it should..

    I have replaced /root/ispconfig/isp/conf/autoresponder.rc.master with this:

    SHELL=/bin/sh # for other shells, this might need adjustment
    EMAIL=`formail -zxTo:`

    :0 Whc: vacation.lock
    # Perform a quick check to see if the mail was addressed to us
    #* $^To:.*\<$\LOGNAME\>
    # Don't reply to daemons and mailinglists
    * !^FROM_DAEMON
    # Mail loops are evil
    * !^X-Loop: ${EMAIL}
    | formail -rD 8192 {PFAD}/.vacation.cache

    :0 ehc # if the name was not in the cache
    | (formail -rI"From: {EMAIL_ADDRESS}" -I"Precedence: junk" \
    -A"X-Loop: ${EMAIL}" ; \
    cat {PFAD}/.vacation.msg \
    ) | $SENDMAIL -oi -t


    What can i do else to get it working?

    A step further now:
    The problem was in /etc/hosts where I had to add the hostname to the line which referred to 127.0.0.1 localhost.

    Now I have noticed that when i send an e-mail from a domain on my server to the e-mailaddress (whith autoreply enabled) that the auto-reply functioning is working OK!

    When i do the same from another domain (not on my server) the auto responder function failes.
    Has this something to do with my Postfix main.cf file?

    This message will be send back to the sender:

    ---
    This is the Postfix program at host servernr.mydomain.tld.

    I'm sorry to have to inform you that your message could not be
    be delivered to one or more recipients. It's attached below.

    For further assistance, please send mail to <postmaster>

    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.

    The Postfix program

    Domain name required for sender address
    username (in reply to MAIL FROM command)


    or

    No thank you rejected: need fully-qualified address (in reply to RCPT TO
    command)




    ---

    Can anyone help me further now?

    Would be nice in this holiday season! :)
     
    Last edited: Jul 20, 2006
  2. falko

    falko Super Moderator Howtoforge Staff

    This means you didn't use a full email address for the sender, only the local part (the part left from the @ sign). That has nothing to do with the autoresponder.
     
  3. Hans

    Hans Moderator Moderator

    Falko,

    If that has nothing to do with the Autoresponder within ISPConfig i guess i am in the wrong forum.. Anyway i hope you can help me.
    I also think that it is the same problem as descibed here:
    http://www.howtoforge.com/forums/showthread.php?t=5447&highlight=autoresponder

    I understand, but WHY my system uses only the username WITHOUT @domain.tld during sending out the e-mail? Why picking up only the username and not [email protected]?

    I do not know where how to solve this. Something in Postfix master.cf file to be changed?

    Other question:

    I have noticed that the output of hostname is: servernr.domain.tld
    And the output of hostname -f is: localhost.localdomain

    Is this ok or ...should the output of hostname -f also be servernr.domain.tld
    Has it something to do with the problem?
     
    Last edited: Jul 20, 2006
  4. todvard

    todvard New Member

    the hostname -f should be your fully qualified domain name (eg. hostname.domainname.tld), so the localhost.localdomain isn't a good result.
    what is the contents of the:
    /etc/hosts
    /etc/mailname
    /etc/hostname
    /etc/postfix/main.cf (especially myhostname and myorigin directives)
     
  5. Hans

    Hans Moderator Moderator

    the contents of the requested files

    Hi Todvard,

    First, thank you for your reply!
    Here is the contents of the requested files:

    I am still wondering why the output on On this Debian Unofficial Sarge 64 system of hostname - f is: localhost.localdomain ...

    On my Official Debian Sarge 32 system the output of hostname -f is the same as the output of hostname, which is servername.domain.tld.

    The autoreply function works ok for domains on my server but not for others, which are not.


    Contents of /etc/hosts:

    127.0.0.1 localhost.localdomain localhost servername servername.mydomain.tld
    12.34.56.789 servername.mydomain.tld servername

    # The following lines are desirable for IPv6 capable hosts

    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts

    Contents of /etc/mailname:

    servername.mydomain.tld


    Contents of /etc/hostname:

    servername.mydomain.tld

    Contents of /etc/postfix/main.cf:

    # See /usr/share/postfix/main.cf.dist for a commented, more complete version
    smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
    biff = no
    # appending .domain is the MUA's job.
    append_dot_mydomain = no
    # Uncomment the next line to generate "delayed mail" warnings
    #delay_warning_time = 4h
    myhostname = servername.mydomain.tld
    smtp_bind_address = 12.34.56.789
    alias_maps = hash:/etc/aliases
    alias_database = hash:/etc/aliases
    myorigin = /etc/mailname
    #mydestination = servername.mydomain.tld, localhost.mydomain.tld, localhost
    mydestination = /etc/postfix/local-host-names
    relay_domains = $mydestination
    virtual_maps = hash:/etc/postfix/virtusertable
    relayhost =
    mynetworks = 127.0.0.0/8
    mailbox_command =
    mailbox_size_limit = 0
    recipient_delimiter = +
    inet_interfaces = all
    smtpd_sasl_local_domain =
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
    smtpd_tls_auth_only = no
    smtp_use_tls = yes
    smtpd_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
    smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
    smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
    smtpd_tls_loglevel = 1
    smtpd_tls_received_header = yes
    smtpd_tls_session_cache_timeout = 3600s
    tls_random_source = dev:/dev/urandom
    home_mailbox = Maildir/
    append_at_myorigin = no
     
    Last edited: Jul 20, 2006
  6. todvard

    todvard New Member

    here is the problem, you should delete "servername servername.mydomain.tld" from the first line and it will be ok.
     
  7. Hans

    Hans Moderator Moderator

    Tovard,

    Thanks for your help.
    I am a litlle further now ( i think).

    What happens is this:

    - when i send an email from a domain from my server, it works as it should.

    - When i do that from the outside world, the message is delivered in the mailbox with the auto reply enabled but ...the autoreply message seems not to be send.., (disapeared). At least no mail bounced back with an Postfix error, so that's good.

    I really do not know what else can be wrong...
     
  8. todvard

    todvard New Member

    Are you using Maildir? Have you tried already Falko's new autoreply script for Maildirs?
     
  9. Hans

    Hans Moderator Moderator

    Yes Torvard, i did use the new script and i do use the Maildir format.

    I have noticed that when i switch on the auto reply function for the mailbox in ispconfig that i have to wait a few minutes..
    Sometimes i have the error message from postfix again, same situation as before your suggested change in /etc/hosts.

    Sometimes i do not have the error but the autoreply message disapears.

    I am gonna sleep one night ... maybe i find the solution tomorrow.
    (In the mean time, hostname -f gives the output: servernr.mydomain.tld as it should give :)
    Step by step ..

    Anyway thanks a lot.
     
    Last edited: Jul 21, 2006
  10. falko

    falko Super Moderator Howtoforge Staff

    Run
    Code:
    postconf -e 'append_dot_mydomain = yes'
    and restart Postfix.

    Please check the Maildir directory if there's still a .vacation.cache (a left-over from before you changed autoresponder.rc.master).
     
  11. Hans

    Hans Moderator Moderator

    I did an postconf -e 'append_dot_mydomain = yes' and restarted postfix.

    In the Maildir of the user with the autoresponder there is nothing left in cache..

    I guess, i only can give up now.
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Does it solve the problem with the sender address?
     
  13. Hans

    Hans Moderator Moderator

    There is no change.

    If i send an email from a domain which is not on my server, the email arrives in the mailbox with the autoreply enabled. But there is no autoreply.
    (It behaves like the autoreply for the mailbox is not set).

    If i send an email from a domain which is on my server everything is working fine: the email arrives in the mailbox with the autoreply enabled and the autoreply is send.
     
  14. falko

    falko Super Moderator Howtoforge Staff

    Hm, I'll check that...
     

Share This Page