I'm trying to get a python script to send mail (using smtplib.SMTP), but postfix is refusing to relay the message. I don't use the Ubuntu 10.10 Virtualmin server as a mail server (I happen to use google apps for that), but I want scripts to be able to send mail. Here is the log, with the addresses replsced with generic ones:
Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: connect from localhost[127.0.0.1]
Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<unimatrix-01.example.com>
Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: lost connection after RSET from localhost[127.0.0.1]
Apr 11 00:50:27 unimatrix-01 postfix/smtpd[25212]: disconnect from localhost[127.0.0.1]
I have already tried with no success, to fix this by running # dpkg-reconfigure postfix according to the Ubuntu Docs. How can I fix this?
Thanks in advance.
Update: Interestingly, apps using PHP can send mail just fine. So, I suspect it has something to do with postfix requireing authentication locally. This is not necessary as I am use sole user of this VP. I hope this helps with troubleshooting.