<<< Date Index >>>     <<< Thread Index >>>

Re: Mail sends to all addresses except one



>-----Original Message-----
>From: owner-mutt-users@xxxxxxxx [mailto:owner-mutt-users@xxxxxxxx] On
Behalf Of Kyle Wheeler
>Sent: 08 May 2008 06:33 PM
>
>
>On Thursday, May  8 at 05:56 PM, quoth Dirk Moolman:
>> We have postfix installed (also bundled with the media)
>>
>> postfix-2.1.1-1.17
>
>Hm. Okay. I don't know much about postfix, but it's sendmail binary
>*should* support the -f flag (and *does*, according to the manual
>http://www.postfix.org/sendmail.1.html).


Sorry, my mistake - yes, it does have the -f flag. From the man pages:

       -f sender
              Set the envelope sender address. This is the address where
delivery problems are sent to, unless the message
              contains an Errors-To: message header.



>>>> Where my Linux server sends:
>>>>
>>>>      From: root[dirkm@xxxxxxxxxx]
>>
>>> Weird... That looks like an invalid construction. Is that just how
the
>>> email is displayed, or is that the raw source of the email?
>>
>> I am not sure.  Will I see this in the header ?   When I open the
>> header, I find:
>>
>> From: "root" <dirkm@xxxxxxxxxxxxxxxxx>
>
>
>Ahh, okay, that's fine. Many mail reader programs try and make email
>headers look prettier, and so their output isn't a good way to
>diagnose what might be really going on. To know what's *really* in the
>email, you need the un-modified raw email (what it's called depends on
>your email program).
>
>
>>>> I also set +ACQ-REPLYTO in the muttrc file:
>>>>
>>>>>>> set envelope_from=yes
>>>>>>> set hdrs=yes
>>>>>>> my_hdr From: +ACQ-REPLYTO
>>
>>
>>> How is REPLYTO supplied to mutt?
>>
>>
>> The REPLYTO is sent to the script via a parameter (+ACQ-5), which is then
>> assigned to the variable REPLYTO.
>
>
>That could be your problem. Let's see this script.



My script - not very elegant, but it does the trick:

########################################################################
########
## Program name : mailmx
## Purpose      : To mail file attachments
## Author       : Dirk Moolman
## Date written : 25-07-2006
########################################################################
####


if [ -z "+ACQ-5" ]
then
        echo
        echo " USAGE: mailmx <Email Addr> <Subject> <File> <Attachment
name> <Sender>"
        echo
        echo " Note: parameters must be given in quotes"
        echo
else
echo "Sending mail ..."
echo
        MAILMX_TO=+ACQ-1
        MAILMX_SUBJECT=+ACQ-2
        MAILMX_FILE=+ACQ-3
        MAILMX_ATTACHMENT=/tmp/+ACQ-4
        MAILMX_FROM=+ACQ-5
        export MAILMX_TO MAILMX_SUBJECT MAILMX_FILE MAILMX_ATTACHMENT
MAILMX_FROM

        # Because mutt does not handle renaming of attachments, this
script
        # now has to do the renaming
        # This is not very efficient, as big files will take system
resource
        # to be "renamed" (copied)
        cp +ACQ-MAILMX_FILE +ACQ-MAILMX_ATTACHMENT


## this was added to change the From: address for the e-mails being sent
out
REPLYTO=+ACQ-5
export REPLYTO

echo "" | mutt -x -a "+ACQ-MAILMX_ATTACHMENT" -s "+ACQ-MAILMX_SUBJECT"
"+ACQ-MAILMX_TO"
"+ACQ-MAILMX_TO";



        ## mutt was giving errors, so I added the sleep, to give mutt
time to
        ## complete its processing, before removing the file
        sleep 10
        rm +ACQ-MAILMX_ATTACHMENT
fi



*** Disclaimer ***

The information contained in this e-mail is confidential and legally privileged 
and is intended solely for the addressee and to others who have the authority 
to receive it. Access to this e-mail by anyone else is unauthorized and as 
such, any disclosure, copying, distribution or any action taken or omitted in 
reliance on it is unlawful. If you have received this e-mail in error, please 
notify the sender immediately.

The views expressed in this e-mail are the views of the individual sender and 
should in no way be construed as the views of the Company.

The Company is not liable to ensure that outgoing e-mails are virus-free.

The Company is not liable, should information or data, for whatever reason, be 
corrupted or fail to reach its intended addressee.

The Company is not liable for any loss or damage of whatsoever nature and 
howsoever arising resulting from the opening or the use of the information in 
this e-mail, including its attachments and links.

The sender of this e-mail is subject to and bound by the terms and conditions 
of Company+IBk-s Electronic Communications Usage Policy.