LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-23-2012, 01:02 AM   #1
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201
Blog Entries: 3

Rep: Reputation: 37
sendmail/postfix - mails are not delivered on shared hosting server


I have Ubuntu 11.10 and I am using it as a server. I have static IP for this server. I have configured bugzilla-4.0.4 on it and I have selected sendmail in mail_delivery_method of Bugzilla.
I can send mails to Yahoo, Gmail, Rediff etc from my ubuntu-11.10-server by Bugzilla and by command line through send mail and postfix.
But when I try to send mails on shared hosting server, it is not delivered there.
I think, a mail should have proper headers so servers do not treat them as a spam and do not reject them.
I can not change the shared server mail settings because the risk of spamming will be increased.
Please tell me the settings for sendmail so I could set the proper headers for mail.
Postfix is also installed on my server but I do not know by which method Bugzilla is sending mails to Gmail, Yahoo etc.
The mail headers of the mail which I send through Bugzilla to Gmail.
Code:
Return-Path: <nobody@xyz.com>
Received-SPF: neutral (google.com: 111.81.xx.x is neither permitted nor denied by best guess record for domain of nobody@xyz.com) client-ip=111.81.xx.x;
xyz.com is written in /etc/mailname.
111.81.xx.x is static IP of my ubuntu-11.10-server.

Please Reply.

Last edited by bloodstreetboy; 05-23-2012 at 01:07 AM.
 
Old 05-24-2012, 10:08 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,298

Rep: Reputation: Disabled
Quote:
Originally Posted by bloodstreetboy View Post
But when I try to send mails on shared hosting server, it is not delivered there.
Do you mean that you can't send mail to recipients with mailboxes on a shared hosting server?
Quote:
Originally Posted by bloodstreetboy View Post
I think, a mail should have proper headers so servers do not treat them as a spam and do not reject them.
That's not the issue. The receiving server is telling you that you should implement SPF:
Quote:
Originally Posted by bloodstreetboy View Post
Code:
Return-Path: <nobody@xyz.com>
Received-SPF: neutral (google.com: 111.81.xx.x is neither permitted nor denied by best guess record for domain of nobody@xyz.com) client-ip=111.81.xx.x;
"SPF" is the Sender Policy Framework. The receiving mail server attempts to do a SPF check of your IP address (111.81.xx.x), and finds that your domain (xyz.com) isn't using SPF at all.

SPF is not mandatory in any way, but SPF records tell a receiving server that a certain server, as identified by its IP address, is an authoritative source for mails from one or more domains, and as such those mails are unlikely to be spam.

You don't have SPF configured for your domain, so the receiving servers has no way of knowing if the "From" address is forged. As a result, the server has to rely on other metrics to determine whether the mails might be spam. Some servers may allow them through, others may have more rigorous anti-spam measures in place and will reject your mails.

The solution is to add SPF TXT DNS records to the DNS zone for your domain. You probably have to speak with your domain registrar or ISP about this.

Quote:
Originally Posted by bloodstreetboy View Post
Postfix is also installed on my server but I do not know by which method Bugzilla is sending mails to Gmail, Yahoo etc.
It's extremely unlikely that you have both sendmail and Postfix installed on the same server. For compatibility reasons, Postfix (and other MTAs) includes an executable called "sendmail".
 
Old 05-25-2012, 07:06 AM   #3
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 300
Blog Entries: 2

Rep: Reputation: 51
First If you are able to send mails through terminal to shared hosting server, you can send mails through bugzilla too.
The sendmail option is correct in mail_delivery_method of bugzilla. The smtp option can give errors in some cases. As you have said, you are able to send mails to gmail, yahoo etc but not to shared hosting server.
The problem is in your postfix settings not on the shared mail server.
open /etc/postfix/main.cf

Take back up of your main.cf, Remove lines (myhostname to inet_interfaces) from your file and put these lines into it.

Code:
Serverhostname = mail.abc.com
myhostname = mail.abc.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = abc.com
mydestination = mail.abc.com
relayhost = 
mynetworks = 127.0.0.1/8 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.2.4
mailbox_size_limit = 0
recipient_delimiter = 
inet_interfaces = all
relaydomains = 
mydomain = abc.com
abc.com is domain of your shared hosting server and mail.abc.com is address of mail server on your hosting server.
Now it will send mails on all sites plus shared hosting servers.

OR

Take backup of your main.cf and remove all contents of it and put these lines in main.cf.

Code:
#See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.


smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.


# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myorigin = /etc/mailname
relayhost =
inet_interfaces = loopback-only
local_transport = error:local delivery is disabled
This is complete text of /etc/main.cf. Both ways worked for me.

Put your domain name of server in file /etc/mailname instead of your system name.

Last edited by fortran; 05-25-2012 at 07:17 AM.
 
Old 05-28-2012, 01:40 AM   #4
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201

Original Poster
Blog Entries: 3

Rep: Reputation: 37
Thanks a lot !!!
Both methods worked for me.
Actually I had to install mail server on one more Linux server, the second method was not working for sending mails on shared hosting server. But First method is working. I think it will work on all Linux server.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail - Some Mails are not getting delivered to Users kindar Linux - Server 10 01-20-2010 05:48 PM
To restrict a user to send mails only to 3 e-mails IDs using postfix mail server sharath41 Linux - Newbie 2 07-21-2008 07:38 PM
multiple mails delivered to same user box by postfix Sleen Linux - Server 3 03-06-2008 05:11 AM
Backup old mails: sendmail --> postfix pujansrt Linux - Software 2 09-28-2006 11:23 PM
sendmail with mail don't get delivered.. postfix to the rescue? rhoekstra Linux - Networking 2 02-28-2006 01:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration