How to use Getmail with an external MDA

Hello guys,

This post comes from an issue that I have noticed in one of my Smart Hosts while I was using Getmail with an external MDA, who was delivered with Sendmail.

Since I have not found anyone relating this issue I will explain first and show the solution after.

Adding real users in this Smart Host, who was hosting one domain, some of them once in a while, reported that was mails with incomplete body being received. Doing a debug to see where was the problem, I notice that there was some issues when special characters( like .,-_ …) was present in mail body. In this cases when attachements was presents, the destination user was unable to receive those attachements. There was no relation in each mail related with the character that was being classified as an end mail message.

Knowing that there was a problem with Getmail RC’s, I contact Charles Cazabon from Getmail to see if he could help me.

After talk to him about this issue and showing him one of the RC’s that I was using, he identified some fields missing while calling Sendmail, it was some arguments left. And one of those arguments, was the -i.

This -i argument is responsable to the way how Sendmail identifies the end of one mail, and without it, it uses a dot (.) to be used as a mark by default(Check here). From what I have saw in other tests before with characters, to see if I could exploit this problem, and from what my users where receiving, there was no link to the dot being used as an end, being exploited randomly.

After adding this argument, I noticed that was the problem, using some mails from my users that was triggering this problem.

Now each Getmail RC per user uses this configuration:

[retriever]
type = SimplePOP3SSLRetriever
server = remote_server
port: 995
username = email
password =  pass

[destination]
type = MDA_external
path = /usr/sbin/sendmail
arguments = (‘-i’,’-f local_user_name‘,”-bm”, “local_user_name“)
unixfrom = true

[options]
delete = true
message_log = ~/.getmail/logs/getmailrc_local_user_name.log

The -f argument is to set an address where delivery problems are sent to.

I advise you to use only SSL connections with strong passwords with random characters for user acounts at the remote mail server to improve security.

I hope this post could help more people who may find this same problem, like I was.

And I want also to thanks Charles Cazabon from Getmail for the big help that he gave me here.

One thought on “How to use Getmail with an external MDA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s