First Of all we need Valid domain name if we send the mail through operating system then this utility send the mail use this combination(operating system user name and hostname).
Example: abc@localhost.com.in(where abc is OS User and localhost.com.in is hostname)
We had resolved this issue use the below steps:
Step 1: Login with root user.
[root@localhost.com.in]#
Step 2: Add below line in /etc/postfix/main.cf.
[root@localhost.com.in]#vi /etc/postfix/main.cf
myorigin = domain name (As you like)
Step 3: Restart the postfix services.
[root@localhost.com.in]#/etc/init.d/postfix restart
Step 4: Switch the OS user and then Testing mail working or not.
[abc@localhost.com.in]$ mail -s "Test" abc@gmail.com </dev/null
Step 5: Check logs.
[abc@localhost.com.in]$ tail -f /var/log/maillog
After doing above given steps our issue resolved.........
What domain name to use in outbound mail
The myorigin parameter specifies the domain that appears in mail that is posted on this machine. The default is to use the local machine name, $myhostname, which defaults to the name of the machine. Unless you are running a really small site, you probably want to change that into $mydomain, which defaults to the parent domain of the machine name.
For the sake of consistency between sender and recipient addresses, myorigin also specifies the domain name that is appended to an unqualified recipient address.
Examples (specify only one of the following):
/etc/postfix/main.cf: myorigin = $myhostname (default: send mail as "user@$myhostname") myorigin = $mydomain (probably desirable: "user@$mydomain")
No comments:
Post a Comment