Operating System - HP-UX
1748185 Members
4346 Online
108759 Solutions
New Discussion юеВ

Changing sender address with mpack

 
David L Brewster
Frequent Advisor

Changing sender address with mpack

Hi

I am trying to send out attachments with mpack and the current release that I'm using, Version 1.5, does not allow for you to change the senders address. Would you know if newer releases of mpack allow for that ?

Would you know of a better way to send out emails with attachments, in batch mode, that work with the majority of the email clients ?

We have tested sendmail and mailx working with some mail clients and not working with others.

Thanks
3 REPLIES 3
Steven Schweda
Honored Contributor

Re: Changing sender address with mpack

> I am trying to send out attachments with
> mpack [...]

How, exactly?

> [...] the current release that I'm using,
> Version 1.5, [...]

Do you mean "[...] the release that I'm
currently using, 1.5, [...]"? I thought that
1.6 was more current than 1.5, but I doubt
that the major features changed much.

> We have tested sendmail and mailx working
> with some mail clients and not working with
> others.

If you think that that's a useful description
of either what you did or what happened when
you did it, then think again.

I don't use this stuff on UNIX, but a quick
look at the documentation and the source
suggests that:

1) If you ask mpack to send the e-mail, then
it probably uses sendmail to do it.

2) You can ask mpack to create an e-mail
message file, but not try to send it anywhere
("-o outputfile"). Then, you can send that
message file, yourself.

If you use method 2, then the question
becomes not what mpack can do, but what
sendmail (or some other e-mail client
program) can do. And that way, at least, you
have more control over the sendmail (or
whatever) command line than you do if you let
mpack do all the work.

Knowing nothing about your OS or your
sendmail program, I hesitate to suggest any
particular command-line options, but you
might see if "-f" does anything for you.
Thomas Broccoletti
Occasional Advisor

Re: Changing sender address with mpack


Steve

We are running HPUX 11.11 V1 with 8.9.3 of sendmail.

We are trying to send out emails with attachments to people by a batch job running on the HPUX 11.11 v1 server. When we send out emails with attachments using mpack it works fine, however, we are not about to change the senders email address, the email goes out with the unix id of the bacth executing the mailx command.

When we started testing with mailx for outbound email with attachments with changing the senders address that worked fine, however, some email clients would not interpret the attachment correctly and they would see garbage in the body of the email. I think it has to do with correct mime type handling. I beleive the email should go out with the content-type of multipart/alternative.

Any suggustions ?
Alexander_K
New Member

Re: Changing sender address with mpack

As the previous poster already said, write the mail to a file and then use sendmail:

MAIL=$(mktemp)

mpack -o $MAIL file

echo "To: you@company.com" >$MAIL.head

echo "From: me@company.com" >>$MAIL.head

cat $MAIL.head $MAIL|sendmail -i -t

rm $MAIL.head $MAIL