27 Oct 2011 00:24
Send separate notification to $LOGNAME during maildrop execution
email builder <emailbuilder88 <at> yahoo.com>
2011-10-26 22:24:56 GMT
2011-10-26 22:24:56 GMT
Hello, I want to send a notification to the recipient ($LOGNAME) under certain conditions. This is in addition to normal message delivery. A couple issues arise: 1) This creates a mail loop. To prevent this, we currently create a file in the home directory whose presence indicates that the notification was sent and doesn't need to be re-sent. This works fine, but I'd like to know if there is a better way to handle this. 2) What's the best way to create and send a separate email inside of maildrop? We considered mailbot, which has options we could use to override the recipient address, but using an autoresponse tool for this seems inappropriate. Currently, we have a slightly awkward sendmail execution: /^Delivered-To:\s+.*? <at> (.*)/:h DOMAIN="$MATCH1" cc "| (echo 'Subject: Hello World'; echo 'X-Priority: 1 (Highest)'; echo 'To: $LOGNAME'; echo ''; echo 'This is the notification email body.'; echo 'Each line of the body is in a separate echo statement.';) | $SENDMAIL -t -F Postmaster -f postmaster <at> $DOMAIN -r postmaster <at> $DOMAIN $LOGNAME" 3) As you can see above, we are trying to determine the domain dynamically. Is parsing the Delivered-To header reliable? Is there a preferred way to handle that? ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning <at> Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev(Continue reading)
RSS Feed