-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring spfmilter or bms with pymilter #2
Comments
pymilter is a library. By "running", I'm guessing you mean running the sample? Is the sample actually useful? If not, don't run it. :-) The milter API does support multiple milters. They each need their own socket or internet port. Sendmail calls them in the order they are declared. You have a design choice of creating a single big milter (like bms.py), or several smaller ones like spfmilter.py and dkimmilter.py. If you do create a single big milter, I suggest a plug-in approach. That was the mistake I made with bms.py - everything is all intermingled. |
Yeah, I was running the sample.py just to test the pymilter, which was properly working. But the problem where I really encountered was when I cloned the milter repo and tried to run bms milter or spfmilter or dkim-milter for the local mails received by sendmail I am getting the following errors which I am not able to figure out. Can you please have a look at it, it would be a great help. Thanks. |
Well, the spfmilter problem is easy: you have to configure the socket in sendmail to match each milter you run. That is true no matter what language the milter is written in. The bms.py milter is missing permission to write to /var/log/milter directory. On the redhat and fedora rpm, I run bms.py as the mail user, and /var/log/milter is writable by mail. I only have rpm packaging to set all that stuff automatically. What system are you packaging/installing for? Look at milter.spec to get an idea of the setup required. The dkim-milter.py requires python-pydkim (or dkimpy). It looks you need that. Packaging has dependency info. I have only used RPM for installable packages. Are you building from source? Are you creating an installable package for your system? What system? |
Here are the installed files for the milter RPM:
|
Yes, I am building it from source. Did you built it in RHEL? I am building it in Ubuntu 16.04. |
Do you know how to make debian/ubuntu packages? I don't. I would be glad to include your debian packaging. I don't even know what the debian equivalent of a SPEC file is, however. All I know is the binary packages are called *.dpkg and are installed with apt-get. |
In the Redhat/Fedora world, we use 'mock' to build packages in a container, which makes sure all the BuildRequires are correct. Many of the run-time requirements are detected automatically. |
There are many optional dependencies for the bms milter. For instance, pydspam is required for the bayesian content filter feature. RPM now has metadata for suggested dependencies - something debian has had for a long time. |
Yes, I build for RedHat and Fedora. I run mail servers on CentOS, currently CentOS-7. |
Hey Stuart @sdgathman , After your comments I started building my own milter with the help of the following documentation (https://pythonhosted.org/pymilter/annotated.html) but there is one issue with which I am stucked that is milter.addheader, milter.chgheader functions are throwing the following errors which I am not able to figure out. Can you please have a look at it. |
add/chg header and replacebody must be called from eom callback. Annoying, I know. The pythonhosted.org site is readonly now, and won't accept updates. So I moved docs to pymilter.org. I haven't advertised it yet, as it needs to be checked out. Please take a look. For instance, https://www.pymilter.org/pymilter/classMilter_1_1Base.html#a23df18e239f441049e17d4e87b61be1c is addheader - which mentions that it must be called from eom. Since there are so many things that can only be called from eom, there should probably be a mention of that in the overview. libmilter give no indication of the cause of the milter.error. However, if there was a simple and reliable way for the addheader method to determine whether it was being called from eom() callback, we could throw a more informative exception. Maybe set a flag in the Milter.Base object when calling eom(), and ensuring it gets cleared again with try: except: |
Thanks, I couldn't have figured out this easily. Do you have tested or know that can we integrate SpamAssassin and ClamAV with pymilter? |
I have setup the pymilter with sendmail and it is able to read the subject on the running socket now I want to filter the mails and modify the subject to mention whether it's a spam or not along with mentioning the score using the spfmilter or bms but I am not able to figure out how can I configure the bms or spfmilter with the already running pymilter. Can you please suggest how should I do it?
Thanks.
The text was updated successfully, but these errors were encountered: