There's info and misinfo in this thread about the rules around stations.
Let me try to spell some stuff out. You have to take into account system, wanted and Powerplay ('PP') status.
Any firing inside the mailslot is death, under any circumstances. (Except that SLF were allowed, at least in Anarchies, but I think that was patched.)
Firing weapons (without hitting) outside the mailslot but inside the no fire zone ('NFZ') is just a fine.
You will be fined, but will incur no bounty, hence will NOT be attacked by the station/cops for:
- Firing weapons inside NFZ, if nothing is hit
- Shooting/killing a Wanted NPC or Cmdr, inside NFZ
- If ('if') you are pledged to the PP controlling faction of the system, shooting/killing any PP Hostile, even if Clean. (Example: I am pledged to Hudson. If I saw an Alliance Cmdr, clean, in Nanomam, Hudson's HQ, I could blow him up right in front of station.)
- Shooting/killing anyone outside mailslot in Anarchy
EXCEPT that you WILL be attacked by station/cops if:
- Any of your fire whatever touches the station itself or any of its NPC faction members. Frags and missiles can do this half a galaxy away. Anarchy no exception. (Example: Cmdr attempts to kill Cmdr in Anarchy. Blocks mailslot and fires volley of four frags away from station. One slug touches shield of NPC T-6 aligned to station faction. Station instantly becomes hostile...)
- As above but with any Clean in policed space. Basically stray fire is a no-no.
Putting the above together, various surprise tactics are available:
- Pledging to the PP controlling faction offers opportunist attack potential against PP pledgers. Personally as an (almost) three year Fed I think a longer cooldown should be imposed on faction surfing but it's there for now
- Using long range weapons from outside NFZ is a key attack tactic.
- Above combined with a clean buddy of attacker is classic trap: clean buddy shoots, deliberately missing, while long range attacker hits; victim thinks clean buddy is aggressor, shoots him and dies
- Above combined with Eagle ram also very potent: victim increases speed above 100 mps in response to aggression, rammed by 1% Eagle leaving mailslot, station kills as murderer
Weapons such as RC torps and force shell cannons can impede and/or panic a docking ship. Large ships can legally cause considerable damage with <100 mps rams. Ships can be pushed around by rams and force shell. Ships can be bumped from beneath speed limit to above it just before being Eagle rammed.
By reason of all the above the only truly safe response to aggression near a station is to do nothing except slowly to dock as normal, well beneath 100 mps. Whether this is achievable will depend upon strength of ship defences and ability to get past 'bumper cars'.