- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: mailing with attachment outside domain problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 12:52 AM
тАО04-08-2005 12:52 AM
mailing with attachment outside domain problem
I have two functions in a shell script which mails an attachment. The first one gives a notification to me if the script was executed successfully (displayed below)
The second function mails a data file to several people.
The script is executed from a HP-UX 11.11 box
function f_success_mail
{
subject=" Script ${SCRIPTFILE} executed successfully"
printf "\a \n ${subject} \n \n" >> ${LOGFILE}
logalias=verslag.log
# echo "Convert file to DOS mode..."
unix2dos ${LOGFILE} ${LOGFILE} 2>/dev/null
# Send the E-mail message...
/usr/bin/mailx -m -s "${subject}" ${SUCCESS_ADDRESS} <<-EOF
Hi,
Script ${SCRIPTFILE} runned successfully.
See attachment: ${logalias}
~< ! uuencode ${LOGFILE} ${logalias}
This email message was created automatically by UNIX
~.
EOF
}
The problem is: The second function does will only be delivered to people inside our domain, but it will not be delivered outside our domain.
The mail.log on HP-UX tells me: тАЬMessage accepted for deliveryтАЭ
In the maillog of the smart relay host (a linux can) the following line occurs:
Apr 8 08:45:34 hrn20 sendmail[14100]: j386jBl9014079: to=
I think that the oracle@srv-h.foo.nl
If I use the -r option (return address) the mail will be sent without the attachment, because the -r option disables all tilde commands. If I send the mail without the тАУr option the mail probably gets rejected by the mail relay server.
Does anyone have a good advice (I prefer a solution though)?
Rena
- Tags:
- attachments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 01:16 AM
тАО04-08-2005 01:16 AM
Re: mailing with attachment outside domain problem
- Tags:
- broken URL link
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 01:29 AM
тАО04-08-2005 01:29 AM
Re: mailing with attachment outside domain problem
I already found those threads in another forum, but since i am DBA and do not have access as root of the relay host, I first hope to find the solution in my syntax instead of annoying our system administrator with sendmail configuration changes, because he is very busy with another project and I yet don't want to die.
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 01:37 AM
тАО04-08-2005 01:37 AM
Re: mailing with attachment outside domain problem
Other than this there seems to be no error with syntax.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 01:52 AM
тАО04-08-2005 01:52 AM
Re: mailing with attachment outside domain problem
The -EOF escape leading tabs in the second EOF. That's not the problem, but only for nicely identing scripts. Some people love it, some hate it like their mother in law...
The syntax is OK, but let me trie to explain. When you mail like:
mailx -r ${reply_adress} -m -s "${subject}" ${address} <<-EOF
Hey dude,
blah blah
Here is the attachment: ${alias}
~< ! uuencode ${file} ${alias}
Cheers man!
~.
EOF
The tildes [~] are disabled (see man mailx) and no attachment will be sent.
When you mail without the -r option the mail somewhere dissapeares.
What I like to know is: Can I replace the tilde commands with something else? i.e.
hubbabubba ~< ! uuencode ${file} ${alias}
...
hubbabubba.
Thanks,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 05:54 AM
тАО04-08-2005 05:54 AM
Re: mailing with attachment outside domain problem
Didn't look at the other url threads, but you should get your SA to put an entry in your send mail configuration file for the mail server in your environment.
This was the edit our shop required.
Best of luck.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-08-2005 08:12 AM
тАО04-08-2005 08:12 AM
Re: mailing with attachment outside domain problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2005 06:14 PM
тАО04-11-2005 06:14 PM
Re: mailing with attachment outside domain problem
Excuse me for the late reply, I had a day off yesterday. I have found the solution. To get rid of the tilde commands, I used the following command:
mailx -r ${SENDER} -m -s ${subject} ${RECEIVER} << EOF
$(ux2dos ${DATFILE} | uuencode ${filealias})
Hey dude,
blah blah
Here is the attachment: ${alias}
EOF
Thanks for all the replies.
Cheers,
Renarios
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-11-2005 06:21 PM
тАО04-11-2005 06:21 PM
Re: mailing with attachment outside domain problem
Mail No attachment, body only -
mailx -m -s "Some Subject" somone@somewhere.com < file_for_email_body
Mail with attachement, no body -
ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com
Mail with attachment and body -
ux2dos /path_to/some_file | uuencode some_file.txt | mailx -m -s "MAIL FROM Someone" someone@somewhere.com < file_for_email_body
Mail with carbon and blind carbon -
mailx -m -s "Some Subject" somone@somewhere.com < file_for_email_body
(the file_for_email_body should look like this - )
~c someone_to_cc@somewhere.com
~b someone_to_bc@somewhere.com
The remainder of this file is the text body of the email.
Mail as another sender
echo "Hello" | mailx -m -s "Greeting" -r Santa.Claus@north_pole.com someone@somewhere.com
Mail with multiple attachments (The sentence "This is all you get." will appear as the body.)
mailx -m -s "Hello" someone@somewhere.com << END
`ux2dos /home/some_file | uuencode some_file.txt`
`ux2dos /home/some_other_file | uuencode some_other_file.txt`
This is all you get.
END
Cheers,
Renarios