23
Receive mail from any domain up vote 1 down vote favorite I have a mail server whose domain name is "vrk.com" and a user named "vinod" in it... All the mails send to "[email protected]" comes into the mail box /home/vinod/mbox Can i store mails addressed to "[email protected]" in this same mail box i.e /home/vinod/mbox...or into another catch all kind of user which catches all the mails regardless of the domain???? is it possible...i am using Postfix.... mail  postfix shareimprove this questionedited Feb 4 '11 at 18:52 asked Feb 4 '11 at 18:32 Vinod K  1335 2 Answers active oldest votes up vote 0 down vote accepted You can't capture emails addressed to yahoo.com since Yahoo's MX records don't  point to your server, so they'll never get routed through your postfix service. If you're trying to create a catchall for a specific domain what you'll need t o do is create a Virtual Domain file for postfix sudoedit /etc/postfix/virtual In the virtual file add the following: @vrk.com vinod Replace @vrk.com with the name of the domain you want to create the catch-all with (in your question this is where yahoo.com goes - however, as mentioned prior, you can't actually use yahoo.com as a valid domain since Yahoo's mail doesn't route to you) and the vinod part should be replaced with the email username that the catch-all should go to. Once you've created this file you'll need to encode it. That is done simply with the

Receive Mail From Any Domain

Embed Size (px)

Citation preview

Page 1: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 1/23

Receive mail from any domain 

up vote 1down votefavorite 

I have a mail server whose domain name is "vrk.com" and a user named "vinod" init...

All the mails send to "[email protected]" comes into the mail box/home/vinod/mbox

Can i store mails addressed to "[email protected]" in this same mail box i.e/home/vinod/mbox...or into another catch all kind of user which catches all themails regardless of the domain???? is it possible...i am using Postfix....

mail  postfix 

shareimprove this question  

edited Feb 4 '11 at 18:52 

asked Feb 4 '11 at 18:32

Vinod K  1335

2 Answers

active oldest votes 

up vote 0down voteaccepted

You can't capture emails addressed to yahoo.com since Yahoo's MX records don't

 point to your server, so they'll never get routed through your postfix service.

If you're trying to create a catchall for a specific domain what you'll need to do iscreate a Virtual Domain file for postfix

sudoedit /etc/postfix/virtual

In the virtual file add the following:

@vrk.com vinod

[email protected]

with the name of the domain you want to create the catch-all

with (in your question this is where yahoo.com goes - however, as mentioned prior,

you can't actually use yahoo.com as a valid domain since Yahoo's mail doesn't route

to you) and the vinod part should be replaced with the email username that thecatch-all should go to.

Once you've created this file you'll need to encode it. That is done simply with the

Page 2: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 2/23

following:

postmap /etc/postfix/virtual

This does all the jazz (encoding, validating, etc) that Postfix needs in order to read

it. To finish things up you'll want to add some lines to the configuration file andrestart postfix 

Open the configuration file with sudoedit /etc/postfix/main.cf and add thisline to the bottom

virtual_alias_maps = hash:/etc/postfix/virtual

Then the restart with sudo service postfix restart!

shareimprove this answer  

answered Feb 4 '11 at 19:25

Marco Ceppi♦ 19.9k1072121

he opened a separate question for which this is the correct and complete answer.you might want to repost it [here][1] [1]: askubuntu.com/questions/24883/…   – 

 Call me V Feb 5 '11 at 4:36 

In my case the mail server is local...not connected to internet...so yahoo.comwould be just like any-other domain...right??....so it should work...  –  Vinod K  Feb

5 '11 at 4:41 .its working....All the mails...from domains added in virtual file...like this"@yahoo.com root"....arrives....but not inn root mailbox but in nobodysmailbox....any idea why????..can i change it to make it come in root mail box???or shall i create another user in the mail server and give it that mail boxname?????...i think i did that with my mail box name i.e vinod....but only securitymails were coming... –  Vinod K  Feb 5 '11 at 5:06 

up vote 1down vote

If you want to consolidate email from various POP3 accessible servers you can use

the fetchmail package to fetch the email and deliver it to your server. For freemailservices like yahoo you will likely need to enable POP for the address you wish to

fetch. Documentation on configuring fetchmail will likely be in/usr/share/doc/fetchmail or by web at 'http://localhost/doc/fetchmail`.

http://askubuntu.com/questions/24828/receive-mail-from-any-domain?rq=1  

How to set up a mail server correctly? 

up vote 5 down I have read a number guides on setting up a mail server, but none of them

Page 3: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 3/23

vote favorite 

seems to work completely.

My Requirements:

  I want to send and receive mails to and from all domains. (i.e.,yahoo,gmail,aol,etc.)

  I only need real system users.

Note:

  I am running Ubuntu server edition.

setup mail-server  

shareimprove thisquestion 

edited Nov 26 '12 at15:52 

Jorge Castro 23.3k50222446

asked Jul 5 '11 at15:43

karthick87 7,898958141

1 Answer

active oldest votes 

up vote 7 downvote accepted

Open a terminal and type sudo tasksel install mail-server 

That will give you a fully functional mailserver with sane defaults.

For more information on how to setup a more customized solution, refer to theUbuntu Server Guide for 12.04:

  https://help.ubuntu.com/12.04/serverguide/email-services.html 

How do you setup system email to send to aGmail account? 

up vote 3down votefavorite 

Often when I'm working on a terminal, I'll see the "you have new mail in..."message. I know I can see this mail by looking in my system's mail folder, but this isinconvenient. Also, if the message is important, such as a notice about low systemresources, or drive problems, or a failed cron job, I may not see that message or 

Page 4: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 4/23

check the system's mail folder for weeks or more. How can I set it up so that allthese messages get sent to a real email service, like Gmail, which I check daily?

email mail 

shareimprove this question 

asked Aug 24 '11 at 13:26

Cerin 8243930

1 Answer

active oldest votes 

up vote 2down voteaccepted

See this: 

Users can control their own mail delivery by specifying destinations in a file called.forward in their home directories.

So, when you do this:

echo "[email protected]" > ~/.forward

the mails should be forwarded to the e-mail you've specified (in this case,

[email protected])

shareimprove this answer  

answered Aug 24 '11 at 14:01

Piskvor  60439

1

But you also need to be certain that the messages will be received. most IPsfrom residential ISPs from which email is sent from (i.e. the sending server originates at a residential IP) get marked as spam and/or ignored by people.

You may be able to make it work, but the issue is then dealing with spam. –  The Lord of Time Aug 24 '11 at 14:43 

1

@The Evil Phoenix: I'm not suggesting to send this mail to just some randomguy out there - I have the forwarding set to my regular mail inbox, so that themail intended for me goes somewhere where I'll see it (I did whitelist the

equivalent of [email protected], but that's about it). On a side note,SMTP is a best-effort protocol - you can never be completely certain the

Page 5: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 5/23

messages will be delivered. –  Piskvor  Aug 24 '11 at 14:56 

1

@The Evil One, This is my problem, as I get my internet through Comcast or Verizon. So getting sendmail to send email is easy. Getting sendmail to sendemail and get it to reach the recipient is hard, because both Comcast andVerizon block outgoing email sent without authorization. –  Cerin Sep 30 '11 at

18:32 On system's I've confirmed have working sendmail, adding ~/.forward doesn'tseem to have any effect. –  Cerin Oct 15 '11 at 14:54 

How to configure mail (mailutils) to use

Maildir schema by default? 

up vote 2down votefavorite 

When I type mail command, I get a "No mail for USER" answer, but there's

indeed mail (it's in /home/USER/Maildir/new)

I guess it has something to do with the mailbox being in Maildir format, insteadof mbox, but I don't know how to tell mailutils (specifically the mail command)which format to use.

mail 

shareimprove this question  

edited Feb 14 '11 at 13:36 

asked Feb 14 '11 at 12:33

luri 1,760927

1 Answer

active oldest votes 

up vote3 downvote

Afaik "mail" utility checks mails at the location given with the MAIL environment

variable. Try this command: MAIL=/home/USER/Maildir/ mail (for sure, replaceUSER with something meaningful & valid). If that works, it seems that you should set

MAIL variable you can do it in your bash profile / rc file for example. You can check the content of your current MAIL variable with: echo $MAIL 

shareimprove this answer  edited Feb 14 '11 at 13:13 

answered Feb 14 '11 at 13:04

Page 6: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 6/23

LGB 1,07439

I did not say nautilus, but mailutils (similar, tho :) ) –  luri Feb 14 '11 at 13:08 

Arghhh, I haven't slept too much, I must admit :) Okei, and sorry for the misread,

however what I told (the other parts than nautilus, hehe) is still valid. But after thisnasty mistake, I am not sure anymore :-@ –  LGB Feb 14 '11 at 13:12 

OK... if I set MAIL=/home/USER/Maildir/ mail, I get the right number of mails, and Ican read them... BUT upon reading mails, 'mail' command will move them from/home/USER/Maildir to /home/USER/mbox.... wich doesn't exist, so, as a matter of fact, it did erase them (just test mails, so no worries). But shouldn't it realize whereand how mail is stored (btw I have postfix and courier working). –  luri Feb 14 '11 at13:14 

Update: my bad, it does not move mail to /home/USER/mbox folder. It's a file, thatcontains the mails in text format... But anyway it renders them unusable for Courier,that seeks a Maildir schema. –  luri Feb 14 '11 at 13:42 

"text file format"? Then it's the "standard" "unix mailbox" file format, which is justone file (as opposite to the maildir) containing every mails. But I am not sure now, if you write that "it does not move mails" then what's the problem, if mails were notmoved, your mails are still in your maildir (/home/USER/Maildir), isn't it? Or haveyou missed check /home/USER/Maildir/cur/ ? Maildir has cur/ and new/, newcontains the unread mails, cur the read ones. Maybe "mail" utility moved your mailsinto /cur, since they are not new anymore. That is the good behavior, maildir worksthis way! –  LGB Feb 14 '11 at 13:50 

They aren't in either Maidir/new or Maildir/cur.... they're deleted from there (not justmoved from and written to the 'mailbox file', where courier can't access them. Theissue is, then, if there is a configuration file for mailutils where I can set up 'mail'command to use Maildir schema by default, not having to set the MAIL environmentvariable (which would be a minor problem, anyway), and avoiding the erasing (well,erasing in practice for me, though they're really moved to an 'mbox' mailbox) of readmails. –  luri Feb 14 '11 at 22:34 

I would add the global variable as MAIL = ~/Maildir  –  LinuxBill Mar 6 at 14:47 

How can I access system mail in /var/mail/

via thunderbird? 

up vote 6down votefavorite 

I've got cron jobs sending mail to my user at /var/mail. I know how to access thatat the command line with the mail command. But, while a big command line fan, Ido not like reading mail (even system mail) that way.

My mail client of choice is Thunderbird. Can I read /var/mail messages inThunderbird? How?

Page 7: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 7/23

I'm running Ubuntu 9.04 and Thunderbird 2.0.0.24 (though I'm soon to upgraded to10.04).

thunderbird system mail 

shareimprove this question 

edited Aug 15 '12 at 6:37 

Mitch 16.8k62653

asked Aug 11 '10 at 3:44

vanden 435617

1 Answer

active oldest votes 

up vote 9downvoteaccepted

In Ubuntu 10.04, with Thunderbird 3, the option is accomplished by:

1.  Select Edit, Account Settings 

2.  Choose Account Actions, Add other account 

Page 8: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 8/23

 3.  Select Unix Spool (Movemail).

The UI to access this menu is slightly different in Thunderbird 2, but I didn't have ithandy.

In Thunderbird 2, do the following, adapted from the Gmail FAQ: 

1.  Click the Tools menu, and select Account Settings..2.  Click the Add Account... button to launch Account Wizard.

Page 9: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 9/23

3.  Select Movemail from the list.

shareimprove this answer  

answered Aug 11 '10 at 4:22

lfaraone 2,7801023

1

Well, now I feel foolish. (I'd tried some time ago and hope that the option in thewizard post-dates that, else I don't know how I missed it!) Thanks. It was also

necessary to run sudo chmod 01777 /var/mail to get this to work, as without,

thunderbird complained it couldn't write a ~.lock file. –  vanden Aug 11 '10 at12:33 

1@vanden: You should find a lower permission that works or create a group thatallows access. World writeable is dangerous. –  Dennis Williamson Aug 11 '10 at17:05 

1

@Dennis: Thanks. I wasn't pleased by the permissions, either. They weresuggested by the thunderbird interface. I tried removing world write access, butthat prevented access to the mail. Having fetched the backlog, I've reverted. – 

 vanden Aug 11 '10 at 20:14 

How are administrators supposed to read

root's mail? 

up vote 25down votefavorite 

10 

What is the Ubuntu way for system administrators to receive system notifications,which typically take the form of e-mail sent to the root account?

Examples of such notifications are the output of cron jobs, or  degraded RAIDnotifications. 

On a pretty much default Ubuntu 10.04 installation, I can't find any way that

anything happens to root's mail other than being deposited in /var/mail/root. Howare users supposed to 1. discover it and 2. read it as it arrives?

I observe that on a warty, the installer added root: myusername to /etc/aliases.So back then the user who installed the system if (s)he read the local mail. So thereseems to have been a regression somewhere along the way. Still this was not acomplete solution, because Ubuntu users can't be expected to be aware that they havelocal mail and should set up their mail client to read it.

ADDED: given current replies, a server user should be able to cope, provided he'saware of the issue. Fair enough. But consider J. Random Desktop User, who doesn't

Page 10: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 10/23

know how to use a command line, and only knows how to click the mailbox icon toread his mail. How can he be notified that his system wants to tell him something?(Allow a one-time intervention by a more competent user if that's unavoidable.)

mail administration root cron-jobs 

shareimprove this question  

edited Aug 14 '10 at 18:16 

asked Aug 14 '10 at 11:43

Gilles 14k33165

1I managed to get KMail to read my local mail using some very strange hacks Ifound, but since the update to 11.10 I'm lost –  Dirk Hartzer Waldeck   Nov 17 '11at 14:48 

I recently did a long tutorial on this very subject, although relating to

Thunderbird: see askubuntu.com/questions/192572/…   –  Mik  Oct 30 '12 at23:45 

@Mik That, with a little something about installing postfix at the top, wouldmake a nice answer here. –  Gilles Oct 30 '12 at 23:48 

@Gilles Thanks, although I probably would have to shorten or delete the answer at the other question, so there wouldn't be duplication. –  Mik  Oct 30 '12 at 23:53 

@Mik No, it would be fine to repost substantially the same answer (not exactly,since here you'd need to start by installing an MTA). The questions aren'tduplicate: there are answers here that wouldn't work on the other question andvice versa. It does happen that sometimes 90% of an answer can be recycled for 

another question, that's fine. –  Gilles Oct 30 '12 at 23:56 @Gilles Ah, I see, thanks for clarifying the point. –  Mik  Oct 30 '12 at 23:59 

4 Answers

active oldest votes 

upvote

10downvoteacce pted+100

Encouraged in the comments by Gilles, I have adapted and expanded another answer:

  How read local email in thunderbird? 

(I am running Ubuntu 12.04.1 LTS, but the general setup process should apply to previousand future Ubuntus)

The first thing to do is to install a Mail Transfer Agent (MTA) so the mail can be relayed

to a mail User Agent (MUA) such as Thunderbird. This is only necessary because we aredealing with local mail and want to be able to send and receive it; with normal remote

Page 11: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 11/23

gmail type accounts, only a user agent such as Thunderbird is necessary.

I use postfix, which itself is an alternative to sendmail, of which there are commercialand open source versions. More information about postfix's capabilities is at the officialsite and users may find that the mailing lists contain useful information if any issues arise.

So, to install the program, run

sudo apt-get install postfix

You can either configure it when it is installed, or decline the offer and later run

sudo dpkg-reconfigure postfix

to create the important config file (/etc/main.cfg). If you ever manually edit this file,

which is not necessarily recommended, you must run sudo newaliases and sudo

service postfix restart afterwards to apply the changes.

Postfix is pretty straightforward to setup, although you may have some particular settingsthat you wish to apply. In the first screen you see below, you must choose the local optionfor your mail:

Page 12: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 12/23

Then on the next screen choose your 'mail name'; it is usually the same as /etc/hostname.You can accept the defaults for most of the following screens.

Page 13: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 13/23

When it mentions /etc/aliases and the Root and Postmaster recipient (as above), youcan fill in your user name, but make sure you check your aliases file is as it should be byreading the next section of this tutorial.

First, as also recommended in this discussion, your /etc/aliases should be like this if itis setup correctly:

postmaster: rootroot: mike

If not, edit it with sudo nano /etc/aliases, and then run sudo newaliases and sudo

service postfix restart so that the configuration is updated. Postfix's aliasesfeature allows mail to be redirected, so the setup is very important for the rest of thistutorial.

Page 14: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 14/23

As also noted in the above link , you need to create a .forward file containing your 

username and localhost: e.g. mike@localhost so that root's mail will be forwarded to you.To do this, enter these commands:

sudo touch /root/.forward

and then run

sudo nano /root/.forward

to place your user: e.g. mike@localhost in the file and save it.

In addition, I found it was necessary to add your user to the mail group so that

Thunderbird could access the mail files:

sudo adduser $USER mail

and then logout and login for the changes to take effect. There is no need to chown or 

chmod any files, as some articles might suggest, and adding your user to the mail group ismuch better practice and avoids any direct changing of the permissions on the rootfilesystem.

 Now for the Thunderbird configuration. Go to edit > account settings > account actions >add other account > select Unix spoolmail and in the next screen put your username in the

first box and place yourusername@localhost in the second box.

Page 15: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 15/23

 

 Now, go to your new account in account settings and select server settings and select the

local directory as /var/mail or /var/mail/username (if setup), as in the screenshot below.

Page 16: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 16/23

As per the instructions in this article you will need to configure the smtp server if you want

to test the account by sending a mail to root@localhost and then clicking get mail in

Thunderbird to receive it, as root's mail is being redirected to youruser@localhost.

Go to account settings > outgoing server and choose to add a new one. The settings should

 be as in the screenshot below:

Page 17: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 17/23

 

 Now, finally test your account by composing a mail to root@localhost and then a fewseconds later clicking get mail on your account. You should see an email like this:

Some programs or logs will need to be configured so that they send mail to root, but thatcan be decided as you find the need. This article should hopefully be useful as it is not

always straightforward to set up Thunderbird to receive local mail.

shareimprove this answer  edited Oct 31 '12 at 1:50 

answered Oct 31 '12 at 1:08

Mik  12.4k32355

Page 18: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 18/23

upvote14downvote

If this is a server I would strongly suggest you alias root to a real email address so you getyour email delivered to your administrators It is as easy as adding

# Person who should get root's mailroot: [email protected]

to the end of /etc/aliases

Alternatively you can configure mail to be aliased to your local username and then whenyou log in you will get the message "You have mail", which you can check using the

mail command or by installing pine / mutt /alpine or something similar on that server..

shareimprove this answer  

answered Aug 14 '10 at 12:55

Richard Holloway 7,2531741

1

Thanks, that's a good enough explanation for a server admin, I suppose. But how doI explain this to J. Random desktop user, who is definitely not going to use thecommand line, but would like to know if his disks are failing? –  Gilles Aug 14 '10 at18:09 

1

You question starts: "What is the Ubuntu way for system administrators to receivesystem notifications...". But anyway, for desktop users, to keep an eye on the systemmessages they could use gnome-system-log to view logs (which is already installedon a default Ubuntu Desktop as part of gnome-utils package) or add "root:

username" to the end of /etc/aliases. I agree this a weak solution and perhaps a bugshould be raised to get this feature added back in as there is no GUI way to do thison a default Ubuntu install. –  Richard Holloway Aug 15 '10 at 22:02 

The alias for server admins is best. You could also sudo su - then use a CLI client.But if your seriously admining a box, make the alias. Normal users don't need to seethis mail. They have other means for notification messages. If they want to, thenthey can create the alias. It makes perfect sense for this to be off by default. –  coteyr   Nov 4 '12 at 20:09 

upvote 6downvote

I am personaly using a mailer agent called nullmailer. It acts as a mail proxy, andtransfers all mails sent to root to a mail address of your choice.

You need to set its settings in conf files under /etc/nullmailer. Basically : give it your mail porvider address and credentials, and the adress you want to receive the root emails on.

You can install it with

sudo apt-get install nullmailer

Page 19: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 19/23

You can get more information on its setup here :http://jviz.research.iat.sfu.ca/wiki/index.php?title=HOWTO_Setup_Nullmailer  

shareimprove this answer  edited Aug 14 '10 at 16:08 

answered Aug 14 '10 at 12:54

Little Jawa 1,6282815

+1 thanks for the link (and the teeny MTA concept embodied therein) –  msw Aug 14 '10at 14:45 

upvote 2downvote

Currently there is no notification to the user that a root local mailbox even exists, because

user != root If you needed to check the mailbox you could type the following: sudo

mail to launch the mail application under root.

You could also log in as root on that server. To unlock the root password simply type:

sudo passwd and enter a new password for root.

shareimprove this answer  

answered Aug 14 '10 at 12:25

Marco Ceppi♦ 19.9k1072121

1

With a test user in 10.04 using the the default gnome-based interface, or the defaultkde-based interface, or the default lxde-based interface, I don't see any kind of 

notification that there is something in /var/mail/$USER either. –  Gilles Aug 14 '10at 18:11 

dovecot can't compact mail folder

/var/mail/username 

up vote 0down votefavorite 

ubuntu 11.10 32bit. Setup a dovecot imap server. Using Thunderbird on a differentubuntu machine (64bit) to access imap server. Everything else is fine, except I cannot compact the deleted email in inbox, which is stored at /var/mail/username.Checking mail.log and I see this error message:

Apr 3 00:10:11 autumn dovecot: imap(username): Error:file_dotlock_create(/var/mail/username) failed: Permission denied(euid=1000(username) egid=1000(username) missing +w perm: /var/mail,

Page 20: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 20/23

euid is not dir owner) (set mail_privileged_group=mail)

what is wrong with the permission? Here are the permissions for the relevant files:

$ ls -ld /var/maildrwxrwsr-x 2 mail mail 4096 2012-04-02 23:36 /var/mail

$ ls -l /var/mail/username-rw------- 1 username mail 417 2012-04-02 23:36 /var/mail/username

Anyone knows what's going on here?

 permissions mail dovecot 

shareimprove this question  

asked Apr 3 '12 at 4:27

G. He 315514

1I went into /etc/dovecot/conf.d/10-mail.conf, added the group mail to the line"mail_privileged_group = ", stop dovecot, and then start dovecot. It works now.Although I wish this was documented somewhere. –  G. He Apr 3 '12 at 11:56 

It is documented here. Please convert your comment to an answer and accept itso that this question is not left hanging without an answer. –  Celada Apr 4 '12 at16:26 

1 Answer

active oldest votes 

up vote 0 downvote accepted

I went into /etc/dovecot/conf.d/10-mail.conf, added the group mail to the line"mail_privileged_group = ", stop dovecot, and then start dovecot. It worksnow.

As pointed out by Celada, it is documented here. 

Cara Cepat Menghapus Isi Mailbox User Tertentu pada

Zimbra Mail Server

Written by Masim Vavai Sugianto Migrasi Server , openSUSE & SLES, RedHat Family, Tips,Tricks & Tutorial, Ubuntu Family Oct 15, 2010 Print 

Pada kondisi tertentu, ada kalanya kita ingin mengosongkan isi suatu mailbox di Zimbra MailServer, misalnya isi mailbox admin yang terlalu penuh karena dijadikan tempat penampungan

Page 21: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 21/23

sementara . Seorang admin biasanya memiliki 1 email tertentu yang dijadikan sebagaimailbox testing, meski tidak semua admin berperilaku demikian (Admin juga manusia, bisa sama bisa beda, hehehe…). 

Menghapus isi email melalui webmail akan membutuhkan waktu, apalagi jika kapasitasnya

sudah > 1 GB yang berarti ada sekian ribu atau puluh ribu email. Tangan bisa kesemutan kalauharus berpindah dari page ke page hanya untuk menghapus isi mailbox yang terlampau besar.

Zimbra menyediakan CLI (Command Line Interface) yang bisa digunakan untuk melakukan halini. Perintahnya juga sangat mudah dipahami, yaitu :

view sourceprint?1.su - zimbra 2.zmmailbox -z -m [email protected] emptyFolder /Inbox 

Kita bisa mengganti [email protected] dengan account yang kita inginkan dan /Inbox denganfolder yang diinginkan. Harap berhati-hati jangan menyalahgunakan perintah ini karena emailyang terhapus tidak dapat dikembalikan lagi. Lakukan dengan cermat dan hati-hati. 

How do I delete thousands of e-mail messages with cPanel or Horde's webmail interface?

Answer: How do I delete thousands of e-mail messages with cPanel or Horde's webmailinterface?

If you run a website, you may find out one day that you have a mail account containingthousands of messages — or possibly even hundreds of thousands. The most common reason thishappens is because the default e-mail account is set up as a "catch-all" address. This will direct

Page 22: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 22/23

all e-mail sent to invalid usernames at your domain to the default Inbox. Because spammers sendout spam messages to invalid e-mail addresses all the time, the number of e-mails received bythe default mailbox can grow by thousands of messages each day.

The best solution to this problem is to prevent it. If you have a Web server that is running

cPanel, you can turn off the "catch-all" address by selecting the "Default Address" panel withinthe Mail section of the cPanel interface. Then choose the option that says "Discard with error tosender (at SMTP time)." This will  bounce all invalid e-mails back to the sender and will keep themessages from piling up in your default mailbox. Over time, this can help save a lot of hard disk space on your server.

Of course, if you're like me, you caught this problem after thousands of messages had alreadyfilled your default e-mail account's Inbox. In my case it was over 500,000 messages. I realizedthat deleting these messages one page at a time via the Horde webmail interface would takeawhile (as in several days). So I figured there must be some easier way to delete the messages.Fortunately, after doing some research, I found that there is indeed a simple way to remove all

the messages in the Inbox.

Just follow these basic steps: 

1.  Log into the Horde Mail system.2.  Click the "Folders" icon at the top of the window.3.  Check the box next to "Inbox" or the mailbox that contains the messages you want to delete.4.  From the "Choose Action:" drop-down menu, select "Empty Folder(s)."5.  You will be prompted to confirm the action, as it is not undoable.6.  Click "Empty Selected Folders" to clean out the mailbox.

Depending on how many messages are stored in your Inbox, this operation may take a fewseconds to several minutes to complete. The only catch is that if the mailbox contains too manymessages, the operation will time out and will not empty the mailbox. This is what happened to

me with my 500,000+ messages.

If this is also your situation, you may have to delete the message folders manually. To do this,you will first need to navigate to the mail folder, which is located in the following directory:

/home/username/mail/ (where "username" is the username for the mail account)

The two folders you'll need to delete are the cur and new folders, which contain the messages.You may be able to do this with an SSH or SFTP program, though I also had problems with thismethod timing out. If you know some basic Unix commands, you can use a terminal (command-line) program to manually delete the folders. First navigate to the mail folder, then recursively

delete the cur and new directories. The commands to do this are:

$ cd /home/username/mail $ rm -rf cur $ rm -rf new 

Again, even this method may take awhile if the directories are loaded with thousands of mailmessages. But it should eventually remove the folders. This command-line method should only

Page 23: Receive Mail From Any Domain

7/27/2019 Receive Mail From Any Domain

http://slidepdf.com/reader/full/receive-mail-from-any-domain 23/23

 be used a last resort, as the maildirsize file will no longer contain the correct information for themail account. Fortunately, as soon as a new message is received into the empty Inbox, the cur and new folders are automatically recreated and the maildirsize is updated with the correct data.

If you have been wondering how to delete a large number of messages stored on your mail sever,

I hope this information is helpful and saves you a lot of time. 

How To Delete Mails From Or To A Specific Email Address

From Your Mail Queue (Postfix)

Version 1.0Author: Falko Timme <ft [at] falkotimme [dot] com>Last edited 01/04/2008

If you get hit by a spam attack that floods your server with hundreds/thousands of emails from

the same sender email address or to the same recipient email address, you can clean your mailqueue from these emails with one single command before the mail flood takes your server to itsknees.

You can check your current mail queue like this:

 postqueue -p

To delete all mails from the mail queue that come from [email protected] or are sent [email protected] (the command is the same regardless of if it's the sender or recipientaddress), you can use this command:

mailq | tail +2 | awk 'BEGIN { RS = "" } / falko@example\.com$/ { print $1 }' | tr -d '*!' | postsuper -d -

Afterwards check your mail queue again:

 postqueue -p

It should now be much shorter.