Thread: syntax for mail
View Single Post

  #2 (permalink)  
Old 02-11-2008, 02:12 PM
agn agn is offline
Member
User
 
Join Date: Feb 2008
My distro: OpenBSD/FreeBSD/Debian/Fedora/RHEL
Posts: 69
Rep Power: 1
agn is on a distinguished road
Default

Your question isn't clear. But from what I understood this maybe what you're looking for

Code:
if [ $mailfrom = "domain.com" ]
then
    # do something
else
   # do something else
fi
To get the domain part you may do something like this

Code:
mailfrom=$(echo user@domain.com | cut -d '@' -f 2)
Hope this helps.
Reply With Quote