1

Topic: Can we smtp mailrelay using mtatransport with a username and password?

Hello.

I'm trying to have all outbound mail for my domain  "mydomain.com" relayed to an external mail relay service, as my ISP block's contacting smtp destination server's directly. (It is an external smtp service that will relay for my own domain.)

It is addressable as smtp1.dnsmadeeasycom:25

I've read through all the posts I could find, but am missing one piece I think.

Here's what I've done so far:

1)   I've set mtaTransport to smtp:[smtp1.dnsmadeeasy.com] in domainName = mydomain.com  in LDAP db

2)   I've set  'domainBackupMX=yes' of my domain in LDAP.

3)  I've commented out 'relay_recipient_maps' in postfix /etc/postfix/main.cf  (actually it was already commented out)

4)  (Yes, I've restarted everything)


The problem is that my mail relay server requires me to have a username and password to authenticate to their SMTP service... 

I don't know how to do this last piece, and I couldn't derive from any of the other posts.    Any ideas?

Thanks!

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Can we smtp mailrelay using mtatransport with a username and password?

realratso wrote:

The problem is that my mail relay server requires me to have a username and password to authenticate to their SMTP service... 

I'm afraid Postfix doesn't support this (as i remember).

- Did you ask admin of smtp1.dnsmadeeasy.com to accept mails relayed from your server? so that it doesn't require username+password anymore.
- Or, is there any guide provided by admin of smtp1.dnsmadeeasy.com to configure relay on your server?

3

Re: Can we smtp mailrelay using mtatransport with a username and password?

Actually with Postfix it is quite easy.. I've been doing it for years.  I'm just not sure how iRedmail and dovecot fits into this...

Perhaps you can still help me bridge the two?

Here's how I've done it with just postfix:

1)  Set up a password maps file (/etc/postfix/sasl_passwd) as follows:
smtp1.dnsmadeeasy.com username:password

2)  chown root:root /etc/postfix/sasl_passwd; chmod 600 /etc/postfix/sasl_passwd
#)  postmap /etc/postfix/sasl_passwd

4 ) In /etc/postfix/main.cf:

relayhost = smtp1.dnsmadeeasy.com
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =

5)   Then postfix reload

4

Re: Can we smtp mailrelay using mtatransport with a username and password?

I didn't test your solution, and i'm not sure it will work as expected.

Anyway, here's the problem:

iRedMail doesn't store plain passwords by default, it's encrypted in MD5 (MySQL) or SSHA (LDAP) by default. So i'm afraid that you cannot generate file /etc/postfix/sasl_passwd with existing accounts.