Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Réseau Discussion :

Postfix - script backup/Out of office


Sujet :

Réseau

  1. #1
    Membre habitué
    Postfix - script backup/Out of office
    Bonjour à tous

    Je reviens vers vous pour un autre souci lié à mon dernier post :
    http://www.developpez.net/forums/d12...ostfix-backup/

    En rajoutant la fameuse ligne :
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    receive_override_options=no_address_mappings
    dans mon master.cf (modifié depuis la dernière fois) :
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    # Postfix master process configuration file.  For details on the format
    # of the file, see the master(5) manual page (command: "man 5 master").
    #
    # Do not forget to execute "postfix reload" after editing this file.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    #smtp      inet  n       -       -       -       -       smtpd
    #     -o content_filter=smtp-amavis:[127.0.0.1]:10024
    #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 syslog_name=postfix/submission
    #  -o smtpd_tls_security_level=encrypt
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #smtps     inet  n       -       n       -       -       smtpd
    #  -o syslog_name=postfix/smtps
    #  -o smtpd_tls_wrappermode=yes
    #  -o smtpd_sasl_auth_enable=yes
    #  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
    #  -o milter_macro_daemon_name=ORIGINATING
    #628       inet  n       -       n       -       -       qmqpd
    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
    relay     unix  -       -       n       -       -       smtp
    #       -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
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    #maildrop  unix  -       n       n       -       -       pipe
    #  flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    #
    # ====================================================================
    #
    # Recent Cyrus versions can use the existing "lmtp" master.cf entry.
    #
    # Specify in cyrus.conf:
    #   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
    #
    # Specify in main.cf one or more of the following:
    #  mailbox_transport = lmtp:inet:localhost
    #  virtual_transport = lmtp:inet:localhost
    #
    # ====================================================================
    #
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    #
    #cyrus     unix  -       n       n       -       -       pipe
    #  user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # ====================================================================
    #
    # Old example of delivery via Cyrus.
    #
    #old-cyrus unix  -       n       n       -       -       pipe
    #  flags=R user=cyrus argv=/usr/lib/cyrus-imapd/deliver -e -m ${extension} ${user}
    #
    # ====================================================================
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    #uucp      unix  -       n       n       -       -       pipe
    #  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # ====================================================================
    #
    # Other external delivery methods.
    #
    #ifmail    unix  -       n       n       -       -       pipe
    #  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    #
    #bsmtp     unix  -       n       n       -       -       pipe
    #  flags=Fq. user=bsmtp argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    #
    #scalemail-backend unix -       n       n       -       2       pipe
    #  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store
    #  ${nexthop} ${user} ${extension}
    #
    #mailman   unix  -       n       n       -       -       pipe
    #  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
    #  ${nexthop} ${user}
    ##########
    # AMAVIS #
    ##########
    smtp-amavis unix    -       -       n       -       2     smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes
        -o disable_dns_lookups=yes
        -o max_use=20
     
    62.72.116.8:25 inet n    -       n       -       -     smtpd
        -o content_filter=smtp-amavis:[127.0.0.1]:10024
     
    192.9.200.250:25   inet n    -       n       -       -     smtpd
     -o smtpd_sender_restrictions=$sendernwave
     -o smtpd_client_restrictions=$sendernwave
     
    127.0.0.1:10025 inet n  -       -       -       -      smtpd
        -o content_filter=
        -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_address_mappings
         -o local_header_rewrite_clients=
     
    smtp-amavis unix -      -       -       -        4     smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes
        -o disable_dns_lookups=yes
     
     
    dovecot   unix  -       n       n       -       -       pipe
      flags=DRhu user=mailv:mailv argv=/usr/libexec/dovecot/deliver -f ${sender} -d ${recipient}
     
    ##########
    # BACKUP #
    ##########
    backup3 unix  -       n       n       -       -      pipe -v
      flags=DRhu. user=backup:backup argv=/usr/sbin/backup3.py $sender $user@$nexthop}


    voila le main.cf aussi :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    data_directory = /var/lib/postfix
    mail_owner = postfix
    myhostname = mail3
    mydomain = domain.com
    myorigin = $mydomain
    inet_interfaces = all
    inet_protocols = all
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, localhost.localdomain, mail3.domain.com, mail3
    unknown_local_recipient_reject_code = 550
    mynetworks =  192.9.200.0/24,192.9.201.0/24,192.9.203.0/24,127.0.0.1,localhost, localhost.localdomain,62.72.116.8
    relay_domains = $mydestination
    alias_maps = hash:/etc/aliases,ldap:/etc/postfix/ldap-groupes.cf,ldap:/etc/postfix/ldap-aliases.cf,ldap:/etc/postfix/ldap-aliases2.cf,ldap:/etc/postfix/ldap-aliases3.cf,ldap:/etc/postfix/ldap-aliases4.cf
    alias_database = hash:/etc/aliases
    home_mailbox = Maildir/
    debug_peer_level = 5
    debugger_command =
             PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
             ddd $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    sample_directory = /usr/share/doc/postfix-2.9.4/samples
    readme_directory = /usr/share/doc/postfix-2.9.4/README_FILES
    inet_protocols = ipv4
     
    ##############
    # config TLS #
    ##############
     
    smtpd_tls_security_level = may
    smtp_use_tls = yes
    smtp_tls_note_starttls_offer = yes
    smtpd_tls_auth_only = no
    smtpd_use_tls = 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
    smtpd_recipient_limit = 100
     
    #######################################
    # RESTRICTION DE RECEPTION ET D'ENVOI #
    #######################################
     
    #smtpd_helo_restrictions = reject_invalid_hostname
    smtpd_sender_restrictions = permit_sasl_authenticated,reject_unknown_sender_domain,permit_mynetworks
    smtpd_recipient_restrictions  = check_sender_access hash:/etc/postfix/domaines_ok,reject_unauth_destination,reject_rbl_client zen.spamhaus.org,permit
    sendernwave = check_sender_access hash:/etc/postfix/domaines_ok,permit_mynetworks,reject
    #smtpd_recipient_restrictions =  reject_unauth_destination,reject_rbl_client zen.spamhaus.org,permit
     
    smtpd_sasl_local_domain = $myhostname
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_security_options = noanonymous
    broken_sasl_auth_clients = yes
    ###########
    # DOVECOT #
    ###########
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    dovecot_destination_recipient_limit = 1
    virtual_transport = dovecot
    ####################################
    #CONFIG LDA : Local Delivery Agent #
    ####################################
     
    mailbox_command = /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT"
    virtual_mailbox_domains = virtdomain.com virt2domain.com
    virtual_mailbox_base = /home/mail/
    virtual_mailbox_maps = hash:/etc/postfix/virtual
    virtual_alias_maps = hash:/etc/postfix/virtual_alias
     
    # definition du user par defaut
    virtual_uid_maps = static:600
    virtual_gid_maps = static:600
    virtual_mailbox_limit = 0
    ##########
    # AMAVIS #
    ##########
     
    content_filter = smtp-amavis:[127.0.0.1]:10024
    ##########
    # BACKUP #
    ##########
    always_bcc = backup@backup3.domain.com
    mailbox_size_limit = 0
    recipient_delimiter = +
    message_size_limit = 1024000000
    smtpd_recipient_limit = 80
    transport_maps = hash:/etc/postfix/transport
    backup3_destination_recipient_limit = 1

    je n'ai donc plus le dédoublement de mail en backup, mais je n'ai également plus le out-of-office.

    Le script que j’appelle vérifie si l'(les)adresse(s) mail(s) du receveur est en état "vacance" si oui, il vérifie également que ce n'est pas déjà une réponse de lui meme "Out of Office AutoReply" (pour éviter les boucles).

    Ensuite il envoit (ou pas) le mail Out of Office AutoReply.

    En retirant la fameuse option no-mapping voila une sortie pour un personne en congé :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    postfix/smtpd[31146]: connect from unknown[127.0.0.1]
    postfix/smtpd[31146]: EE9871FC75: client=unknown[127.0.0.1]
    postfix/cleanup[31093]: EE9871FC75: message-id=<20121115110335.CB4AE1FCCD@mail3>
    postfix/smtpd[31146]: disconnect from unknown[127.0.0.1]
    postfix/qmgr[28982]: EE9871FC75: from=<mathv@domain.com>, size=982, nrcpt=2 (queue active)
    postfix/smtpd[31146]: connect from unknown[127.0.0.1]
    postfix/smtpd[31146]: EFDB61FCCF: client=unknown[127.0.0.1]
    postfix/cleanup[31093]: EFDB61FCCF: message-id=<20121115110335.CB4AE1FCCD@mail3>
    postfix/qmgr[28982]: EFDB61FCCF: from=<mathv@domain.com>, size=810, nrcpt=2 (queue active)
    postfix/smtpd[31146]: disconnect from unknown[127.0.0.1]
    amavis[26815]: (26815-11) Passed CLEAN, <mathv@odmain.com> -> <backup@backup3.domain.com>,<test@virtdomain.com>, Message-ID: <20121115110335.CB4AE1FCCD@mail3>, mail_id: T-ggjPTl6A-O, Hits: 0, size: 422, queued_as: EE9871FC75/EFDB61FCCF, 5157 ms
    postfix/smtp[31094]: CB4AE1FCCD: to=<backup@backup3.domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0/0/0/5.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as EE9871FC75)
    postfix/smtp[31094]: CB4AE1FCCD: to=<test@virtdomain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0/0/0/5.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as EE9871FC75)
    postfix/qmgr[28982]: CB4AE1FCCD: removed
    dovecot: lda(test@nwave.com): msgid=<20121115110335.CB4AE1FCCD@mail3>: saved mail to INBOX
    postfix/pipe[31100]: EFDB61FCCF: to=<test@virtdomain.com>, relay=dovecot, delay=0.03, delays=0/0/0/0.03, dsn=2.0.0, status=sent (delivered via dovecot service)
    postfix/pipe[31101]: EE9871FC75: to=<backup@backup3.domain.com>, relay=backup3, delay=0.1, delays=0/0/0/0.1, dsn=2.0.0, status=sent (delivered via backup3 service)
    postfix/pipe[31099]: EE9871FC75: to=<backup@backup3.domain.com>, relay=backup3, delay=0.11, delays=0/0/0/0.11, dsn=2.0.0, status=sent (delivered via backup3 service)
    postfix/qmgr[28982]: EE9871FC75: removed
    postfix/smtpd[31160]: connect from mail3.domain.com[192.x.x.x]
    postfix/smtpd[31160]: 1A2D21FC75: client=mail3.domain.com[192.x.x.x]
    postfix/cleanup[31093]: 1A2D21FC75: message-id=<20121115110341.1A2D21FC75@mail3>
    postfix/qmgr[28982]: 1A2D21FC75: from=<test@virtdomain.com>, size=530, nrcpt=2 (queue active)
    postfix/smtpd[31160]: disconnect from mail3.domain.com[192.9.200.250]
    postfix/pipe[31104]: EFDB61FCCF: to=<backup@backup3.domain.com>, relay=backup3, delay=0.13, delays=0/0/0/0.13, dsn=2.0.0, status=sent (delivered via backup3 service)
    postfix/qmgr[28982]: EFDB61FCCF: removed
    postfix/smtpd[30805]: 416F01FCCD: client=unknown[127.0.0.1]
    postfix/cleanup[31093]: 416F01FCCD: message-id=<20121115110341.1A2D21FC75@mail3>
    postfix/smtpd[30805]: disconnect from unknown[127.0.0.1]
    postfix/qmgr[28982]: 416F01FCCD: from=<test@virtdomain.com>, size=1038, nrcpt=3 (queue active)
    amavis[27376]: (27376-10) Passed CLEAN, [192.9.200.250] [192.9.200.250] <test@virtdomain.com> -> <backup@backup3.domain.com>,<mathv@domain.com>, Message-ID: <20121115110341.1A2D21FC75@mail3>, mail_id: z+3rQ+VA284a, Hits: 0.972, size: 530, queued_as: 416F01FCCD, 5166 ms
    postfix/smtp[31094]: 1A2D21FC75: to=<backup@backup3.domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0.01/0/0/5.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 416F01FCCD)
    postfix/smtp[31094]: 1A2D21FC75: to=<mathv@domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=5.2, delays=0.01/0/0/5.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA([127.0.0.1]:10025): 250 2.0.0 Ok: queued as 416F01FCCD)
    postfix/qmgr[28982]: 1A2D21FC75: removed
    dovecot: lda(mathieuv): msgid=<20121115110341.1A2D21FC75@mail3>: saved mail to INBOX
    postfix/local[31167]: 416F01FCCD: to=<mathv@domain.com>, relay=local, delay=0.03, delays=0/0.01/0/0.02, dsn=2.0.0, status=sent (delivered to command: /usr/libexec/dovecot/dovecot-lda -f "$SENDER" -a "$RECIPIENT")
    postfix/pipe[31099]: 416F01FCCD: to=<backup@backup3.domain.com>, relay=backup3, delay=0.1, delays=0/0/0/0.1, dsn=2.0.0, status=sent (delivered via backup3 service)
    postfix/pipe[31101]: 416F01FCCD: to=<backup@backup3.domain.com>, relay=backup3, delay=0.1, delays=0/0/0/0.1, dsn=2.0.0, status=sent (delivered via backup3 service)
    postfix/qmgr[28982]: 416F01FCCD: removed


    l'envoi du mail se fait de ligne 1 à 19 et l'autoreply de la ligne 20 à 39.

    Ceci se fait donc d'un user@domain vers un user@virtdomain.

    par contre, je n'ai pas que l'envoi du mail quand je teste d'un user@domain vers un user@domain et pareil venant le l'extérieur vers user@domain et user@virtdomain

    résumé des possibilités de [backup - out-of office] :

    domain to domain -------> OK - NO
    domain to exterieur -----> OK - pas besoin
    domain to virtdomain ---> OK - OK
    virtdomain to domain ---> OK - NO
    virtdomain to extérieur --> OK - pas besoin
    virtdomain to virtdomain > OK - NO
    extérieur to domain ----> OK - NO
    extérieur to virtdomain -> OK - NO

    Je coince grave la

    La possibilité de modifier le script est à écarter pour le moment (je suis ceinture blanche python).

    Je doute (mais pas sur pour avoir déjà testé certaines possibilités) sur la configuration de mon hostname / dns et sur le nom dans le postfix

    la commande hostname me donne :
    mail3.domain.com

    et dans hosts.conf :
    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
    127.0.0.1       localhost.localdomain   localhost.localdomain   localhost4      localhost4.localdomain4 localhost
    ::1     localhost.localdomain   localhost.localdomain   localhost6      localhost6.localdomain6 localhost
    192.x.x.x   mail3.domain.com


    des idées? une piste ? un debug ?

    Merci d'avance

  2. #2
    Membre habitué
    Bon, y a de l'évolution

    plus de out - of - office, mais cette fois-ci, avec des erreurs dans les logs :

    d'un virtdomain vers un virtdomain :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    to=<backup@backup3.domain.com>, relay=backup3, delay=0.16, delays=0/0.02/0/0.14, dsn=5.3.0, status=bounced 
    (Command died with status 1: "/usr/sbin/backup3.py". Command output: generateur : None test@virtdomain.com CHECK TO 
    test1@virtdomain.com Traceback (most recent call last):   
    File "/usr/sbin/backup3.py", line 320, in <module> verif_dossier_backup(home)
    File "/usr/sbin/backup3.py", line 237, in verif_dossier_backup     backup_mail(chemin)   
    File "/usr/sbin/backup3.py", line 223, in backup_mail     clone_mail(string)
    File "/usr/sbin/backup3.py", line 131, in clone_mail     send_vacancy_mail(from_original,y,sujet)   
    File "/usr/sbin/backup3.py", line 166, in send_vacancy_mail     mail = MIMEText(message_conge)
    File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__     self.set_payload(_text, _charset)   
    File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload     self.set_charset(charset)   
    File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset     self._payload = self._payload.encode(charset.output_charset) UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-7: ordinal not in range(128) )


    d'un domain vers domain

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     to=<backup@backup3.domain.com>, relay=backup3, delay=0.14, delays=0/0.02/0/0.12, dsn=5.3.0, status=bounced
     (Command died with status1: "/usr/sbin/backup3.py". Command output: generateur : None 
    sylvainj <user@mail3.domain.com> CHECK TO   user1@domain.com Traceback (most recent call last):   
    File "/usr/sbin/backup3.py", line 320, in <module>     verif_dossier_backup(home)   
    File "/usr/sbin/backup3.py", line 237, in verif_dossier_backup     backup_mail(chemin)   
    File "/usr/sbin/backup3.py", line 223, in backup_mail     clone_mail(string)   
    File "/usr/sbin/backup3.py", line 131, in clone_mail     send_vacancy_mail(from_original,y,sujet)   
    File "/usr/sbin/backup3.py", line 172, in send_vacancy_mail   smtp = smtplib.SMTP('127.0.0.1')   
    File "/usr/lib64/python2.7/smtplib.py", line 249, in __init__     (code, msg) = self.connect(host, port)   
    File "/usr/lib64/python2.7/smtplib.py", line 309, in connect     self.sock = self._get_socket(host, port, self.timeout)   
    File "/usr/lib64/python2.7/smtplib.py", line 284, in _get_socket     return socket.create_connection((port, host), timeout)   
    File "/usr/lib64/python2.7/socket.py", line 571, in create_connection     raise err socket.error: [Errno 111] Connection refused )


    le backup fonctionne malgré ce que dit le log, car on se trouve dans la seconde phase, quand la personne est en congé, le mail est bien émis et reçu !

    - première erreur Oo

    - seconde erreur : ok problème de connexion, du je pense à la modif de etc/hosts :

    Code :Sélectionner tout -Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    127.0.0.1       localhost.localdomain   localhost.localdomain   localhost4      localhost4.localdomain4 localhost       mailserver1     mail3.domain.com
    ::1     localhost.localdomain   localhost.localdomain   localhost6      localhost6.localdomain6 localhost       mailserver1     mail3.domain.com
    192.x.x.x   mailserver1
     
    127.0.0.1       localhost.localdomain   localhost       mailserver1     mail3.domain.com


    Il coince à l'envoi du out of office, mais ou... =/

###raw>template_hook.ano_emploi###