Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am currently using postfix as my MTA and i would like to put some restrictions in place for some particular users. Postfix can't do that.So that is why i want to run two MTAs on one server.
About the ports i can always change the port numbers and have two network cards i.e two IP address for one Server.
My MTA is postfix and currently i have 120 users.I want to restrict 100 user from sending mail above 1MB. If i do put the restriction then everyone if affected which isn't my intention. That is why i asked if i can run two MTAs on the same machine,have two network card with different IP addresses and Both MTAs have different Port numbers. Yes all point to the same MX record.
Not opining on the benefits of the various approaches, but it's pretty easy to run multiple instances of postfix on one machine. You simply copy the relevant part of /etc/postfix to, say, /etc/postfix1, and create a new startup/shutdown to start postfix with "postfix -c /etc/postfix1 start", etc.. I did this some time ago, more as a exercise for some reason I don't recall, but it definitely works.
...and a separate set of queues (separate instances must have different queues).
You can use restriction classes to do certain things, but message_size_limit is global. What do you do with multi-recipient messages, where one user has a limit and one doesn't? You can't reject the message until the entire message has been received ( to know the size ). Once you've received the message (you've accepted it),you can't reject it for some, but not others.
You can try MailScanner which integrates with postfix. It can check message sizes and send friendly rejection messages when the limit is reached. It also has antispam and antivirus features.
Not sure if that was directed at me, but you get the whole kit and kaboodle duplicated, so it's equivalent to running on a different server.
It isn't clear to everyone that a separate set of queues is required. I just added to your description to clarify for others. The ellipses were added to suggest that the addition is what you would have said.
Quote:
Originally Posted by billymayday
Note that the OP is wanting to restrict sent message sizes, not received by the look of things btw
The message_size_limit parameter is a cleanup(8)/smtpd(8) parameter, and as such controls the size limit of all messages entering into postfix. Hence, it is inbound and outbound.
Code:
main.cf
message_size_limit = 50000
Eg: via sendmail:
Code:
Aug 15 10:14:42 mrc postfix/postdrop[5918]: warning: uid=0: File too large
Aug 15 10:14:42 mrc postfix/sendmail[5917]: fatal: root(0): message file too big
Eg: via SMTP:
Code:
Aug 15 10:21:51 mrc postfix/smtpd[6429]: connect from localhost[127.0.0.1]
Aug 15 10:21:51 mrc postfix/smtpd[6429]: 5FB51C8246: client=localhost[127.0.0.1]
Aug 15 10:21:51 mrc postfix/cleanup[6434]: 5FB51C8246: message-id=<1218820910.6264.0.camel@mrc>
Aug 15 10:21:51 mrc postfix/smtpd[6429]: warning: 5FB51C8246: queue file size limit exceeded
Aug 15 10:21:51 mrc postfix/smtpd[6429]: disconnect from localhost[127.0.0.1]
It isn't clear to everyone that a separate set of queues is required. I just added to your description to clarify for others. The ellipses were added to suggest that the addition is what you would have said.
That's fine - I hadn't taken any offence btw
Quote:
Originally Posted by Mr. C.
The message_size_limit parameter is a cleanup(8)/smtpd(8) parameter, and as such controls the size limit of all messages entering into postfix. Hence, it is inbound and outbound.
I was really only responding to the reject point - the presence of multiple recipients doesn't matter if the restriction is intended for outgoing messages since if it's over the limit it gets rejected period, but it could get messy on inbound
It'll be interesting to see how the pilicyd goes. Hopefully it will get posted.
Last edited by billymayday; 08-15-2008 at 03:25 PM.
Are you set in your ways on using postfix? I prefer qmail for smtp relays. You can accomplish what you would like to do with 1 install of qmail and 2 smtpd configurations with each of the two smtpd's running on a different port. You can set the DATABYTES variable in each instance for the size of the e-mail that you would like to allow. A question that I don't believe has been addressed yet is how are you going to police who is connecting to each instance? Is this an environment where the different users talk to each other and one can tell the other about the "big" setting, or it this for clients who are not likely to figure out how to abuse your system and there is some flavor of auth mechanism involved?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.