Changes between Version 24 and Version 25 of bulk-mail-relay


Ignore:
Timestamp:
Dec 23, 2016, 3:28:59 PM (7 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • bulk-mail-relay

    v24 v25  
    117117=== Flush deferred email from one queue to another queue ===
    118118
    119 If deferred email is building up in one instance (referred to below as the clogged instance), you can move it to another instance (referred to below as the target instance). For example if msn-a is deferring email (clogged), but msn-b is delivering (target), you can move all deferred email from msn-a to msn-b by following these steps.
     119If deferred email is building up in one instance (referred to below as the clogged instance), you can move it to another instance (referred to below as the target instance). For example if aol-b is deferring email (clogged), but aol-a is delivering (target), you can move all deferred email from msn-a to msn-b by following these steps.
    120120 
     121NOTE: This only works if you move the messages between instances on the same server.
     122
    121123 * Figure out which instance is running with which IP address:
    122124{{{
    123 0 rustin:~# grep bind /etc/postfix-msn-{a,b}/master.cf
    124 /etc/postfix-msn-a/master.cf:smtp      unix  -       -       -       -       -       smtp -o smtp_bind_address=209.51.172.9
    125 /etc/postfix-msn-b/master.cf:smtp      unix  -       -       -       -       -       smtp -o smtp_bind_address=216.66.15.4
    126 0 rustin:~#
     1250 cleveland:~# ip addr | grep aol
     126    inet 216.66.23.44/27 brd 216.66.23.63 scope global eth0:aola
     127    inet 162.247.75.211/24 brd 162.247.75.255 scope global secondary eth0:aolb
     1280 cleveland:~#
    127129}}}
    128  * Ensure that the target instance will accept relayed email from the clogged instance. Edit main.cf on the target instance (in this case /etc/postfix-msn-b/main.cf), adding the clogged instance's IP address (209.51.172.9) in the mynetworks line.
    129  * Create the file /etc/postfix-msn-a/transport.relay with the contents that instruct the instance to flush all email to the server running on the IP address 216.66.15.4.
     130 * Pull all deferred messages on hold on the clogged instance:
    130131{{{
    131 * smtp:216.66.15.4
     1320 cleveland:~# postsuper -c /etc/postfix-aol-b/ -h ALL deferred
     133postsuper: Placed on hold: 127 messages
     1340 cleveland:~#
    132135}}}
    133 Note: you can replace * with a domain name if you only wanted to flush messages going to hotmail.com but not outlook.com.
    134  * Run `postmap /etc/postfix-msn-a/transport.relay`
    135  * Edit /etc/postfix-msn-a/main.cf and uncomment the transport_maps line at the end of the file.
    136  * Reload postfix: /etc/init.d/postfix reload
    137  * Flush:
     136 * Move all held messages to the target maildrop folder
    138137{{{
    139 postfix -c /etc/postfix-msn-a flush
     1380 cleveland:~# mv /var/spool/postfix-aol-b/hold/* /var/spool/postfix-aol-a/maildrop/
     1390 cleveland:~#
     140}}}
     141 * Clean up. Deferred messages have a corresponding file in the defer queue with the reason why they were deferred. Delete these files.
     142{{{
     143for file in $(find /var/spool/postfix-aol-b/defer -type f); do name=$(echo $file | cut -d/ -f6,7) && [  ! -f "/var/spool/postfix-aol-b/deferred/$name" ] && rm -f "$file"; done
    140144}}}
    141145