Changes between Version 24 and Version 25 of bulk-mail-relay
- Timestamp:
- Dec 23, 2016, 3:28:59 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
bulk-mail-relay
v24 v25 117 117 === Flush deferred email from one queue to another queue === 118 118 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-bis delivering (target), you can move all deferred email from msn-a to msn-b by following these steps.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 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. 120 120 121 NOTE: This only works if you move the messages between instances on the same server. 122 121 123 * Figure out which instance is running with which IP address: 122 124 {{{ 123 0 rustin:~# grep bind /etc/postfix-msn-{a,b}/master.cf124 /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:~#125 0 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 128 0 cleveland:~# 127 129 }}} 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: 130 131 {{{ 131 * smtp:216.66.15.4 132 0 cleveland:~# postsuper -c /etc/postfix-aol-b/ -h ALL deferred 133 postsuper: Placed on hold: 127 messages 134 0 cleveland:~# 132 135 }}} 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 138 137 {{{ 139 postfix -c /etc/postfix-msn-a flush 138 0 cleveland:~# mv /var/spool/postfix-aol-b/hold/* /var/spool/postfix-aol-a/maildrop/ 139 0 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 {{{ 143 for 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 140 144 }}} 141 145