Need to redirect sendmail mail already in mailq
Hi,
[apologies not overly sendmail literate]We were redirecting mail for certain users to a hosted mail provided (via the alias file). This provider has changed their servers / settings etc, so we have a pile of mail in the mailq already that I need to get to the individuals concerned. I tried removing the aliases, but the messages are obviously already trying to get to the old address. Is there some way I can force the mail (formail??) in the queue to go to another email address (there is only 4 users involved but they are Group Directors, so could run something on an address by address basis if possible). Thanks, Ean |
Ok,
I think if I got to the /var/spool/mqueue directory and run procmail –Y -d email@address < message-id that this will forward an idividual message to an email address? I can run grep "old@address" * in mqueue directory and it will give me all the dfn.... and qfn.... file (i assume the q one is the actual message queue id) Can anyone give me the command / script to be able to list those files for "old@address" and pipe / pass them to the procmail command (or is there another way to do this??) |
Ok, think I've worked it out..
grep -l "old@address" * |procmail -Y -d new@newaddress |
No that didn't work, the messages come through as blank or not decoded??
|
Hi,
I think that the only way to do what you want, is to write a script to parse all qf* files in /var/spoo/mqueue and replace old@address with new@newaddress (actually you need to do the substitution only for the line that starts with RPFD, but it's more easier to do it for all occurrences of old@address). |
All times are GMT -5. The time now is 07:38 PM. |