Sendmail DNS issue

If I send mail from the prompt using the mail command sending mail works great. But when I try to send mail from a python script the mail doesn't get sent, it's just stuck in the queue:
Code:
beaver@rocks001 ~# mailq
                /var/spool/mqueue (1 request)
-----Q-ID----- --Size-- -----Q-Time----- ------------Sender/Recipient-----------
n3MDYKjb000845     3231 Wed Apr 22 15:34 <admin@rocks001>
                 (Deferred: Name server: mail.XXXXX.no.: host name lookup failur)
The python script looks like this:
Code:
msg = MIMEText(mail)
msg['Subject'] = 'Packages'
msg['From'] = fromaddr
msg['To'] = toaddrs
msg['Content-Type'] = 'text/html'
server = smtplib.SMTP('localhost')
server.sendmail(fromaddr, toaddrs, msg.as_string())
server.quit()
 
Check if resolving works correctly and you're able to get the MX record for that domain: dig some.domain.com MX
 
Back
Top